Skip to content
Snippets Groups Projects
Commit f7644f88 authored by Arnaud Levy's avatar Arnaud Levy
Browse files

doc

parent 4ef47366
No related branches found
No related tags found
No related merge requests found
Showing with 30 additions and 3 deletions
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment