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

clean

parent 54fc7100
No related branches found
No related tags found
No related merge requests found
Showing with 10 additions and 75 deletions
......@@ -91,13 +91,15 @@ class Communication::Website::Permalink < ApplicationRecord
p
end
# Can be overwritten
def published?
# Can be overwritten
true
about.for_website?(website)
end
def substitutions
raise NotImplementedError
{
slug: about.slug
}
end
def set_university
......
......@@ -10,14 +10,4 @@ class Communication::Website::Permalink::Administrator < Communication::Website:
def self.pattern_in_website(website)
"#{website.special_page(:persons).path_without_language}:slug/roles/"
end
protected
def published?
about.for_website?(website)
end
def published_path
pattern.gsub(":slug", about.slug)
end
end
......@@ -11,14 +11,4 @@ class Communication::Website::Permalink::Author < Communication::Website::Permal
def self.pattern_in_website(website)
"#{website.special_page(:persons).path_without_language}:slug/#{website.special_page(:communication_posts).slug}/"
end
protected
def published?
about.for_website?(website)
end
def published_path
pattern.gsub(":slug", about.slug)
end
end
......@@ -13,7 +13,9 @@ class Communication::Website::Permalink::Category < Communication::Website::Perm
protected
def published_path
pattern.gsub(":slug", about.path)
def substitutions
{
slug: about.path
}
end
end
......@@ -10,14 +10,4 @@ class Communication::Website::Permalink::Diploma < Communication::Website::Perma
def self.pattern_in_website(website)
"#{website.special_page(:education_diplomas).path_without_language}:slug/"
end
protected
def published?
about.for_website?(website)
end
def published_path
pattern.gsub(":slug", about.slug)
end
end
......@@ -10,14 +10,4 @@ class Communication::Website::Permalink::Organization < Communication::Website::
def self.pattern_in_website(website)
"#{website.special_page(:organizations).path_without_language}:slug/"
end
protected
def published?
about.for_website?(website)
end
def published_path
pattern.gsub(":slug", about.slug)
end
end
......@@ -9,6 +9,7 @@ class Communication::Website::Permalink::Page < Communication::Website::Permalin
website.id == about.communication_website_id && about.published
end
# Pages are special, there is no substitution
def published_path
about.path
end
......
......@@ -10,14 +10,4 @@ class Communication::Website::Permalink::Person < Communication::Website::Permal
def self.pattern_in_website(website)
"#{website.special_page(:persons).path_without_language}:slug/"
end
protected
def published?
about.for_website?(website)
end
def published_path
pattern.gsub(":slug", about.slug)
end
end
......@@ -10,14 +10,4 @@ class Communication::Website::Permalink::Researcher < Communication::Website::Pe
def self.pattern_in_website(website)
"#{website.special_page(:persons).path_without_language}:slug/papers/"
end
protected
def published?
about.for_website?(website)
end
def published_path
pattern.gsub(":slug", about.slug)
end
end
......@@ -10,14 +10,4 @@ class Communication::Website::Permalink::Teacher < Communication::Website::Perma
def self.pattern_in_website(website)
"#{website.special_page(:persons).path_without_language}:slug/programs/"
end
protected
def published?
about.for_website?(website)
end
def published_path
pattern.gsub(":slug", about.slug)
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