From f3e721b7caaafbcd5d6a5149949220063ed07bc7 Mon Sep 17 00:00:00 2001 From: Arnaud Levy <arnaud.levy@noesya.coop> Date: Mon, 3 Jun 2024 12:36:48 +0200 Subject: [PATCH] =?UTF-8?q?Ajout=20des=20fichiers=20statiques=20des=20cat?= =?UTF-8?q?=C3=A9gories=20de=20personnes=20et=20organisations=20(#1943)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * wip * git_path --------- Co-authored-by: Sébastien Gaya <sebastien.gaya@gmail.com> --- .../website/permalink/organization/category.rb | 4 ---- .../communication/website/permalink/person/category.rb | 4 ---- app/models/university/organization/category.rb | 9 +++++++++ app/models/university/person/category.rb | 9 +++++++++ 4 files changed, 18 insertions(+), 8 deletions(-) diff --git a/app/models/communication/website/permalink/organization/category.rb b/app/models/communication/website/permalink/organization/category.rb index a1d1b96e4..ef5fb6ec2 100644 --- a/app/models/communication/website/permalink/organization/category.rb +++ b/app/models/communication/website/permalink/organization/category.rb @@ -18,10 +18,6 @@ class Communication::Website::Permalink::Organization::Category < Communication: protected - def published? - website.id == about.communication_website_id - end - def substitutions { slug: about.slug diff --git a/app/models/communication/website/permalink/person/category.rb b/app/models/communication/website/permalink/person/category.rb index 0bfe1edf5..7b4b2ef0e 100644 --- a/app/models/communication/website/permalink/person/category.rb +++ b/app/models/communication/website/permalink/person/category.rb @@ -18,10 +18,6 @@ class Communication::Website::Permalink::Person::Category < Communication::Websi protected - def published? - website.id == about.communication_website_id - end - def substitutions { slug: about.slug diff --git a/app/models/university/organization/category.rb b/app/models/university/organization/category.rb index 3bbc8b2aa..cdfdf33c4 100644 --- a/app/models/university/organization/category.rb +++ b/app/models/university/organization/category.rb @@ -29,6 +29,7 @@ class University::Organization::Category < ApplicationRecord include Permalinkable include Sluggable include Translatable + include WithGitFiles include WithUniversity has_and_belongs_to_many :organizations, @@ -39,6 +40,14 @@ class University::Organization::Category < ApplicationRecord scope :ordered, -> { order(:name) } + def git_path(website) + git_path_content_prefix(website) + git_path_relative + end + + def git_path_relative + "organizations_categories/#{slug}/_index.html" + end + def to_s "#{name}" end diff --git a/app/models/university/person/category.rb b/app/models/university/person/category.rb index 685acaaa7..661cd7d52 100644 --- a/app/models/university/person/category.rb +++ b/app/models/university/person/category.rb @@ -29,6 +29,7 @@ class University::Person::Category < ApplicationRecord include Permalinkable include Sluggable include Translatable + include WithGitFiles include WithUniversity has_and_belongs_to_many :people, @@ -39,6 +40,14 @@ class University::Person::Category < ApplicationRecord scope :ordered, -> { order(:name) } + def git_path(website) + git_path_content_prefix(website) + git_path_relative + end + + def git_path_relative + "persons_categories/#{slug}/_index.html" + end + def to_s "#{name}" end -- GitLab