diff --git a/app/models/communication/website/permalink/administrator.rb b/app/models/communication/website/permalink/administrator.rb index f6b6627f9363d81c31ae14eea554308c64a238d6..bdbae5e4ed84ae222a3023f52a464f022fba9308 100644 --- a/app/models/communication/website/permalink/administrator.rb +++ b/app/models/communication/website/permalink/administrator.rb @@ -7,6 +7,7 @@ class Communication::Website::Permalink::Administrator < Communication::Website: :administrators end + # /equipe/:slug/roles/ def self.pattern_in_website(website) "#{website.special_page(:persons).path_without_language}:slug/roles/" end diff --git a/app/models/communication/website/permalink/author.rb b/app/models/communication/website/permalink/author.rb index 2d1e7328cb6304d74a7027137b9f47e907ce0854..b354ff140b13d2b5d9d0f3cac12ba8eb43263ecb 100644 --- a/app/models/communication/website/permalink/author.rb +++ b/app/models/communication/website/permalink/author.rb @@ -8,6 +8,7 @@ class Communication::Website::Permalink::Author < Communication::Website::Permal :authors end + # /equipe/:slug/actualites/ def self.pattern_in_website(website) "#{website.special_page(:persons).path_without_language}:slug/#{website.special_page(:communication_posts).slug}/" end diff --git a/app/models/communication/website/permalink/category.rb b/app/models/communication/website/permalink/category.rb index 8e63df80b05edc0edcacde35a3408914e08df1a1..3eb525c563c7283da3d63944ea92ad0a23d14ea1 100644 --- a/app/models/communication/website/permalink/category.rb +++ b/app/models/communication/website/permalink/category.rb @@ -7,6 +7,7 @@ class Communication::Website::Permalink::Category < Communication::Website::Perm :categories end + # /actualites/:slug/ def self.pattern_in_website(website) "#{website.special_page(:communication_posts).path_without_language}:slug/" end diff --git a/app/models/communication/website/permalink/diploma.rb b/app/models/communication/website/permalink/diploma.rb index c7fa23611af4ea771592bf9fdce99f06b7bc291b..44a5226fb5f694f8ec3fea429b90bd817903665d 100644 --- a/app/models/communication/website/permalink/diploma.rb +++ b/app/models/communication/website/permalink/diploma.rb @@ -7,6 +7,7 @@ class Communication::Website::Permalink::Diploma < Communication::Website::Perma :diplomas end + # /diplomes/:slug/ def self.pattern_in_website(website) "#{website.special_page(:education_diplomas).path_without_language}:slug/" end diff --git a/app/models/communication/website/permalink/organization.rb b/app/models/communication/website/permalink/organization.rb index 8d1f62eb7c7af32b01e69c49b1ae1f807b516a43..f0775c7ada2f7949325046cdbd3a53541ebba779 100644 --- a/app/models/communication/website/permalink/organization.rb +++ b/app/models/communication/website/permalink/organization.rb @@ -7,6 +7,7 @@ class Communication::Website::Permalink::Organization < Communication::Website:: :organizations end + # /organisations/:slug/ def self.pattern_in_website(website) "#{website.special_page(:organizations).path_without_language}:slug/" end diff --git a/app/models/communication/website/permalink/page.rb b/app/models/communication/website/permalink/page.rb index d89b685954e0241d3a1ea96716929bac23962b2c..d65145fb0153acf9a2d29e53ef5758503b4a7c42 100644 --- a/app/models/communication/website/permalink/page.rb +++ b/app/models/communication/website/permalink/page.rb @@ -6,7 +6,8 @@ class Communication::Website::Permalink::Page < Communication::Website::Permalin website.id == about.communication_website_id && about.published end - # Pages are special, there is no substitution + # /notre-institut/histoire/ + # Pages are special, there is no substitution and no pattern def published_path about.path end diff --git a/app/models/communication/website/permalink/person.rb b/app/models/communication/website/permalink/person.rb index 9728a2f8db3b695dfa425b1064c9f59bff00820f..d84621fbe92ea83f520cf605d57b35d801b7762c 100644 --- a/app/models/communication/website/permalink/person.rb +++ b/app/models/communication/website/permalink/person.rb @@ -7,6 +7,7 @@ class Communication::Website::Permalink::Person < Communication::Website::Permal :persons end + # /equipe/:slug/ def self.pattern_in_website(website) "#{website.special_page(:persons).path_without_language}:slug/" end diff --git a/app/models/communication/website/permalink/researcher.rb b/app/models/communication/website/permalink/researcher.rb index c255ae63b8ac17b7c86e744958c04f8337a40f72..abec7308fa7df4ad5a934e8733e02248863dd97a 100644 --- a/app/models/communication/website/permalink/researcher.rb +++ b/app/models/communication/website/permalink/researcher.rb @@ -7,6 +7,8 @@ class Communication::Website::Permalink::Researcher < Communication::Website::Pe :researchers end + # /equipe/:slug/papers/ + # FIXME def self.pattern_in_website(website) "#{website.special_page(:persons).path_without_language}:slug/papers/" end diff --git a/app/models/communication/website/permalink/teacher.rb b/app/models/communication/website/permalink/teacher.rb index 3b00b322ff388f7c902f9948aa8ac816e0bf1e94..d8dc2c439aea195ad153b9ab21c493ff8decc060 100644 --- a/app/models/communication/website/permalink/teacher.rb +++ b/app/models/communication/website/permalink/teacher.rb @@ -7,6 +7,8 @@ class Communication::Website::Permalink::Teacher < Communication::Website::Perma :teachers end + # /equipe/:slug/programs/ + # FIXME def self.pattern_in_website(website) "#{website.special_page(:persons).path_without_language}:slug/programs/" end diff --git a/app/models/communication/website/with_special_pages.rb b/app/models/communication/website/with_special_pages.rb index 3da2f83c06e21a0847814176a79f52f5524785d6..b4e6ec4c993e91ce56b2f18b1911f00d8c3f9c46 100644 --- a/app/models/communication/website/with_special_pages.rb +++ b/app/models/communication/website/with_special_pages.rb @@ -13,13 +13,29 @@ module Communication::Website::WithSpecialPages def create_missing_special_pages homepage = create_special_page('home') # first level pages with test - ['legal_terms', 'sitemap', 'privacy_policy', 'accessibility', 'communication_posts', 'education_programs', 'education_diplomas', 'research_papers', 'research_volumes', 'organizations'].each do |kind| + [ + 'legal_terms', + 'sitemap', + 'privacy_policy', + 'accessibility', + 'communication_posts', + 'education_programs', + 'education_diplomas', + 'research_papers', + 'research_volumes', + 'organizations' + ].each do |kind| create_special_page(kind, homepage.id) if public_send("has_#{kind}?") end # team pages if has_persons? persons = create_special_page('persons', homepage.id) - ['administrators', 'authors', 'researchers', 'teachers'].each do |kind| + [ + 'administrators', + 'authors', + 'researchers', + 'teachers' + ].each do |kind| create_special_page(kind, persons.id) if public_send("has_#{kind}?") end end