From 77696198f65453058b138b480ef6d7a18ac73fa7 Mon Sep 17 00:00:00 2001 From: Arnaud Levy <contact@arnaudlevy.com> Date: Tue, 3 Jan 2023 15:41:27 +0100 Subject: [PATCH] singular --- .../{organizations.rb => administrator.rb} | 2 +- .../website/page/{persons.rb => author.rb} | 2 +- ...ication_posts.rb => communication_post.rb} | 2 +- .../website/page/education_diploma.rb | 44 +++++++++++++++++++ .../website/page/education_diplomas.rb | 44 ------------------- .../website/page/education_program.rb | 44 +++++++++++++++++++ .../website/page/education_programs.rb | 44 ------------------- app/models/communication/website/page/home.rb | 2 +- .../website/page/organization.rb | 44 +++++++++++++++++++ .../website/page/{teachers.rb => person.rb} | 2 +- .../website/page/research_paper.rb | 44 +++++++++++++++++++ .../website/page/research_papers.rb | 44 ------------------- .../{administrators.rb => research_volume.rb} | 2 +- .../website/page/research_volumes.rb | 44 ------------------- .../page/{researchers.rb => researcher.rb} | 2 +- .../website/page/{authors.rb => teacher.rb} | 2 +- .../communication/website/page/with_kind.rb | 29 ------------ .../communication/website/page/with_path.rb | 10 +++-- .../communication/website/page/with_type.rb | 23 +++++++++- .../websites/pages/_treebranch.html.erb | 2 +- .../websites/pages/show.html.erb | 2 +- config/locales/communication/en.yml | 24 +++++----- config/locales/communication/fr.yml | 24 +++++----- lib/tasks/app.rake | 5 ++- 24 files changed, 242 insertions(+), 245 deletions(-) rename app/models/communication/website/page/{organizations.rb => administrator.rb} (96%) rename app/models/communication/website/page/{persons.rb => author.rb} (95%) rename app/models/communication/website/page/{communication_posts.rb => communication_post.rb} (95%) create mode 100644 app/models/communication/website/page/education_diploma.rb delete mode 100644 app/models/communication/website/page/education_diplomas.rb create mode 100644 app/models/communication/website/page/education_program.rb delete mode 100644 app/models/communication/website/page/education_programs.rb create mode 100644 app/models/communication/website/page/organization.rb rename app/models/communication/website/page/{teachers.rb => person.rb} (95%) create mode 100644 app/models/communication/website/page/research_paper.rb delete mode 100644 app/models/communication/website/page/research_papers.rb rename app/models/communication/website/page/{administrators.rb => research_volume.rb} (96%) delete mode 100644 app/models/communication/website/page/research_volumes.rb rename app/models/communication/website/page/{researchers.rb => researcher.rb} (95%) rename app/models/communication/website/page/{authors.rb => teacher.rb} (96%) diff --git a/app/models/communication/website/page/organizations.rb b/app/models/communication/website/page/administrator.rb similarity index 96% rename from app/models/communication/website/page/organizations.rb rename to app/models/communication/website/page/administrator.rb index faf79eb67..5ea50a18f 100644 --- a/app/models/communication/website/page/organizations.rb +++ b/app/models/communication/website/page/administrator.rb @@ -39,6 +39,6 @@ # fk_rails_280107c62b (communication_website_id => communication_websites.id) # fk_rails_d208d15a73 (university_id => universities.id) # -class Communication::Website::Page::Organizations < Communication::Website::Page +class Communication::Website::Page::Administrator < Communication::Website::Page end diff --git a/app/models/communication/website/page/persons.rb b/app/models/communication/website/page/author.rb similarity index 95% rename from app/models/communication/website/page/persons.rb rename to app/models/communication/website/page/author.rb index bc6479fc3..b6871bad6 100644 --- a/app/models/communication/website/page/persons.rb +++ b/app/models/communication/website/page/author.rb @@ -39,6 +39,6 @@ # fk_rails_280107c62b (communication_website_id => communication_websites.id) # fk_rails_d208d15a73 (university_id => universities.id) # -class Communication::Website::Page::Persons < Communication::Website::Page +class Communication::Website::Page::Author < Communication::Website::Page end diff --git a/app/models/communication/website/page/communication_posts.rb b/app/models/communication/website/page/communication_post.rb similarity index 95% rename from app/models/communication/website/page/communication_posts.rb rename to app/models/communication/website/page/communication_post.rb index b3cc671eb..a6cc99a42 100644 --- a/app/models/communication/website/page/communication_posts.rb +++ b/app/models/communication/website/page/communication_post.rb @@ -39,7 +39,7 @@ # fk_rails_280107c62b (communication_website_id => communication_websites.id) # fk_rails_d208d15a73 (university_id => universities.id) # -class Communication::Website::Page::CommunicationPosts < Communication::Website::Page +class Communication::Website::Page::CommunicationPost < Communication::Website::Page def git_path(website) "#{git_path_content_prefix(website)}posts/_index.html" diff --git a/app/models/communication/website/page/education_diploma.rb b/app/models/communication/website/page/education_diploma.rb new file mode 100644 index 000000000..d63a207ae --- /dev/null +++ b/app/models/communication/website/page/education_diploma.rb @@ -0,0 +1,44 @@ +# == Schema Information +# +# Table name: communication_website_pages +# +# id :uuid not null, primary key +# bodyclass :string +# breadcrumb_title :string +# description :text +# description_short :text +# featured_image_alt :string +# featured_image_credit :text +# full_width :boolean default(FALSE) +# github_path :text +# header_text :text +# kind :integer +# position :integer default(0), not null +# published :boolean default(FALSE) +# slug :string +# text :text +# title :string +# type :string +# created_at :datetime not null +# updated_at :datetime not null +# communication_website_id :uuid not null, indexed +# language_id :uuid indexed +# parent_id :uuid indexed +# university_id :uuid not null, indexed +# +# Indexes +# +# index_communication_website_pages_on_communication_website_id (communication_website_id) +# index_communication_website_pages_on_language_id (language_id) +# index_communication_website_pages_on_parent_id (parent_id) +# index_communication_website_pages_on_university_id (university_id) +# +# Foreign Keys +# +# fk_rails_1a42003f06 (parent_id => communication_website_pages.id) +# fk_rails_280107c62b (communication_website_id => communication_websites.id) +# fk_rails_d208d15a73 (university_id => universities.id) +# +class Communication::Website::Page::EducationDiploma < Communication::Website::Page + +end diff --git a/app/models/communication/website/page/education_diplomas.rb b/app/models/communication/website/page/education_diplomas.rb deleted file mode 100644 index 52877ff07..000000000 --- a/app/models/communication/website/page/education_diplomas.rb +++ /dev/null @@ -1,44 +0,0 @@ -# == Schema Information -# -# Table name: communication_website_pages -# -# id :uuid not null, primary key -# bodyclass :string -# breadcrumb_title :string -# description :text -# description_short :text -# featured_image_alt :string -# featured_image_credit :text -# full_width :boolean default(FALSE) -# github_path :text -# header_text :text -# kind :integer -# position :integer default(0), not null -# published :boolean default(FALSE) -# slug :string -# text :text -# title :string -# type :string -# created_at :datetime not null -# updated_at :datetime not null -# communication_website_id :uuid not null, indexed -# language_id :uuid indexed -# parent_id :uuid indexed -# university_id :uuid not null, indexed -# -# Indexes -# -# index_communication_website_pages_on_communication_website_id (communication_website_id) -# index_communication_website_pages_on_language_id (language_id) -# index_communication_website_pages_on_parent_id (parent_id) -# index_communication_website_pages_on_university_id (university_id) -# -# Foreign Keys -# -# fk_rails_1a42003f06 (parent_id => communication_website_pages.id) -# fk_rails_280107c62b (communication_website_id => communication_websites.id) -# fk_rails_d208d15a73 (university_id => universities.id) -# -class Communication::Website::Page::EducationDiplomas < Communication::Website::Page - -end diff --git a/app/models/communication/website/page/education_program.rb b/app/models/communication/website/page/education_program.rb new file mode 100644 index 000000000..b84bda7a4 --- /dev/null +++ b/app/models/communication/website/page/education_program.rb @@ -0,0 +1,44 @@ +# == Schema Information +# +# Table name: communication_website_pages +# +# id :uuid not null, primary key +# bodyclass :string +# breadcrumb_title :string +# description :text +# description_short :text +# featured_image_alt :string +# featured_image_credit :text +# full_width :boolean default(FALSE) +# github_path :text +# header_text :text +# kind :integer +# position :integer default(0), not null +# published :boolean default(FALSE) +# slug :string +# text :text +# title :string +# type :string +# created_at :datetime not null +# updated_at :datetime not null +# communication_website_id :uuid not null, indexed +# language_id :uuid indexed +# parent_id :uuid indexed +# university_id :uuid not null, indexed +# +# Indexes +# +# index_communication_website_pages_on_communication_website_id (communication_website_id) +# index_communication_website_pages_on_language_id (language_id) +# index_communication_website_pages_on_parent_id (parent_id) +# index_communication_website_pages_on_university_id (university_id) +# +# Foreign Keys +# +# fk_rails_1a42003f06 (parent_id => communication_website_pages.id) +# fk_rails_280107c62b (communication_website_id => communication_websites.id) +# fk_rails_d208d15a73 (university_id => universities.id) +# +class Communication::Website::Page::EducationProgram < Communication::Website::Page + +end diff --git a/app/models/communication/website/page/education_programs.rb b/app/models/communication/website/page/education_programs.rb deleted file mode 100644 index c94991234..000000000 --- a/app/models/communication/website/page/education_programs.rb +++ /dev/null @@ -1,44 +0,0 @@ -# == Schema Information -# -# Table name: communication_website_pages -# -# id :uuid not null, primary key -# bodyclass :string -# breadcrumb_title :string -# description :text -# description_short :text -# featured_image_alt :string -# featured_image_credit :text -# full_width :boolean default(FALSE) -# github_path :text -# header_text :text -# kind :integer -# position :integer default(0), not null -# published :boolean default(FALSE) -# slug :string -# text :text -# title :string -# type :string -# created_at :datetime not null -# updated_at :datetime not null -# communication_website_id :uuid not null, indexed -# language_id :uuid indexed -# parent_id :uuid indexed -# university_id :uuid not null, indexed -# -# Indexes -# -# index_communication_website_pages_on_communication_website_id (communication_website_id) -# index_communication_website_pages_on_language_id (language_id) -# index_communication_website_pages_on_parent_id (parent_id) -# index_communication_website_pages_on_university_id (university_id) -# -# Foreign Keys -# -# fk_rails_1a42003f06 (parent_id => communication_website_pages.id) -# fk_rails_280107c62b (communication_website_id => communication_websites.id) -# fk_rails_d208d15a73 (university_id => universities.id) -# -class Communication::Website::Page::EducationPrograms < Communication::Website::Page - -end diff --git a/app/models/communication/website/page/home.rb b/app/models/communication/website/page/home.rb index b62ff158e..4a850e991 100644 --- a/app/models/communication/website/page/home.rb +++ b/app/models/communication/website/page/home.rb @@ -42,7 +42,7 @@ class Communication::Website::Page::Home < Communication::Website::Page def git_path(website) - "#{git_path_content_prefix(website)}_index.html" + "#{git_path_prefix}_index.html" end protected diff --git a/app/models/communication/website/page/organization.rb b/app/models/communication/website/page/organization.rb new file mode 100644 index 000000000..ff0017ce9 --- /dev/null +++ b/app/models/communication/website/page/organization.rb @@ -0,0 +1,44 @@ +# == Schema Information +# +# Table name: communication_website_pages +# +# id :uuid not null, primary key +# bodyclass :string +# breadcrumb_title :string +# description :text +# description_short :text +# featured_image_alt :string +# featured_image_credit :text +# full_width :boolean default(FALSE) +# github_path :text +# header_text :text +# kind :integer +# position :integer default(0), not null +# published :boolean default(FALSE) +# slug :string +# text :text +# title :string +# type :string +# created_at :datetime not null +# updated_at :datetime not null +# communication_website_id :uuid not null, indexed +# language_id :uuid indexed +# parent_id :uuid indexed +# university_id :uuid not null, indexed +# +# Indexes +# +# index_communication_website_pages_on_communication_website_id (communication_website_id) +# index_communication_website_pages_on_language_id (language_id) +# index_communication_website_pages_on_parent_id (parent_id) +# index_communication_website_pages_on_university_id (university_id) +# +# Foreign Keys +# +# fk_rails_1a42003f06 (parent_id => communication_website_pages.id) +# fk_rails_280107c62b (communication_website_id => communication_websites.id) +# fk_rails_d208d15a73 (university_id => universities.id) +# +class Communication::Website::Page::Organization < Communication::Website::Page + +end diff --git a/app/models/communication/website/page/teachers.rb b/app/models/communication/website/page/person.rb similarity index 95% rename from app/models/communication/website/page/teachers.rb rename to app/models/communication/website/page/person.rb index 06ec7215e..1a084c359 100644 --- a/app/models/communication/website/page/teachers.rb +++ b/app/models/communication/website/page/person.rb @@ -39,6 +39,6 @@ # fk_rails_280107c62b (communication_website_id => communication_websites.id) # fk_rails_d208d15a73 (university_id => universities.id) # -class Communication::Website::Page::Teachers < Communication::Website::Page +class Communication::Website::Page::Person < Communication::Website::Page end diff --git a/app/models/communication/website/page/research_paper.rb b/app/models/communication/website/page/research_paper.rb new file mode 100644 index 000000000..e03da13f5 --- /dev/null +++ b/app/models/communication/website/page/research_paper.rb @@ -0,0 +1,44 @@ +# == Schema Information +# +# Table name: communication_website_pages +# +# id :uuid not null, primary key +# bodyclass :string +# breadcrumb_title :string +# description :text +# description_short :text +# featured_image_alt :string +# featured_image_credit :text +# full_width :boolean default(FALSE) +# github_path :text +# header_text :text +# kind :integer +# position :integer default(0), not null +# published :boolean default(FALSE) +# slug :string +# text :text +# title :string +# type :string +# created_at :datetime not null +# updated_at :datetime not null +# communication_website_id :uuid not null, indexed +# language_id :uuid indexed +# parent_id :uuid indexed +# university_id :uuid not null, indexed +# +# Indexes +# +# index_communication_website_pages_on_communication_website_id (communication_website_id) +# index_communication_website_pages_on_language_id (language_id) +# index_communication_website_pages_on_parent_id (parent_id) +# index_communication_website_pages_on_university_id (university_id) +# +# Foreign Keys +# +# fk_rails_1a42003f06 (parent_id => communication_website_pages.id) +# fk_rails_280107c62b (communication_website_id => communication_websites.id) +# fk_rails_d208d15a73 (university_id => universities.id) +# +class Communication::Website::Page::ResearchPaper < Communication::Website::Page + +end diff --git a/app/models/communication/website/page/research_papers.rb b/app/models/communication/website/page/research_papers.rb deleted file mode 100644 index c2b9393d3..000000000 --- a/app/models/communication/website/page/research_papers.rb +++ /dev/null @@ -1,44 +0,0 @@ -# == Schema Information -# -# Table name: communication_website_pages -# -# id :uuid not null, primary key -# bodyclass :string -# breadcrumb_title :string -# description :text -# description_short :text -# featured_image_alt :string -# featured_image_credit :text -# full_width :boolean default(FALSE) -# github_path :text -# header_text :text -# kind :integer -# position :integer default(0), not null -# published :boolean default(FALSE) -# slug :string -# text :text -# title :string -# type :string -# created_at :datetime not null -# updated_at :datetime not null -# communication_website_id :uuid not null, indexed -# language_id :uuid indexed -# parent_id :uuid indexed -# university_id :uuid not null, indexed -# -# Indexes -# -# index_communication_website_pages_on_communication_website_id (communication_website_id) -# index_communication_website_pages_on_language_id (language_id) -# index_communication_website_pages_on_parent_id (parent_id) -# index_communication_website_pages_on_university_id (university_id) -# -# Foreign Keys -# -# fk_rails_1a42003f06 (parent_id => communication_website_pages.id) -# fk_rails_280107c62b (communication_website_id => communication_websites.id) -# fk_rails_d208d15a73 (university_id => universities.id) -# -class Communication::Website::Page::ResearchPapers < Communication::Website::Page - -end diff --git a/app/models/communication/website/page/administrators.rb b/app/models/communication/website/page/research_volume.rb similarity index 96% rename from app/models/communication/website/page/administrators.rb rename to app/models/communication/website/page/research_volume.rb index e52736db5..d758ea6ee 100644 --- a/app/models/communication/website/page/administrators.rb +++ b/app/models/communication/website/page/research_volume.rb @@ -39,6 +39,6 @@ # fk_rails_280107c62b (communication_website_id => communication_websites.id) # fk_rails_d208d15a73 (university_id => universities.id) # -class Communication::Website::Page::Administrators < Communication::Website::Page +class Communication::Website::Page::ResearchVolume < Communication::Website::Page end diff --git a/app/models/communication/website/page/research_volumes.rb b/app/models/communication/website/page/research_volumes.rb deleted file mode 100644 index 0dc34f594..000000000 --- a/app/models/communication/website/page/research_volumes.rb +++ /dev/null @@ -1,44 +0,0 @@ -# == Schema Information -# -# Table name: communication_website_pages -# -# id :uuid not null, primary key -# bodyclass :string -# breadcrumb_title :string -# description :text -# description_short :text -# featured_image_alt :string -# featured_image_credit :text -# full_width :boolean default(FALSE) -# github_path :text -# header_text :text -# kind :integer -# position :integer default(0), not null -# published :boolean default(FALSE) -# slug :string -# text :text -# title :string -# type :string -# created_at :datetime not null -# updated_at :datetime not null -# communication_website_id :uuid not null, indexed -# language_id :uuid indexed -# parent_id :uuid indexed -# university_id :uuid not null, indexed -# -# Indexes -# -# index_communication_website_pages_on_communication_website_id (communication_website_id) -# index_communication_website_pages_on_language_id (language_id) -# index_communication_website_pages_on_parent_id (parent_id) -# index_communication_website_pages_on_university_id (university_id) -# -# Foreign Keys -# -# fk_rails_1a42003f06 (parent_id => communication_website_pages.id) -# fk_rails_280107c62b (communication_website_id => communication_websites.id) -# fk_rails_d208d15a73 (university_id => universities.id) -# -class Communication::Website::Page::ResearchVolumes < Communication::Website::Page - -end diff --git a/app/models/communication/website/page/researchers.rb b/app/models/communication/website/page/researcher.rb similarity index 95% rename from app/models/communication/website/page/researchers.rb rename to app/models/communication/website/page/researcher.rb index 38d9cb850..2133aaa4d 100644 --- a/app/models/communication/website/page/researchers.rb +++ b/app/models/communication/website/page/researcher.rb @@ -39,6 +39,6 @@ # fk_rails_280107c62b (communication_website_id => communication_websites.id) # fk_rails_d208d15a73 (university_id => universities.id) # -class Communication::Website::Page::Researchers < Communication::Website::Page +class Communication::Website::Page::Researcher < Communication::Website::Page end diff --git a/app/models/communication/website/page/authors.rb b/app/models/communication/website/page/teacher.rb similarity index 96% rename from app/models/communication/website/page/authors.rb rename to app/models/communication/website/page/teacher.rb index 24c5e7aee..148eaa1b0 100644 --- a/app/models/communication/website/page/authors.rb +++ b/app/models/communication/website/page/teacher.rb @@ -39,6 +39,6 @@ # fk_rails_280107c62b (communication_website_id => communication_websites.id) # fk_rails_d208d15a73 (university_id => universities.id) # -class Communication::Website::Page::Authors < Communication::Website::Page +class Communication::Website::Page::Teacher < Communication::Website::Page end diff --git a/app/models/communication/website/page/with_kind.rb b/app/models/communication/website/page/with_kind.rb index bfb4c49e0..36d449b37 100644 --- a/app/models/communication/website/page/with_kind.rb +++ b/app/models/communication/website/page/with_kind.rb @@ -37,27 +37,6 @@ module Communication::Website::Page::WithKind 'teachers' ].freeze - # deprecated, remove - after_create :move_legacy_root_pages, if: :kind_home? - - def as_special_page - @as_special_page ||= begin - # A normal page is always a normal page - return self if is_regular_page? - # A special page is the same in the database, but has some additional and specific methods - special_page_class = "Communication::Website::Page::#{kind.to_s.classify}".constantize - special_page_class.find id - end - end - - def is_special_page? - kind != nil - end - - def is_regular_page? - kind == nil - end - # -> dans les nouvelles classes def has_special_git_path? is_special_page? && SPECIAL_PAGES_WITH_GIT_SPECIAL_PATH.include?(kind) @@ -88,12 +67,4 @@ module Communication::Website::Page::WithKind end - private - - # deprecated, remove - def move_legacy_root_pages - root_pages = website.pages.where.not(id: id).root - root_pages.update_all(parent_id: id) - end - end diff --git a/app/models/communication/website/page/with_path.rb b/app/models/communication/website/page/with_path.rb index ae2f1356c..15692369e 100644 --- a/app/models/communication/website/page/with_path.rb +++ b/app/models/communication/website/page/with_path.rb @@ -31,6 +31,7 @@ module Communication::Website::Page::WithPath end def git_path(website) + # Same website and page published return unless website.id == communication_website_id && published path = git_path_content_prefix(website) @@ -39,10 +40,9 @@ module Communication::Website::Page::WithPath elsif has_special_git_path? path += "#{kind.split('_').last}/_index.html" else - path += "pages/#{slug_with_ancestors}/_index.html" end - - path + + "#{git_path_prefix}pages/#{slug_with_ancestors}/_index.html" end def url @@ -53,6 +53,10 @@ module Communication::Website::Page::WithPath protected + def git_path_prefix + git_path_content_prefix(website) + end + def set_slug self.slug = to_s.parameterize if self.slug.blank? current_slug = self.slug diff --git a/app/models/communication/website/page/with_type.rb b/app/models/communication/website/page/with_type.rb index e3a30a650..3ea32edae 100644 --- a/app/models/communication/website/page/with_type.rb +++ b/app/models/communication/website/page/with_type.rb @@ -1,7 +1,21 @@ module Communication::Website::Page::WithType extend ActiveSupport::Concern - def is_necessary? + # Communication::Website::Page::CommunicationPosts -> communication_posts + # Used for i18n + def type_key + type.demodulize.underscore + end + + def is_special_page? + type.present? + end + + def is_regular_page? + type.blank? + end + + def is_necessary_for_website? true end @@ -13,7 +27,12 @@ module Communication::Website::Page::WithType true end - def unpublishable? + # Can it be unpublished? + def draftable? + true + end + + def deletable? true end end \ No newline at end of file diff --git a/app/views/admin/communication/websites/pages/_treebranch.html.erb b/app/views/admin/communication/websites/pages/_treebranch.html.erb index 8244cfbae..8f92b6e49 100644 --- a/app/views/admin/communication/websites/pages/_treebranch.html.erb +++ b/app/views/admin/communication/websites/pages/_treebranch.html.erb @@ -25,7 +25,7 @@ <% end %> <div class="ms-auto align-items-center" role="group"> <% if page.is_special_page? %> - <span class="me-3 show-on-hover"><%= t("communication.website.pages.defaults.#{page.kind}.admin_description") %></span> + <span class="me-3 show-on-hover"><%= t("communication.website.pages.defaults.#{page.type_key}.admin_description") %></span> <% end %> <div class="btn-group"> <%= duplicate_link page if page.is_regular_page? %> diff --git a/app/views/admin/communication/websites/pages/show.html.erb b/app/views/admin/communication/websites/pages/show.html.erb index c8d6a6191..e84d716eb 100644 --- a/app/views/admin/communication/websites/pages/show.html.erb +++ b/app/views/admin/communication/websites/pages/show.html.erb @@ -12,7 +12,7 @@ <div class="card"> <div class="card-body"> <%= t('admin.communication.website.pages.is_special_page') %> - <b><%= t("communication.website.pages.defaults.#{@page.kind}.admin_description") %></b> + <b><%= t("communication.website.pages.defaults.#{@page.type_key}.admin_description") %></b> </div> </div> <% end %> diff --git a/config/locales/communication/en.yml b/config/locales/communication/en.yml index c62fc53e7..e21f65a80 100644 --- a/config/locales/communication/en.yml +++ b/config/locales/communication/en.yml @@ -572,27 +572,27 @@ en: description_short: '' slug: accessibility title: Accessibility - administrators: + administrator: admin_description: list of members in the administrative team description_short: List of members in the administrative team slug: administrative-team title: Administrative team - authors: + author: admin_description: list of members in the editorial team description_short: List of members in the editorial team slug: editorial-team title: Editorial team - communication_posts: + communication_post: admin_description: list of posts description_short: List of posts slug: posts title: Posts - education_diplomas: + education_diploma: admin_description: list of available diplomas description_short: List of available diplomas slug: diplomas title: Diplomas - education_programs: + education_program: admin_description: list of available programs description_short: List of available programs slug: programs @@ -602,17 +602,17 @@ en: description_short: '' slug: '' title: Home - legal_terms: + legal_term: admin_description: legal terms page description_short: '' slug: legal-terms title: Legal terms - organizations: + organization: admin_description: organizations page description_short: List of organizations slug: organizations title: Organizations - persons: + person: admin_description: list of members in the team description_short: List of members in the team slug: team @@ -622,17 +622,17 @@ en: description_short: '' slug: privacy-policy title: Privacy policy - research_papers: + research_paper: admin_description: list of papers description_short: List of papers slug: papers title: Papers - research_volumes: + research_volume: admin_description: list of volumes description_short: List of volumes slug: volumes title: Volumes - researchers: + researcher: admin_description: list of members in the research team description_short: List of members in the research team slug: research-team @@ -642,7 +642,7 @@ en: description_short: '' slug: sitemap title: Sitemap - teachers: + teacher: admin_description: list of members in the educational team description_short: List of members in the educational team slug: educational-team diff --git a/config/locales/communication/fr.yml b/config/locales/communication/fr.yml index c03f082c1..f899c21d6 100644 --- a/config/locales/communication/fr.yml +++ b/config/locales/communication/fr.yml @@ -574,27 +574,27 @@ fr: description_short: '' slug: accessibilite title: Accessibilité - administrators: + administrator: admin_description: liste des membres de l'équipe administrative description_short: Liste des membres de l'équipe administrative slug: equipe-administrative title: Équipe administrative - authors: + author: admin_description: liste des membres de l'équipe éditoriale description_short: Liste des membres de l'équipe éditoriale slug: equipe-editoriale title: Équipe éditoriale - communication_posts: + communication_post: admin_description: liste des actualités description_short: Liste des actualités slug: actualites title: Actualités - education_diplomas: + education_diploma: admin_description: liste des diplômes proposés description_short: Liste des diplômes proposés slug: diplomes title: "Diplômes" - education_programs: + education_program: admin_description: liste des formations proposées description_short: Liste des formations proposées slug: offre-de-formation @@ -604,17 +604,17 @@ fr: description_short: '' slug: '' title: Accueil - legal_terms: + legal_term: admin_description: page des mentions légales description_short: '' slug: mentions-legales title: Mentions légales - organizations: + organization: admin_description: page des organisations description_short: Liste des organisations slug: organisations title: Organisations - persons: + person: admin_description: liste des membres de l'équipe description_short: Liste des membres de l'équipe slug: equipe @@ -624,17 +624,17 @@ fr: description_short: '' slug: politique-de-confidentialite title: Politique de confidentialité - research_papers: + research_paper: admin_description: liste des papiers description_short: Liste des papiers slug: papiers title: Papiers - research_volumes: + research_volume: admin_description: liste des volumes description_short: Liste des volumes slug: volumes title: Volumes - researchers: + researcher: admin_description: liste des membres de l'équipe de recherche description_short: Liste des membres de l'équipe de recherche slug: equipe-de-recherche @@ -644,7 +644,7 @@ fr: description_short: '' slug: plan-du-site title: Plan du site - teachers: + teacher: admin_description: liste des membres de l'équipe pédagogique description_short: Liste des membres de l'équipe pédagogique slug: equipe-pedagogique diff --git a/lib/tasks/app.rake b/lib/tasks/app.rake index fdb5a6a68..6324ffc3b 100644 --- a/lib/tasks/app.rake +++ b/lib/tasks/app.rake @@ -9,7 +9,10 @@ namespace :app do desc 'Fix things' task fix: :environment do Communication::Website::Page.find_each do |page| - page.update_column :type, "::Communication::Website::Page::#{page.kind.to_s.classify}" + if page.kind + type = "::Communication::Website::Page::#{page.kind.to_s.classify}" + page.update_column :type, type + end end end -- GitLab