From c8c1fab3f9cc31d9154e5c209b07ca488a4f93a3 Mon Sep 17 00:00:00 2001 From: pabois <pierreandre.boissinot@noesya.coop> Date: Mon, 9 Jan 2023 16:53:40 +0100 Subject: [PATCH] change --- .../websites/categories_controller.rb | 2 +- .../websites/pages_controller.rb | 2 +- .../websites/posts_controller.rb | 2 +- .../admin/education/programs_controller.rb | 2 +- .../research/journals/papers_controller.rb | 2 +- .../research/journals/volumes_controller.rb | 2 +- .../admin/research/journals_controller.rb | 2 +- .../research/laboratories/axes_controller.rb | 2 +- .../university/organizations_controller.rb | 2 +- .../admin/university/people_controller.rb | 2 +- app/models/communication/website/category.rb | 2 +- .../website/imported/category.rb | 2 +- .../communication/website/imported/page.rb | 2 +- .../communication/website/imported/post.rb | 2 +- app/models/communication/website/page.rb | 2 +- .../website/page/accessibility.rb | 2 +- .../website/page/administrator.rb | 2 +- .../communication/website/page/author.rb | 2 +- .../website/page/communication_post.rb | 2 +- .../website/page/education_diploma.rb | 2 +- .../website/page/education_program.rb | 2 +- app/models/communication/website/page/home.rb | 2 +- .../communication/website/page/legal_term.rb | 2 +- .../website/page/organization.rb | 2 +- .../communication/website/page/person.rb | 2 +- .../website/page/privacy_policy.rb | 2 +- .../website/page/research_paper.rb | 2 +- .../website/page/research_volume.rb | 2 +- .../communication/website/page/researcher.rb | 2 +- .../communication/website/page/sitemap.rb | 2 +- .../communication/website/page/teacher.rb | 2 +- app/models/communication/website/post.rb | 4 +- app/models/education/program.rb | 2 +- app/models/research/journal.rb | 20 ++++----- app/models/research/journal/paper.rb | 2 +- app/models/research/journal/volume.rb | 2 +- app/models/research/laboratory/axis.rb | 2 +- app/models/university/organization.rb | 44 +++++++++---------- app/models/university/person.rb | 4 +- app/models/university/person/administrator.rb | 2 +- app/models/university/person/alumnus.rb | 2 +- app/models/university/person/author.rb | 2 +- app/models/university/person/researcher.rb | 2 +- app/models/university/person/teacher.rb | 2 +- app/services/importers/organizations.rb | 4 +- .../meta_description/_form.html.erb | 13 ++++++ .../meta_description/_show.html.erb | 13 ++++++ .../meta_description/_static.html.erb | 5 +++ .../websites/categories/_form.html.erb | 9 +--- .../websites/categories/show.html.erb | 23 +--------- .../websites/categories/static.html.erb | 3 +- .../websites/pages/_form.html.erb | 9 +--- .../websites/pages/show.html.erb | 6 +-- .../websites/pages/static.html.erb | 3 +- .../websites/posts/_form.html.erb | 9 +--- .../websites/posts/show.html.erb | 5 +-- .../websites/posts/static.html.erb | 3 +- .../admin/education/programs/_form.html.erb | 9 +--- .../admin/education/programs/show.html.erb | 12 +---- .../admin/education/programs/static.html.erb | 3 +- .../admin/research/journals/_form.html.erb | 3 ++ .../research/journals/papers/_form.html.erb | 9 +--- .../research/journals/papers/show.html.erb | 15 +------ .../research/journals/papers/static.html.erb | 3 +- .../admin/research/journals/show.html.erb | 2 + .../admin/research/journals/static.html.erb | 3 +- .../research/journals/volumes/_form.html.erb | 23 +--------- .../research/journals/volumes/show.html.erb | 12 +---- .../research/journals/volumes/static.html.erb | 3 +- .../research/laboratories/axes/_form.html.erb | 9 +--- .../research/laboratories/axes/show.html.erb | 12 +---- .../university/organizations/_form.html.erb | 9 +--- .../organizations/imports/new.html.erb | 2 +- .../university/organizations/show.html.erb | 12 +---- .../university/organizations/static.html.erb | 5 +-- .../admin/university/people/_form.html.erb | 9 +--- .../university/people/_main_infos.html.erb | 12 +---- .../people/administrators/static.html.erb | 4 +- .../university/people/authors/static.html.erb | 4 +- .../people/researchers/static.html.erb | 4 +- .../admin/university/people/static.html.erb | 3 +- .../people/teachers/static.html.erb | 4 +- config/locales/communication/en.yml | 8 ---- config/locales/communication/fr.yml | 7 --- config/locales/education/en.yml | 16 +++---- config/locales/education/fr.yml | 16 +++---- config/locales/en.yml | 3 ++ config/locales/fr.yml | 3 ++ config/locales/research/en.yml | 8 ---- config/locales/research/fr.yml | 8 ---- config/locales/university/en.yml | 2 - config/locales/university/fr.yml | 2 - ..._rename_description_to_meta_description.rb | 14 ++++++ db/schema.rb | 22 +++++----- test/fixtures/communication/website/posts.yml | 2 +- test/fixtures/university/organizations.yml | 42 +++++++++--------- test/models/university/organization_test.rb | 42 +++++++++--------- 97 files changed, 240 insertions(+), 398 deletions(-) create mode 100644 app/views/admin/application/meta_description/_form.html.erb create mode 100644 app/views/admin/application/meta_description/_show.html.erb create mode 100644 app/views/admin/application/meta_description/_static.html.erb create mode 100644 db/migrate/20230109143628_rename_description_to_meta_description.rb diff --git a/app/controllers/admin/communication/websites/categories_controller.rb b/app/controllers/admin/communication/websites/categories_controller.rb index e2c6aefe9..6f0b27b6e 100644 --- a/app/controllers/admin/communication/websites/categories_controller.rb +++ b/app/controllers/admin/communication/websites/categories_controller.rb @@ -97,7 +97,7 @@ class Admin::Communication::Websites::CategoriesController < Admin::Communicatio def category_params params.require(:communication_website_category) .permit( - :website_id, :name, :description, :summary, :slug, :parent_id, + :website_id, :name, :meta_description, :summary, :slug, :parent_id, :featured_image, :featured_image_delete, :featured_image_infos, :featured_image_alt, :featured_image_credit ) .merge(university_id: current_university.id) diff --git a/app/controllers/admin/communication/websites/pages_controller.rb b/app/controllers/admin/communication/websites/pages_controller.rb index d05b57beb..2c1ce8f3c 100644 --- a/app/controllers/admin/communication/websites/pages_controller.rb +++ b/app/controllers/admin/communication/websites/pages_controller.rb @@ -102,7 +102,7 @@ class Admin::Communication::Websites::PagesController < Admin::Communication::We params.require(:communication_website_page) .permit( :communication_website_id, :title, :breadcrumb_title, :bodyclass, - :description, :summary, :header_text, :text, :slug, :published, :full_width, + :meta_description, :summary, :header_text, :text, :slug, :published, :full_width, :featured_image, :featured_image_delete, :featured_image_infos, :featured_image_alt, :featured_image_credit, :parent_id, :language_id ) diff --git a/app/controllers/admin/communication/websites/posts_controller.rb b/app/controllers/admin/communication/websites/posts_controller.rb index 24e2ee377..a08c1e0c1 100644 --- a/app/controllers/admin/communication/websites/posts_controller.rb +++ b/app/controllers/admin/communication/websites/posts_controller.rb @@ -95,7 +95,7 @@ class Admin::Communication::Websites::PostsController < Admin::Communication::We def post_params params.require(:communication_website_post) .permit( - :university_id, :website_id, :title, :description, :summary, :text, + :university_id, :website_id, :title, :meta_description, :summary, :text, :published, :published_at, :slug, :pinned, :featured_image, :featured_image_delete, :featured_image_infos, :featured_image_alt, :featured_image_credit, :author_id, :language_id, category_ids: [] diff --git a/app/controllers/admin/education/programs_controller.rb b/app/controllers/admin/education/programs_controller.rb index f754feff8..4bc22f329 100644 --- a/app/controllers/admin/education/programs_controller.rb +++ b/app/controllers/admin/education/programs_controller.rb @@ -110,7 +110,7 @@ class Admin::Education::ProgramsController < Admin::Education::ApplicationContro def program_params params.require(:education_program).permit( - :name, :short_name, :slug, :capacity, :continuing, :initial, :apprenticeship, :description, :summary, :published, + :name, :short_name, :slug, :capacity, :continuing, :initial, :apprenticeship, :meta_description, :summary, :published, :featured_image, :featured_image_delete, :featured_image_infos, :featured_image_alt, :featured_image_credit, :prerequisites, :objectives, :presentation, :registration, :pedagogy, :content, :registration_url, :evaluation, :accessibility, :pricing, :contacts, :opportunities, :results, :other, :main_information, diff --git a/app/controllers/admin/research/journals/papers_controller.rb b/app/controllers/admin/research/journals/papers_controller.rb index 91d6ae4a1..fc8dc28e9 100644 --- a/app/controllers/admin/research/journals/papers_controller.rb +++ b/app/controllers/admin/research/journals/papers_controller.rb @@ -60,7 +60,7 @@ class Admin::Research::Journals::PapersController < Admin::Research::Journals::A def paper_params params.require(:research_journal_paper) - .permit(:title, :slug, :text, :published, :published_at, :summary, :abstract, :description, :pdf, :references, :keywords, :research_journal_volume_id, person_ids: []) + .permit(:title, :slug, :text, :published, :published_at, :summary, :abstract, :meta_description, :pdf, :references, :keywords, :research_journal_volume_id, person_ids: []) .merge(university_id: current_university.id) end end diff --git a/app/controllers/admin/research/journals/volumes_controller.rb b/app/controllers/admin/research/journals/volumes_controller.rb index 069b4d1e1..5d693ca97 100644 --- a/app/controllers/admin/research/journals/volumes_controller.rb +++ b/app/controllers/admin/research/journals/volumes_controller.rb @@ -58,7 +58,7 @@ class Admin::Research::Journals::VolumesController < Admin::Research::Journals:: def volume_params params.require(:research_journal_volume) .permit( - :title, :slug, :number, :keywords, :published, :published_at, :description, :text, + :title, :slug, :number, :keywords, :published, :published_at, :meta_description, :text, :featured_image, :featured_image_infos, :featured_image_delete, :featured_image_alt, :featured_image_credit ) .merge(university_id: current_university.id) diff --git a/app/controllers/admin/research/journals_controller.rb b/app/controllers/admin/research/journals_controller.rb index 070827385..b05662b96 100644 --- a/app/controllers/admin/research/journals_controller.rb +++ b/app/controllers/admin/research/journals_controller.rb @@ -53,7 +53,7 @@ class Admin::Research::JournalsController < Admin::Research::ApplicationControll def journal_params params.require(:research_journal) - .permit(:title, :description, :issn, :access_token, :repository) + .permit(:title, :meta_description, :issn, :access_token, :repository) .merge(university_id: current_university.id) end end diff --git a/app/controllers/admin/research/laboratories/axes_controller.rb b/app/controllers/admin/research/laboratories/axes_controller.rb index 5c672627a..4a75a6cca 100644 --- a/app/controllers/admin/research/laboratories/axes_controller.rb +++ b/app/controllers/admin/research/laboratories/axes_controller.rb @@ -55,7 +55,7 @@ class Admin::Research::Laboratories::AxesController < Admin::Research::Laborator def axis_params params.require(:research_laboratory_axis) - .permit(:name, :short_name, :description, :text) + .permit(:name, :short_name, :meta_description, :text) .merge(university_id: current_university.id) end end diff --git a/app/controllers/admin/university/organizations_controller.rb b/app/controllers/admin/university/organizations_controller.rb index 751395e80..ef5d4576a 100644 --- a/app/controllers/admin/university/organizations_controller.rb +++ b/app/controllers/admin/university/organizations_controller.rb @@ -69,7 +69,7 @@ class Admin::University::OrganizationsController < Admin::University::Applicatio def organization_params params.require(:university_organization) .permit( - :name, :long_name, :slug, :description, :summary, :active, :siren, :kind, + :name, :long_name, :slug, :meta_description, :summary, :active, :siren, :kind, :address, :zipcode, :city, :country, :text, :url, :phone, :email, :logo, :logo_delete, :logo_infos, diff --git a/app/controllers/admin/university/people_controller.rb b/app/controllers/admin/university/people_controller.rb index f6449552b..68c9d699b 100644 --- a/app/controllers/admin/university/people_controller.rb +++ b/app/controllers/admin/university/people_controller.rb @@ -74,7 +74,7 @@ class Admin::University::PeopleController < Admin::University::ApplicationContro :slug, :first_name, :last_name, :email, :gender, :birthdate, :phone_mobile, :phone_professional, :phone_personal, :address, :zipcode, :city, :country, - :description, :summary, + :meta_description, :summary, :biography, :picture, :picture_delete, :picture_infos, :habilitation, :tenure, :url, :linkedin, :twitter, :is_researcher, :is_teacher, :is_administration, :is_alumnus, diff --git a/app/models/communication/website/category.rb b/app/models/communication/website/category.rb index d6d6174e7..a22fb6efc 100644 --- a/app/models/communication/website/category.rb +++ b/app/models/communication/website/category.rb @@ -3,11 +3,11 @@ # Table name: communication_website_categories # # id :uuid not null, primary key -# description :text # featured_image_alt :string # featured_image_credit :text # github_path :text # is_programs_root :boolean default(FALSE) +# meta_description :text # name :string # path :string # position :integer diff --git a/app/models/communication/website/imported/category.rb b/app/models/communication/website/imported/category.rb index b3f5841f8..6549a0835 100644 --- a/app/models/communication/website/imported/category.rb +++ b/app/models/communication/website/imported/category.rb @@ -68,7 +68,7 @@ class Communication::Website::Imported::Category < ApplicationRecord sanitized_name = Wordpress.clean_string self.name.to_s category.name = sanitized_name unless sanitized_name.blank? # If there is no title, leave it with "Untitled" category.slug = slug - category.description = Wordpress.clean_string description.to_s + category.meta_description = Wordpress.clean_string description.to_s category.save end end diff --git a/app/models/communication/website/imported/page.rb b/app/models/communication/website/imported/page.rb index f4dbdce8b..e064b3790 100644 --- a/app/models/communication/website/imported/page.rb +++ b/app/models/communication/website/imported/page.rb @@ -90,7 +90,7 @@ class Communication::Website::Imported::Page < ApplicationRecord sanitized_title = Wordpress.clean_string self.title.to_s page.title = sanitized_title unless sanitized_title.blank? # If there is no title, leave it with "Untitled" page.slug = slug - page.description = Wordpress.clean_string excerpt.to_s + page.meta_description = Wordpress.clean_string excerpt.to_s page.text = Wordpress.clean_html content.to_s page.published = true page.save diff --git a/app/models/communication/website/imported/post.rb b/app/models/communication/website/imported/post.rb index 8e2bcaec9..f8b8ac4be 100644 --- a/app/models/communication/website/imported/post.rb +++ b/app/models/communication/website/imported/post.rb @@ -93,7 +93,7 @@ class Communication::Website::Imported::Post < ApplicationRecord sanitized_title = Wordpress.clean_string self.title.to_s post.title = sanitized_title unless sanitized_title.blank? # If there is no title, leave it with "Untitled" post.slug = slug - post.description = Wordpress.clean_string excerpt.to_s + post.meta_description = Wordpress.clean_string excerpt.to_s post.text = Wordpress.clean_html content.to_s post.created_at = created_at post.updated_at = updated_at diff --git a/app/models/communication/website/page.rb b/app/models/communication/website/page.rb index 2a37ec772..d16d0e281 100644 --- a/app/models/communication/website/page.rb +++ b/app/models/communication/website/page.rb @@ -5,13 +5,13 @@ # id :uuid not null, primary key # bodyclass :string # breadcrumb_title :string -# description :text # featured_image_alt :string # featured_image_credit :text # full_width :boolean default(FALSE) # github_path :text # header_text :text # kind :integer +# meta_description :text # position :integer default(0), not null # published :boolean default(FALSE) # slug :string diff --git a/app/models/communication/website/page/accessibility.rb b/app/models/communication/website/page/accessibility.rb index 0160fadeb..a9819518e 100644 --- a/app/models/communication/website/page/accessibility.rb +++ b/app/models/communication/website/page/accessibility.rb @@ -5,13 +5,13 @@ # id :uuid not null, primary key # bodyclass :string # breadcrumb_title :string -# description :text # featured_image_alt :string # featured_image_credit :text # full_width :boolean default(FALSE) # github_path :text # header_text :text # kind :integer +# meta_description :text # position :integer default(0), not null # published :boolean default(FALSE) # slug :string diff --git a/app/models/communication/website/page/administrator.rb b/app/models/communication/website/page/administrator.rb index c6b1ff524..c39764290 100644 --- a/app/models/communication/website/page/administrator.rb +++ b/app/models/communication/website/page/administrator.rb @@ -5,13 +5,13 @@ # id :uuid not null, primary key # bodyclass :string # breadcrumb_title :string -# description :text # featured_image_alt :string # featured_image_credit :text # full_width :boolean default(FALSE) # github_path :text # header_text :text # kind :integer +# meta_description :text # position :integer default(0), not null # published :boolean default(FALSE) # slug :string diff --git a/app/models/communication/website/page/author.rb b/app/models/communication/website/page/author.rb index 1c85fbc4c..d80c8daed 100644 --- a/app/models/communication/website/page/author.rb +++ b/app/models/communication/website/page/author.rb @@ -5,13 +5,13 @@ # id :uuid not null, primary key # bodyclass :string # breadcrumb_title :string -# description :text # featured_image_alt :string # featured_image_credit :text # full_width :boolean default(FALSE) # github_path :text # header_text :text # kind :integer +# meta_description :text # position :integer default(0), not null # published :boolean default(FALSE) # slug :string diff --git a/app/models/communication/website/page/communication_post.rb b/app/models/communication/website/page/communication_post.rb index 4ea17f020..418530277 100644 --- a/app/models/communication/website/page/communication_post.rb +++ b/app/models/communication/website/page/communication_post.rb @@ -5,13 +5,13 @@ # id :uuid not null, primary key # bodyclass :string # breadcrumb_title :string -# description :text # featured_image_alt :string # featured_image_credit :text # full_width :boolean default(FALSE) # github_path :text # header_text :text # kind :integer +# meta_description :text # position :integer default(0), not null # published :boolean default(FALSE) # slug :string diff --git a/app/models/communication/website/page/education_diploma.rb b/app/models/communication/website/page/education_diploma.rb index fa0ab72e5..35cb9ca41 100644 --- a/app/models/communication/website/page/education_diploma.rb +++ b/app/models/communication/website/page/education_diploma.rb @@ -5,13 +5,13 @@ # id :uuid not null, primary key # bodyclass :string # breadcrumb_title :string -# description :text # featured_image_alt :string # featured_image_credit :text # full_width :boolean default(FALSE) # github_path :text # header_text :text # kind :integer +# meta_description :text # position :integer default(0), not null # published :boolean default(FALSE) # slug :string diff --git a/app/models/communication/website/page/education_program.rb b/app/models/communication/website/page/education_program.rb index 5c4614e69..f60446052 100644 --- a/app/models/communication/website/page/education_program.rb +++ b/app/models/communication/website/page/education_program.rb @@ -5,13 +5,13 @@ # id :uuid not null, primary key # bodyclass :string # breadcrumb_title :string -# description :text # featured_image_alt :string # featured_image_credit :text # full_width :boolean default(FALSE) # github_path :text # header_text :text # kind :integer +# meta_description :text # position :integer default(0), not null # published :boolean default(FALSE) # slug :string diff --git a/app/models/communication/website/page/home.rb b/app/models/communication/website/page/home.rb index 99e1db8ea..0d19444b5 100644 --- a/app/models/communication/website/page/home.rb +++ b/app/models/communication/website/page/home.rb @@ -5,13 +5,13 @@ # id :uuid not null, primary key # bodyclass :string # breadcrumb_title :string -# description :text # featured_image_alt :string # featured_image_credit :text # full_width :boolean default(FALSE) # github_path :text # header_text :text # kind :integer +# meta_description :text # position :integer default(0), not null # published :boolean default(FALSE) # slug :string diff --git a/app/models/communication/website/page/legal_term.rb b/app/models/communication/website/page/legal_term.rb index 60b88b52f..61ef387ca 100644 --- a/app/models/communication/website/page/legal_term.rb +++ b/app/models/communication/website/page/legal_term.rb @@ -5,13 +5,13 @@ # id :uuid not null, primary key # bodyclass :string # breadcrumb_title :string -# description :text # featured_image_alt :string # featured_image_credit :text # full_width :boolean default(FALSE) # github_path :text # header_text :text # kind :integer +# meta_description :text # position :integer default(0), not null # published :boolean default(FALSE) # slug :string diff --git a/app/models/communication/website/page/organization.rb b/app/models/communication/website/page/organization.rb index daa23083d..0fe98cfcc 100644 --- a/app/models/communication/website/page/organization.rb +++ b/app/models/communication/website/page/organization.rb @@ -5,13 +5,13 @@ # id :uuid not null, primary key # bodyclass :string # breadcrumb_title :string -# description :text # featured_image_alt :string # featured_image_credit :text # full_width :boolean default(FALSE) # github_path :text # header_text :text # kind :integer +# meta_description :text # position :integer default(0), not null # published :boolean default(FALSE) # slug :string diff --git a/app/models/communication/website/page/person.rb b/app/models/communication/website/page/person.rb index b4fd596b4..e035d5dd9 100644 --- a/app/models/communication/website/page/person.rb +++ b/app/models/communication/website/page/person.rb @@ -5,13 +5,13 @@ # id :uuid not null, primary key # bodyclass :string # breadcrumb_title :string -# description :text # featured_image_alt :string # featured_image_credit :text # full_width :boolean default(FALSE) # github_path :text # header_text :text # kind :integer +# meta_description :text # position :integer default(0), not null # published :boolean default(FALSE) # slug :string diff --git a/app/models/communication/website/page/privacy_policy.rb b/app/models/communication/website/page/privacy_policy.rb index dedba6f17..4b7d8da26 100644 --- a/app/models/communication/website/page/privacy_policy.rb +++ b/app/models/communication/website/page/privacy_policy.rb @@ -5,13 +5,13 @@ # id :uuid not null, primary key # bodyclass :string # breadcrumb_title :string -# description :text # featured_image_alt :string # featured_image_credit :text # full_width :boolean default(FALSE) # github_path :text # header_text :text # kind :integer +# meta_description :text # position :integer default(0), not null # published :boolean default(FALSE) # slug :string diff --git a/app/models/communication/website/page/research_paper.rb b/app/models/communication/website/page/research_paper.rb index 2ebe4ddf3..a485ea2e8 100644 --- a/app/models/communication/website/page/research_paper.rb +++ b/app/models/communication/website/page/research_paper.rb @@ -5,13 +5,13 @@ # id :uuid not null, primary key # bodyclass :string # breadcrumb_title :string -# description :text # featured_image_alt :string # featured_image_credit :text # full_width :boolean default(FALSE) # github_path :text # header_text :text # kind :integer +# meta_description :text # position :integer default(0), not null # published :boolean default(FALSE) # slug :string diff --git a/app/models/communication/website/page/research_volume.rb b/app/models/communication/website/page/research_volume.rb index dc3e3fb9e..0cb730dab 100644 --- a/app/models/communication/website/page/research_volume.rb +++ b/app/models/communication/website/page/research_volume.rb @@ -5,13 +5,13 @@ # id :uuid not null, primary key # bodyclass :string # breadcrumb_title :string -# description :text # featured_image_alt :string # featured_image_credit :text # full_width :boolean default(FALSE) # github_path :text # header_text :text # kind :integer +# meta_description :text # position :integer default(0), not null # published :boolean default(FALSE) # slug :string diff --git a/app/models/communication/website/page/researcher.rb b/app/models/communication/website/page/researcher.rb index 36748be37..4dc3ca98d 100644 --- a/app/models/communication/website/page/researcher.rb +++ b/app/models/communication/website/page/researcher.rb @@ -5,13 +5,13 @@ # id :uuid not null, primary key # bodyclass :string # breadcrumb_title :string -# description :text # featured_image_alt :string # featured_image_credit :text # full_width :boolean default(FALSE) # github_path :text # header_text :text # kind :integer +# meta_description :text # position :integer default(0), not null # published :boolean default(FALSE) # slug :string diff --git a/app/models/communication/website/page/sitemap.rb b/app/models/communication/website/page/sitemap.rb index 984270140..8848742f2 100644 --- a/app/models/communication/website/page/sitemap.rb +++ b/app/models/communication/website/page/sitemap.rb @@ -5,13 +5,13 @@ # id :uuid not null, primary key # bodyclass :string # breadcrumb_title :string -# description :text # featured_image_alt :string # featured_image_credit :text # full_width :boolean default(FALSE) # github_path :text # header_text :text # kind :integer +# meta_description :text # position :integer default(0), not null # published :boolean default(FALSE) # slug :string diff --git a/app/models/communication/website/page/teacher.rb b/app/models/communication/website/page/teacher.rb index 447a5c87a..d9d1daacb 100644 --- a/app/models/communication/website/page/teacher.rb +++ b/app/models/communication/website/page/teacher.rb @@ -5,13 +5,13 @@ # id :uuid not null, primary key # bodyclass :string # breadcrumb_title :string -# description :text # featured_image_alt :string # featured_image_credit :text # full_width :boolean default(FALSE) # github_path :text # header_text :text # kind :integer +# meta_description :text # position :integer default(0), not null # published :boolean default(FALSE) # slug :string diff --git a/app/models/communication/website/post.rb b/app/models/communication/website/post.rb index 5c3644455..1c2838ed8 100644 --- a/app/models/communication/website/post.rb +++ b/app/models/communication/website/post.rb @@ -3,10 +3,10 @@ # Table name: communication_website_posts # # id :uuid not null, primary key -# description :text # featured_image_alt :string # featured_image_credit :text # github_path :text +# meta_description :text # pinned :boolean default(FALSE) # published :boolean default(FALSE) # published_at :datetime @@ -87,7 +87,7 @@ class Communication::Website::Post < ApplicationRecord scope :for_pinned, -> (pinned) { where(pinned: pinned == 'true') } scope :for_search_term, -> (term) { where(" - unaccent(communication_website_posts.description) ILIKE unaccent(:term) OR + unaccent(communication_website_posts.meta_description) ILIKE unaccent(:term) OR unaccent(communication_website_posts.summary) ILIKE unaccent(:term) OR unaccent(communication_website_posts.text) ILIKE unaccent(:term) OR unaccent(communication_website_posts.title) ILIKE unaccent(:term) diff --git a/app/models/education/program.rb b/app/models/education/program.rb index 7383b2412..6340df323 100644 --- a/app/models/education/program.rb +++ b/app/models/education/program.rb @@ -9,12 +9,12 @@ # contacts :text # content :text # continuing :boolean -# description :text # duration :text # evaluation :text # featured_image_alt :string # featured_image_credit :text # initial :boolean +# meta_description :text # name :string # objectives :text # opportunities :text diff --git a/app/models/research/journal.rb b/app/models/research/journal.rb index 74055a6f9..f88661be1 100644 --- a/app/models/research/journal.rb +++ b/app/models/research/journal.rb @@ -2,15 +2,15 @@ # # Table name: research_journals # -# id :uuid not null, primary key -# access_token :string -# description :text -# issn :string -# repository :string -# title :string -# created_at :datetime not null -# updated_at :datetime not null -# university_id :uuid not null, indexed +# id :uuid not null, primary key +# access_token :string +# issn :string +# meta_description :text +# repository :string +# title :string +# created_at :datetime not null +# updated_at :datetime not null +# university_id :uuid not null, indexed # # Indexes # @@ -36,7 +36,7 @@ class Research::Journal < ApplicationRecord scope :ordered, -> { order(:title) } scope :for_search_term, -> (term) { where(" - unaccent(research_journals.description) ILIKE unaccent(:term) OR + unaccent(research_journals.meta_description) ILIKE unaccent(:term) OR unaccent(research_journals.issn) ILIKE unaccent(:term) OR unaccent(research_journals.repository) ILIKE unaccent(:term) OR unaccent(research_journals.title) ILIKE unaccent(:term) diff --git a/app/models/research/journal/paper.rb b/app/models/research/journal/paper.rb index b573dcd1d..baf4e402a 100644 --- a/app/models/research/journal/paper.rb +++ b/app/models/research/journal/paper.rb @@ -4,8 +4,8 @@ # # id :uuid not null, primary key # abstract :text -# description :text # keywords :text +# meta_description :text # position :integer # published :boolean default(FALSE) # published_at :datetime diff --git a/app/models/research/journal/volume.rb b/app/models/research/journal/volume.rb index 2b14ba3bf..858aad6ad 100644 --- a/app/models/research/journal/volume.rb +++ b/app/models/research/journal/volume.rb @@ -3,10 +3,10 @@ # Table name: research_journal_volumes # # id :uuid not null, primary key -# description :text # featured_image_alt :string # featured_image_credit :text # keywords :text +# meta_description :text # number :integer # published :boolean default(FALSE) # published_at :datetime diff --git a/app/models/research/laboratory/axis.rb b/app/models/research/laboratory/axis.rb index 9601058ec..69b47c682 100644 --- a/app/models/research/laboratory/axis.rb +++ b/app/models/research/laboratory/axis.rb @@ -3,7 +3,7 @@ # Table name: research_laboratory_axes # # id :uuid not null, primary key -# description :text +# meta_description :text # name :string # position :integer # short_name :string diff --git a/app/models/university/organization.rb b/app/models/university/organization.rb index 0d0c3e53b..d1a6636d0 100644 --- a/app/models/university/organization.rb +++ b/app/models/university/organization.rb @@ -2,27 +2,27 @@ # # Table name: university_organizations # -# id :uuid not null, primary key -# active :boolean default(TRUE) -# address :string -# city :string -# country :string -# description :text -# email :string -# kind :integer default("company") -# long_name :string -# name :string -# nic :string -# phone :string -# siren :string -# slug :string -# summary :text -# text :text -# url :string -# zipcode :string -# created_at :datetime not null -# updated_at :datetime not null -# university_id :uuid not null, indexed +# id :uuid not null, primary key +# active :boolean default(TRUE) +# address :string +# city :string +# country :string +# email :string +# kind :integer default("company") +# long_name :string +# meta_description :text +# name :string +# nic :string +# phone :string +# siren :string +# slug :string +# summary :text +# text :text +# url :string +# zipcode :string +# created_at :datetime not null +# updated_at :datetime not null +# university_id :uuid not null, indexed # # Indexes # @@ -65,7 +65,7 @@ class University::Organization < ApplicationRecord unaccent(university_organizations.address) ILIKE unaccent(:term) OR unaccent(university_organizations.city) ILIKE unaccent(:term) OR unaccent(university_organizations.country) ILIKE unaccent(:term) OR - unaccent(university_organizations.description) ILIKE unaccent(:term) OR + unaccent(university_organizations.meta_description) ILIKE unaccent(:term) OR unaccent(university_organizations.email) ILIKE unaccent(:term) OR unaccent(university_organizations.long_name) ILIKE unaccent(:term) OR unaccent(university_organizations.name) ILIKE unaccent(:term) OR diff --git a/app/models/university/person.rb b/app/models/university/person.rb index 21b9d381e..4a7dc6a74 100644 --- a/app/models/university/person.rb +++ b/app/models/university/person.rb @@ -8,7 +8,6 @@ # birthdate :date # city :string # country :string -# description :text # email :string # first_name :string # gender :integer @@ -20,6 +19,7 @@ # is_teacher :boolean # last_name :string # linkedin :string +# meta_description :text # name :string # phone_mobile :string # phone_personal :string @@ -147,7 +147,7 @@ class University::Person < ApplicationRecord unaccent(university_people.phone_personal) ILIKE unaccent(:term) OR unaccent(university_people.phone_professional) ILIKE unaccent(:term) OR unaccent(university_people.biography) ILIKE unaccent(:term) OR - unaccent(university_people.description) ILIKE unaccent(:term) OR + unaccent(university_people.meta_description) ILIKE unaccent(:term) OR unaccent(university_people.summary) ILIKE unaccent(:term) OR unaccent(university_people.twitter) ILIKE unaccent(:term) OR unaccent(university_people.linkedin) ILIKE unaccent(:term) OR diff --git a/app/models/university/person/administrator.rb b/app/models/university/person/administrator.rb index a32e33685..7344064b8 100644 --- a/app/models/university/person/administrator.rb +++ b/app/models/university/person/administrator.rb @@ -8,7 +8,6 @@ # birthdate :date # city :string # country :string -# description :text # email :string # first_name :string # gender :integer @@ -20,6 +19,7 @@ # is_teacher :boolean # last_name :string # linkedin :string +# meta_description :text # name :string # phone_mobile :string # phone_personal :string diff --git a/app/models/university/person/alumnus.rb b/app/models/university/person/alumnus.rb index 9f7cbdf10..768ca1426 100644 --- a/app/models/university/person/alumnus.rb +++ b/app/models/university/person/alumnus.rb @@ -8,7 +8,6 @@ # birthdate :date # city :string # country :string -# description :text # email :string # first_name :string # gender :integer @@ -20,6 +19,7 @@ # is_teacher :boolean # last_name :string # linkedin :string +# meta_description :text # name :string # phone_mobile :string # phone_personal :string diff --git a/app/models/university/person/author.rb b/app/models/university/person/author.rb index 247e50027..71dbd704e 100644 --- a/app/models/university/person/author.rb +++ b/app/models/university/person/author.rb @@ -8,7 +8,6 @@ # birthdate :date # city :string # country :string -# description :text # email :string # first_name :string # gender :integer @@ -20,6 +19,7 @@ # is_teacher :boolean # last_name :string # linkedin :string +# meta_description :text # name :string # phone_mobile :string # phone_personal :string diff --git a/app/models/university/person/researcher.rb b/app/models/university/person/researcher.rb index 1abe5abdb..db8d3308b 100644 --- a/app/models/university/person/researcher.rb +++ b/app/models/university/person/researcher.rb @@ -8,7 +8,6 @@ # birthdate :date # city :string # country :string -# description :text # email :string # first_name :string # gender :integer @@ -20,6 +19,7 @@ # is_teacher :boolean # last_name :string # linkedin :string +# meta_description :text # name :string # phone_mobile :string # phone_personal :string diff --git a/app/models/university/person/teacher.rb b/app/models/university/person/teacher.rb index 4f5e67355..6dae6e68a 100644 --- a/app/models/university/person/teacher.rb +++ b/app/models/university/person/teacher.rb @@ -8,7 +8,6 @@ # birthdate :date # city :string # country :string -# description :text # email :string # first_name :string # gender :integer @@ -20,6 +19,7 @@ # is_teacher :boolean # last_name :string # linkedin :string +# meta_description :text # name :string # phone_mobile :string # phone_personal :string diff --git a/app/services/importers/organizations.rb b/app/services/importers/organizations.rb index ecbb55d66..81f340464 100644 --- a/app/services/importers/organizations.rb +++ b/app/services/importers/organizations.rb @@ -43,7 +43,7 @@ module Importers @kind = @hash[2].to_s.strip @siren = @hash[3].to_s.strip @nic = @hash[4].to_s.strip - @description = @hash[5].to_s.strip + @meta_description = @hash[5].to_s.strip @address = @hash[6].to_s.strip @zipcode = @hash[7].to_s.strip @city = @hash[8].to_s.strip @@ -64,7 +64,7 @@ module Importers @organization.kind = @kind.to_sym @organization.siren = @siren @organization.nic = @nic - @organization.description = @description + @organization.meta_description = @meta_description @organization.address = @address @organization.zipcode = @zipcode @organization.city = @city diff --git a/app/views/admin/application/meta_description/_form.html.erb b/app/views/admin/application/meta_description/_form.html.erb new file mode 100644 index 000000000..9e200ffd0 --- /dev/null +++ b/app/views/admin/application/meta_description/_form.html.erb @@ -0,0 +1,13 @@ +<div class="card"> + <div class="card-header"> + <h5 class="card-title mb-0"><%= t('seo') %></h5> + </div> + <div class="card-body"> + <%= f.input :meta_description, + label: t('admin.meta_description.label'), + hint: t('admin.meta_description.hint'), + input_html: { + value: about.meta_description&.gsub('&', '&') + } %> + </div> +</div> diff --git a/app/views/admin/application/meta_description/_show.html.erb b/app/views/admin/application/meta_description/_show.html.erb new file mode 100644 index 000000000..857e45422 --- /dev/null +++ b/app/views/admin/application/meta_description/_show.html.erb @@ -0,0 +1,13 @@ +<% unless about.meta_description.blank? %> + <div class="card flex-fill w-100"> + <div class="card-header"> + <h2 class="card-title mb-0"><%= t('seo') %></h2> + </div> + <div class="card-body"> + <p class="lead"> + <h3 class="h5"><%= t('admin.meta_description.label') %></h3> + <%= sanitize about.meta_description %> + </p> + </div> + </div> +<% end %> diff --git a/app/views/admin/application/meta_description/_static.html.erb b/app/views/admin/application/meta_description/_static.html.erb new file mode 100644 index 000000000..cc395a7e8 --- /dev/null +++ b/app/views/admin/application/meta_description/_static.html.erb @@ -0,0 +1,5 @@ +meta_description: > + <%= prepare_text_for_static @about.meta_description %> +<%# TODO: legacy: remove when theme doesn't use description_short anymore %> +description: > + <%= prepare_text_for_static @about.meta_description %> diff --git a/app/views/admin/communication/websites/categories/_form.html.erb b/app/views/admin/communication/websites/categories/_form.html.erb index 3ac988a84..ad011b1a6 100644 --- a/app/views/admin/communication/websites/categories/_form.html.erb +++ b/app/views/admin/communication/websites/categories/_form.html.erb @@ -13,14 +13,7 @@ <%= render 'admin/application/summary/form', f: f, about: category %> </div> </div> - <div class="card"> - <div class="card-header"> - <h5 class="card-title mb-0"><%= t('seo') %></h5> - </div> - <div class="card-body"> - <%= f.input :description %> - </div> - </div> + <%= render 'admin/application/meta_description/form', f: f, about: category %> </div> <div class="col-md-4"> <div class="card flex-fill w-100"> diff --git a/app/views/admin/communication/websites/categories/show.html.erb b/app/views/admin/communication/websites/categories/show.html.erb index 119b03aec..64944461b 100644 --- a/app/views/admin/communication/websites/categories/show.html.erb +++ b/app/views/admin/communication/websites/categories/show.html.erb @@ -38,27 +38,8 @@ <% end %> </div> </div> - <% if @category.featured_image.attached? && @category.featured_image.variable? %> - <div class="card flex-fill w-100"> - <div class="card-header"> - <h5 class="card-title mb-0"><%= t('activerecord.attributes.communication/website/category.featured_image') %></h5> - </div> - <div class="card-body"> - <%= image_tag @category.featured_image.variant(resize: '600'), class: 'img-fluid mb-3' %><br> - </div> - </div> - <% end %> - <% if @category.description.present? %> - <div class="card"> - <div class="card-header"> - <h5 class="card-title mb-0"><%= t('seo') %></h5> - </div> - <div class="card-body"> - <h3 class="h5"><%= Communication::Website::Category.human_attribute_name('description') %></h3> - <%= simple_format @category.description %> - </div> - </div> - <% end %> + <%= render 'admin/application/featured_image/show', about: @category %> + <%= render 'admin/application/meta_description/show', about: @category %> </div> </div> <% if @posts.total_count > 0 %> diff --git a/app/views/admin/communication/websites/categories/static.html.erb b/app/views/admin/communication/websites/categories/static.html.erb index 00c8b304b..015ae14d9 100644 --- a/app/views/admin/communication/websites/categories/static.html.erb +++ b/app/views/admin/communication/websites/categories/static.html.erb @@ -13,8 +13,7 @@ children: <% end %> position: <%= @about.position %> <%= render 'admin/communication/unsplash/static' %> -description: > - <%= prepare_text_for_static @about.description %> +<%= render 'admin/application/meta_description/static' %> <%= render 'admin/application/summary/static' %> <%= render 'admin/communication/blocks/static', about: @about %> --- diff --git a/app/views/admin/communication/websites/pages/_form.html.erb b/app/views/admin/communication/websites/pages/_form.html.erb index be01510a2..68da89fc8 100644 --- a/app/views/admin/communication/websites/pages/_form.html.erb +++ b/app/views/admin/communication/websites/pages/_form.html.erb @@ -20,14 +20,7 @@ url = page.new_record? ? admin_communication_website_pages_path <%= f.input :text, as: :summernote if page.text&.to_plain_text.present? %> </div> </div> - <div class="card"> - <div class="card-header"> - <h5 class="card-title mb-0"><%= t('seo') %></h5> - </div> - <div class="card-body"> - <%= f.input :description %> - </div> - </div> + <%= render 'admin/application/meta_description/form', f: f, about: page %> </div> <div class="col-md-4"> <% unless page.is_home? %> diff --git a/app/views/admin/communication/websites/pages/show.html.erb b/app/views/admin/communication/websites/pages/show.html.erb index a2410b086..2219e246d 100644 --- a/app/views/admin/communication/websites/pages/show.html.erb +++ b/app/views/admin/communication/websites/pages/show.html.erb @@ -45,11 +45,6 @@ <h3 class="h5"><%= Communication::Website::Page.human_attribute_name('path') %></h3> <p><%= @page.path %></p> - <% if @page.description.present? %> - <h3 class="h5"><%= Communication::Website::Page.human_attribute_name('description') %></h3> - <%= simple_format @page.description %> - <% end %> - <% if @page.parent %> <h3 class="h5"><%= Communication::Website::Page.human_attribute_name('parent') %></h3> <p><%= link_to_if can?(:read, @page.parent), @@ -93,6 +88,7 @@ </div> </div> <%= render 'admin/application/featured_image/show', about: @page %> + <%= render 'admin/application/meta_description/show', about: @page %> </div> </div> <% end %> diff --git a/app/views/admin/communication/websites/pages/static.html.erb b/app/views/admin/communication/websites/pages/static.html.erb index a7178b1ac..1c31214a4 100644 --- a/app/views/admin/communication/websites/pages/static.html.erb +++ b/app/views/admin/communication/websites/pages/static.html.erb @@ -20,8 +20,7 @@ children: - <%= child.path %> <% end %> <% end %> -description: > - <%= prepare_text_for_static @about.description %> +<%= render 'admin/application/meta_description/static' %> <%= render 'admin/application/summary/static' %> header_text: >- <%= prepare_html_for_static @about.header_text, @website.university %> diff --git a/app/views/admin/communication/websites/posts/_form.html.erb b/app/views/admin/communication/websites/posts/_form.html.erb index 314dc9d85..1cfe0a7de 100644 --- a/app/views/admin/communication/websites/posts/_form.html.erb +++ b/app/views/admin/communication/websites/posts/_form.html.erb @@ -31,14 +31,7 @@ </div> </div> <div class="col-md-6"> - <div class="card flex-fill w-100"> - <div class="card-header"> - <h5 class="card-title mb-0"><%= t('seo') %></h5> - </div> - <div class="card-body"> - <%= f.input :description %> - </div> - </div> + <%= render 'admin/application/meta_description/form', f: f, about: post %> </div> </div> </div> diff --git a/app/views/admin/communication/websites/posts/show.html.erb b/app/views/admin/communication/websites/posts/show.html.erb index dc23ed4d2..e37dba9ad 100644 --- a/app/views/admin/communication/websites/posts/show.html.erb +++ b/app/views/admin/communication/websites/posts/show.html.erb @@ -48,13 +48,10 @@ <% end %> <h3 class="h5"><%= Communication::Website::Post.human_attribute_name('slug') %></h3> <p><%= @post.slug %></p> - <% if @post.description.present? %> - <h3 class="h5"><%= Communication::Website::Post.human_attribute_name('description') %></h3> - <%= simple_format @post.description %> - <% end %> </div> </div> <%= render 'admin/application/featured_image/show', about: @post %> + <%= render 'admin/application/meta_description/show', about: @post %> </div> </div> <% end %> diff --git a/app/views/admin/communication/websites/posts/static.html.erb b/app/views/admin/communication/websites/posts/static.html.erb index a2471e461..3da24344a 100644 --- a/app/views/admin/communication/websites/posts/static.html.erb +++ b/app/views/admin/communication/websites/posts/static.html.erb @@ -17,8 +17,7 @@ categories: <% end %> <% end %> <%= render 'admin/communication/unsplash/static' %> -description: > - <%= prepare_text_for_static @about.description %> +<%= render 'admin/application/meta_description/static' %> <%= render 'admin/application/summary/static' %> <%= render 'admin/communication/blocks/static', about: @about %> --- diff --git a/app/views/admin/education/programs/_form.html.erb b/app/views/admin/education/programs/_form.html.erb index 91e6c8064..6a0272b41 100644 --- a/app/views/admin/education/programs/_form.html.erb +++ b/app/views/admin/education/programs/_form.html.erb @@ -137,14 +137,7 @@ value_method: ->(p) { p[:id] } %> <% end %> <%= render 'admin/application/featured_image/edit', about: program, f: f %> - <div class="card flex-fill w-100"> - <div class="card-header"> - <h5 class="card-title mb-0"><%= t('seo') %></h5> - </div> - <div class="card-body"> - <%= f.input :description %> - </div> - </div> + <%= render 'admin/application/meta_description/form', f: f, about: program %> </div> </div> diff --git a/app/views/admin/education/programs/show.html.erb b/app/views/admin/education/programs/show.html.erb index 2176d739c..22a263d57 100644 --- a/app/views/admin/education/programs/show.html.erb +++ b/app/views/admin/education/programs/show.html.erb @@ -138,17 +138,7 @@ <% end %> <% end %> <%= render 'admin/application/featured_image/show', about: @program %> - <% if @program.description.present? %> - <div class="card flex-fill w-100"> - <div class="card-header"> - <h5 class="card-title mb-0"><%= t('seo') %></h5> - </div> - <div class="card-body"> - <h3 class="h5"><%= Education::Program.human_attribute_name('description') %></h3> - <%= simple_format @program.description %> - </div> - </div> - <% end %> + <%= render 'admin/application/meta_description/show', about: @program %> </div> </div> diff --git a/app/views/admin/education/programs/static.html.erb b/app/views/admin/education/programs/static.html.erb index 60d10268f..9ba44d41b 100644 --- a/app/views/admin/education/programs/static.html.erb +++ b/app/views/admin/education/programs/static.html.erb @@ -16,8 +16,7 @@ downloadable_summary: <%= @about.downloadable_summary.blob_id %> <% end %> registration_url: > <%= @about.registration_url %> -description: > - <%= prepare_text_for_static @about.description %> +<%= render 'admin/application/meta_description/static' %> <%= render 'admin/application/summary/static' %> presentation: > <%= prepare_text_for_static @about.presentation %> diff --git a/app/views/admin/research/journals/_form.html.erb b/app/views/admin/research/journals/_form.html.erb index d8c98a3af..3573f57b2 100644 --- a/app/views/admin/research/journals/_form.html.erb +++ b/app/views/admin/research/journals/_form.html.erb @@ -11,6 +11,9 @@ </div> </div> </div> + <div class="col-md-6"> + <%= render 'admin/application/meta_description/form', f: f, about: journal %> + </div> </div> <% content_for :action_bar_right do %> <%= submit f %> diff --git a/app/views/admin/research/journals/papers/_form.html.erb b/app/views/admin/research/journals/papers/_form.html.erb index dea53a6c4..e733d0462 100644 --- a/app/views/admin/research/journals/papers/_form.html.erb +++ b/app/views/admin/research/journals/papers/_form.html.erb @@ -37,14 +37,7 @@ <%= f.association :people, collection: current_university.people.researchers.ordered, as: :check_boxes %> </div> </div> - <div class="card"> - <div class="card-header"> - <h5 class="card-title mb-0"><%= t('seo') %></h5> - </div> - <div class="card-body"> - <%= f.input :description %> - </div> - </div> + <%= render 'admin/application/meta_description/form', f: f, about: paper %> </div> </div> <% content_for :action_bar_right do %> diff --git a/app/views/admin/research/journals/papers/show.html.erb b/app/views/admin/research/journals/papers/show.html.erb index 29fd35332..f3bf6ca7c 100644 --- a/app/views/admin/research/journals/papers/show.html.erb +++ b/app/views/admin/research/journals/papers/show.html.erb @@ -59,20 +59,7 @@ <% end %> </div> </div> - <% if @paper.description.present? %> - <div class="card flex-fill w-100"> - <div class="card-header"> - <h5 class="card-title mb-0"><%= t('seo') %></h5> - </div> - <div class="card-body"> - <h3 class="h5"> - <%= Research::Journal::Paper.human_attribute_name('description') %> - </h3> - <%= simple_format @paper.description %> - </div> - </div> - <% end %> - + <%= render 'admin/application/meta_description/show', about: @paper %> </div> </div> diff --git a/app/views/admin/research/journals/papers/static.html.erb b/app/views/admin/research/journals/papers/static.html.erb index 8b0c77f29..3e38a4349 100644 --- a/app/views/admin/research/journals/papers/static.html.erb +++ b/app/views/admin/research/journals/papers/static.html.erb @@ -1,8 +1,6 @@ --- title: "<%= @about.title %>" slug: "<%= @about.slug %>" -description: > - <%= prepare_text_for_static @about.description %> <% if @about.volume && @about.volume.path %> volumes: - "<%= @about.volume.path %>" @@ -18,6 +16,7 @@ researchers: <% @about.people.each do |person| %> - "<%= person.slug %>" <% end %> +<%= render 'admin/application/meta_description/static' %> <%= render 'admin/application/summary/static' %> abstract: "<%= @about.abstract %>" references: "<%= @about.references %>" diff --git a/app/views/admin/research/journals/show.html.erb b/app/views/admin/research/journals/show.html.erb index b01f2f575..be32a34b3 100644 --- a/app/views/admin/research/journals/show.html.erb +++ b/app/views/admin/research/journals/show.html.erb @@ -54,6 +54,8 @@ <%= render 'admin/research/journals/papers/list', papers: @papers %> </div> +<%= render 'admin/application/meta_description/show', about: @journal %> + <% content_for :action_bar_left do %> <%= destroy_link @journal %> <% end %> diff --git a/app/views/admin/research/journals/static.html.erb b/app/views/admin/research/journals/static.html.erb index 726cde68d..278021cc4 100644 --- a/app/views/admin/research/journals/static.html.erb +++ b/app/views/admin/research/journals/static.html.erb @@ -3,6 +3,5 @@ title: > <%= @about.title %> issn: > <%= @about.issn %> -description: > - <%= prepare_text_for_static @about.description %> +<%= render 'admin/application/meta_description/static' %> --- diff --git a/app/views/admin/research/journals/volumes/_form.html.erb b/app/views/admin/research/journals/volumes/_form.html.erb index fa9e56696..3bcfdafab 100644 --- a/app/views/admin/research/journals/volumes/_form.html.erb +++ b/app/views/admin/research/journals/volumes/_form.html.erb @@ -13,28 +13,7 @@ <%= f.input :text, as: :summernote %> </div> </div> - <div class="row"> - <div class="col-md-6"> - <div class="card flex-fill w-100"> - <div class="card-header"> - <h5 class="card-title mb-0"><%= t('seo') %></h5> - </div> - <div class="card-body"> - <%= f.input :description %> - </div> - </div> - </div> - </div> - <div class="col-md-6"> - <div class="card flex-fill w-100"> - <div class="card-header"> - <h5 class="card-title mb-0"><%= t('seo') %></h5> - </div> - <div class="card-body"> - <%= f.input :description %> - </div> - </div> - </div> + <%= render 'admin/application/meta_description/form', f: f, about: volume %> </div> <div class="col-md-4"> <div class="card flex-fill w-100"> diff --git a/app/views/admin/research/journals/volumes/show.html.erb b/app/views/admin/research/journals/volumes/show.html.erb index df930f88d..9d58f2d98 100644 --- a/app/views/admin/research/journals/volumes/show.html.erb +++ b/app/views/admin/research/journals/volumes/show.html.erb @@ -67,17 +67,7 @@ </div> </div> <%= render 'admin/application/featured_image/show', about: @volume %> - <% if @volume.description.present? %> - <div class="card flex-fill w-100"> - <div class="card-header"> - <h5 class="card-title mb-0"><%= t('seo') %></h5> - </div> - <div class="card-body"> - <h3 class="h5"><%= Research::Journal::Volume.human_attribute_name('description') %></h3> - <%= simple_format @volume.description %> - </div> - </div> - <% end %> + <%= render 'admin/application/meta_description/show', about: @volume %> </div> </div> diff --git a/app/views/admin/research/journals/volumes/static.html.erb b/app/views/admin/research/journals/volumes/static.html.erb index 2bba1c9be..bd0d0a26b 100644 --- a/app/views/admin/research/journals/volumes/static.html.erb +++ b/app/views/admin/research/journals/volumes/static.html.erb @@ -7,7 +7,6 @@ keywords: > <%= @about.keywords %> date: "<%= @about.published_at.iso8601 %>" <%= render 'admin/communication/unsplash/static' %> -description: > - <%= prepare_text_for_static @about.description %> +<%= render 'admin/application/meta_description/static' %> --- <%= prepare_html_for_static @about.text, @about.university %> diff --git a/app/views/admin/research/laboratories/axes/_form.html.erb b/app/views/admin/research/laboratories/axes/_form.html.erb index 409265d9f..c4d484522 100644 --- a/app/views/admin/research/laboratories/axes/_form.html.erb +++ b/app/views/admin/research/laboratories/axes/_form.html.erb @@ -22,14 +22,7 @@ </div> </div> <div class="col-md-4"> - <div class="card flex-fill w-100"> - <div class="card-header"> - <h5 class="card-title mb-0"><%= t('seo') %></h5> - </div> - <div class="card-body"> - <%= f.input :description %> - </div> - </div> + <%= render 'admin/application/meta_description/form', f: f, about: axis %> </div> </div> <% content_for :action_bar_right do %> diff --git a/app/views/admin/research/laboratories/axes/show.html.erb b/app/views/admin/research/laboratories/axes/show.html.erb index a9477f5d1..a937db7ca 100644 --- a/app/views/admin/research/laboratories/axes/show.html.erb +++ b/app/views/admin/research/laboratories/axes/show.html.erb @@ -17,17 +17,7 @@ </div> </div> <div class="col-md-4"> - <% if @axis.description.present? %> - <div class="card flex-fill w-100"> - <div class="card-header"> - <h5 class="card-title mb-0"><%= t('seo') %></h5> - </div> - <div class="card-body"> - <h3 class="h5"><%= Research::Laboratory::Axis.human_attribute_name('description') %></h3> - <%= simple_format @axis.description %> - </div> - </div> - <% end %> + <%= render 'admin/application/meta_description/show', about: @axis %> </div> </div> diff --git a/app/views/admin/university/organizations/_form.html.erb b/app/views/admin/university/organizations/_form.html.erb index 6cbb7ab9c..741e80642 100644 --- a/app/views/admin/university/organizations/_form.html.erb +++ b/app/views/admin/university/organizations/_form.html.erb @@ -93,14 +93,7 @@ direct_upload: true %> </div> </div> - <div class="card flex-fill w-100"> - <div class="card-header"> - <h5 class="card-title mb-0"><%= t('seo') %></h5> - </div> - <div class="card-body"> - <%= f.input :description %> - </div> - </div> + <%= render 'admin/application/meta_description/form', f: f, about: organization %> </div> </div> <% content_for :action_bar_right do %> diff --git a/app/views/admin/university/organizations/imports/new.html.erb b/app/views/admin/university/organizations/imports/new.html.erb index b1fb765b4..7ce59642e 100644 --- a/app/views/admin/university/organizations/imports/new.html.erb +++ b/app/views/admin/university/organizations/imports/new.html.erb @@ -49,7 +49,7 @@ <td>00052</td> </tr> <tr> - <th>description</th> + <th>meta description</th> <td>Le quotidien de référence</td> </tr> <tr> diff --git a/app/views/admin/university/organizations/show.html.erb b/app/views/admin/university/organizations/show.html.erb index 5c33a452e..be7f63ca8 100644 --- a/app/views/admin/university/organizations/show.html.erb +++ b/app/views/admin/university/organizations/show.html.erb @@ -103,17 +103,7 @@ </div> </div> <% end %> - <% if @organization.description.present? %> - <div class="card flex-fill w-100"> - <div class="card-header"> - <h5 class="card-title mb-0"><%= t('seo') %></h5> - </div> - <div class="card-body"> - <h3 class="h5"><%= University::Organization.human_attribute_name('description') %></h3> - <%= simple_format @organization.description %> - </div> - </div> - <% end %> + <%= render 'admin/application/meta_description/show', about: @organization %> </div> </div> diff --git a/app/views/admin/university/organizations/static.html.erb b/app/views/admin/university/organizations/static.html.erb index 545b9d65f..e69cbb207 100644 --- a/app/views/admin/university/organizations/static.html.erb +++ b/app/views/admin/university/organizations/static.html.erb @@ -2,7 +2,6 @@ title: > <%= @about.to_s %> <%= render 'admin/application/static/permalink' %> -<%= render 'admin/application/summary/static' %> <%= render 'admin/application/static/design', full_width: true, toc_offcanvas: true %> long_name: > <%= @about.long_name %> @@ -21,8 +20,8 @@ logo: "<%= @about.logo.blob.id %>" <% if @about.logo_on_dark_background.attached? %> logo_on_dark_background: "<%= @about.logo_on_dark_background.blob.id %>" <% end %> -description: > - <%= prepare_text_for_static @about.description %> +<%= render 'admin/application/meta_description/static' %> +<%= render 'admin/application/summary/static' %> <%= render 'admin/communication/blocks/static', about: @about %> --- <%= prepare_html_for_static @about.text, @about.university %> diff --git a/app/views/admin/university/people/_form.html.erb b/app/views/admin/university/people/_form.html.erb index 49717c74e..eb779753b 100644 --- a/app/views/admin/university/people/_form.html.erb +++ b/app/views/admin/university/people/_form.html.erb @@ -144,14 +144,7 @@ direct_upload: true %> </div> </div> - <div class="card flex-fill w-100"> - <div class="card-header"> - <h5 class="card-title mb-0"><%= t('seo') %></h5> - </div> - <div class="card-body"> - <%= f.input :description %> - </div> - </div> + <%= render 'admin/application/meta_description/form', f: f, about: person %> </div> </div> <% content_for :action_bar_right do %> diff --git a/app/views/admin/university/people/_main_infos.html.erb b/app/views/admin/university/people/_main_infos.html.erb index a17490eb0..c5ba7226d 100644 --- a/app/views/admin/university/people/_main_infos.html.erb +++ b/app/views/admin/university/people/_main_infos.html.erb @@ -92,16 +92,6 @@ </div> </div> <% end %> - <% if person.description.present? %> - <div class="card flex-fill w-100"> - <div class="card-header"> - <h5 class="card-title mb-0"><%= t('seo') %></h5> - </div> - <div class="card-body"> - <h3 class="h5"><%= University::Person.human_attribute_name('description') %></h3> - <%= simple_format person.description %> - </div> - </div> - <% end %> + <%= render 'admin/application/meta_description/show', about: person %> </div> </div> diff --git a/app/views/admin/university/people/administrators/static.html.erb b/app/views/admin/university/people/administrators/static.html.erb index a9c89c3f8..5902a5d20 100644 --- a/app/views/admin/university/people/administrators/static.html.erb +++ b/app/views/admin/university/people/administrators/static.html.erb @@ -9,6 +9,6 @@ first_name: > <%= @about.first_name %> last_name: > <%= @about.last_name %> -description: > - <%= prepare_text_for_static @about.description %> +<%= render 'admin/application/meta_description/static' %> +<%= render 'admin/application/summary/static' %> --- diff --git a/app/views/admin/university/people/authors/static.html.erb b/app/views/admin/university/people/authors/static.html.erb index 7551467dd..5759db851 100644 --- a/app/views/admin/university/people/authors/static.html.erb +++ b/app/views/admin/university/people/authors/static.html.erb @@ -9,6 +9,6 @@ first_name: > <%= @about.first_name %> last_name: > <%= @about.last_name %> -description: > - <%= prepare_text_for_static @about.description %> +<%= render 'admin/application/meta_description/static' %> +<%= render 'admin/application/summary/static' %> --- diff --git a/app/views/admin/university/people/researchers/static.html.erb b/app/views/admin/university/people/researchers/static.html.erb index a18df13be..84b7176db 100644 --- a/app/views/admin/university/people/researchers/static.html.erb +++ b/app/views/admin/university/people/researchers/static.html.erb @@ -9,6 +9,6 @@ first_name: > <%= @about.first_name %> last_name: > <%= @about.last_name %> -description: > - <%= prepare_text_for_static @about.description %> +<%= render 'admin/application/meta_description/static' %> +<%= render 'admin/application/summary/static' %> --- diff --git a/app/views/admin/university/people/static.html.erb b/app/views/admin/university/people/static.html.erb index a029e8015..7907da37d 100644 --- a/app/views/admin/university/people/static.html.erb +++ b/app/views/admin/university/people/static.html.erb @@ -2,6 +2,7 @@ title: > <%= @about.to_s %> <%= render 'admin/application/static/permalink' %> +<%= render 'admin/application/meta_description/static' %> <%= render 'admin/application/summary/static' %> <%= render 'admin/application/static/design', full_width: true, toc_offcanvas: true %> first_name: > @@ -21,8 +22,6 @@ website: >- <% if @about.best_picture.attached? %> image: "<%= @about.best_picture.blob.id %>" <% end %> -description: > - <%= prepare_text_for_static @about.description %> roles: <% if @about.author.for_website?(@website) %> - author diff --git a/app/views/admin/university/people/teachers/static.html.erb b/app/views/admin/university/people/teachers/static.html.erb index 5d5d5d01f..b2d59e7b9 100644 --- a/app/views/admin/university/people/teachers/static.html.erb +++ b/app/views/admin/university/people/teachers/static.html.erb @@ -9,6 +9,6 @@ first_name: > <%= @about.first_name %> last_name: > <%= @about.last_name %> -description: > - <%= prepare_text_for_static @about.description %> +<%= render 'admin/application/meta_description/static' %> +<%= render 'admin/application/summary/static' %> --- diff --git a/config/locales/communication/en.yml b/config/locales/communication/en.yml index df55fba0d..25fe01c37 100644 --- a/config/locales/communication/en.yml +++ b/config/locales/communication/en.yml @@ -84,7 +84,6 @@ en: url: URL communication/website/category: children: Children categories - description: Meta Description featured_image: Featured image featured_image_alt: Alt text name: Name @@ -112,7 +111,6 @@ en: bodyclass: Specific CSS class breadcrumb_title: Title in breadcrumbs children: Children pages - description: Meta description featured_image: Featured image featured_image_alt: Alt text full_width: Full width @@ -129,7 +127,6 @@ en: author: Author category: Category categories: Categories - description: Meta description featured_image: Featured image featured_image_alt: Alt text featured_image_credit: Credit @@ -678,11 +675,6 @@ en: git_branch: 'If blank, default branch will be used' git_endpoint: 'If blank, default will be used (https://github.com or https://gitlab.com/api/v4)' languages: 'If you select at least one language the website will be considered as possibly multilingual, and therefore all urls will be prefixed with the language (/fr, /en)' - communication_website_category: - description: If this field is empty the main text's begining will be used. communication_website_page: breadcrumb_title: If the field is empty, page title will be used in breadcrumbs. - description: If this field is empty, the "lead text" field will be used. If also emty the main text's begining will be used. full_width: On large screens, a full width page uses all available space for the content. This is good for landing pages, or to make them spectacular. If the page is not full width, the content column will be smaller to make reading easier. The unused space might be used for a table of contents. - communication_website_post: - description: If this field is empty, the "lead text" field will be used. If also emty the main text's begining will be used. diff --git a/config/locales/communication/fr.yml b/config/locales/communication/fr.yml index c58261990..fb1cf9db0 100644 --- a/config/locales/communication/fr.yml +++ b/config/locales/communication/fr.yml @@ -84,7 +84,6 @@ fr: url: URL communication/website/category: children: Catégories enfants - description: Meta Description featured_image: Image à la une featured_image_alt: Texte alternatif name: Nom @@ -112,7 +111,6 @@ fr: bodyclass: Classe CSS spécifique breadcrumb_title: Nom affiché dans le fil d'ariane children: Pages enfants - description: Description pour le référencement naturel featured_image: Image à la une featured_image_alt: Texte alternatif full_width: Pleine largeur @@ -129,7 +127,6 @@ fr: author: Auteur·rice category: Catégorie categories: Catégories - description: Description pour le référencement naturel featured_image: Image à la une featured_image_alt: Texte alternatif featured_image_credit: Crédit @@ -680,13 +677,9 @@ fr: git_branch: 'Laisser vide pour la branche par défaut' git_endpoint: 'Laisser vide pour les valeurs par défaut (https://github.com ou https://gitlab.com/api/v4)' languages: 'Si vous sélectionnez au moins une langue le site sera considéré comme possiblement multilingue et donc toutes les urls seront préfixées avec la langue (/fr, /en)' - communication_website_category: - description: Si ce champ est vide le début du texte principal sera utilisé. communication_website_page: breadcrumb_title: Si ce champ est vide le titre de la page sera utilisé dans le fil d'Ariane. - description: Si ce champ est vide le "chapô" sera utilisé. Si il est également vide le début du texte principal sera utilisé. full_width: Sur de grands écrans, la page en pleine largeur utilisera tout l'espace disponible, ce qui est pertinent pour événementialiser une page. Si la page n'est pas en pleine largeur, l'espace dédié au contenu sera réduit pour faciliter la lecture, et l'espace libre pourra être utilisé pour une table des matières facilitant la navigation. text: Ce champ est déprécié, le contenu ne s'affichera pas sur le site. communication_website_post: - description: Si ce champ est vide le "chapô" sera utilisé. Si il est également vide le début du texte principal sera utilisé. text: Ce champ est déprécié, le contenu ne s'affichera pas sur le site. diff --git a/config/locales/education/en.yml b/config/locales/education/en.yml index 9fb1724fd..a55b25607 100644 --- a/config/locales/education/en.yml +++ b/config/locales/education/en.yml @@ -40,7 +40,6 @@ en: capacity: Capacity contacts: Contacts continuing: Continuing training - description: Meta Description diploma: Diploma duration: Duration downloadable_summary: Downloadable summary @@ -138,20 +137,19 @@ en: simple_form: hints: education_diploma: - ects: European Credits Transfer System duration: Duration can be set as hours or days and it can be estimated. + ects: European Credits Transfer System education_program: + accessibility: Conditions of reception and access for people with disabilities (premises, adaptation of the means of provision). capacity: People per cohort + duration: The duration can be expressed in hours or days. It can also be lumped or estimated. ects: European Credits Transfer System - prerequisites: Necessary or indispensable prerequisites for a given service. The absence of prerequisites must be mentioned. + evaluation: Means mobilised to measure with objective criteria the beneficiary's achievements during and/or at the end of the service. objectives: "A statement of the skills and competences, both targeted and assessable, that will be acquired during the performance. Ability: the ability to apply knowledge and use skills to complete tasks and solve problems. Competence: demonstrated ability to apply knowledge, skills and personal, social or methodological dispositions in work or study/training situations for professional or personal development." - duration: The duration can be expressed in hours or days. It can also be lumped or estimated. - registration: "Access time: estimated time between the beneficiary's application and the start of the service." - pricing: Price of the service or tariff conditions. pedagogy: Teaching methods and/or means and/or tools used to carry out the service provided. - evaluation: Means mobilised to measure with objective criteria the beneficiary's achievements during and/or at the end of the service. - accessibility: Conditions of reception and access for people with disabilities (premises, adaptation of the means of provision). - description: Plain text without HTML, dedicated to SEO + prerequisites: Necessary or indispensable prerequisites for a given service. The absence of prerequisites must be mentioned. + pricing: Price of the service or tariff conditions. + registration: "Access time: estimated time between the beneficiary's application and the start of the service." include_blanks: defaults: program: "Select a program" diff --git a/config/locales/education/fr.yml b/config/locales/education/fr.yml index 066098e55..afe79e85b 100644 --- a/config/locales/education/fr.yml +++ b/config/locales/education/fr.yml @@ -40,7 +40,6 @@ fr: capacity: Capacité contacts: Contacts continuing: Formation continue - description: Meta Description diploma: Diplôme duration: Durée downloadable_summary: Document de synthèse téléchargeable @@ -138,20 +137,19 @@ fr: simple_form: hints: education_diploma: - ects: European Credits Transfer System duration: La durée peut être exprimée en heure ou en jour. Elle peut également être forfaitisée ou estimée. + ects: European Credits Transfer System education_program: + accessibility: Conditions d'accueil et d’accès des publics en situation de handicap (locaux, adaptation des moyens de la prestation). capacity: Nombre de places disponibles par promotion + duration: La durée peut être exprimée en heure ou en jour. Elle peut également être forfaitisée ou estimée. ects: European Credits Transfer System - prerequisites: Préalables nécessaires ou indispensables pour bénéficier d'une prestation déterminée. L'absence de prérequis doit être mentionnée. + evaluation: Moyens mobilisés pour mesurer à l'aide de critères objectifs les acquis du bénéficiaire en cours et/ou à la fin de la prestation. objectives: "Énoncé des aptitudes et compétences, visées et évaluables, qui seront acquises au cours de la prestation. Aptitude : capacité d'appliquer un savoir et d'utiliser un savoir-faire pour réaliser des tâches et résoudre des problèmes. Compétences : capacité avérée de mettre en œuvre des savoirs, des savoir-faire et des dispositions personnelles, sociales ou méthodologiques dans des situations de travail ou d’études/formations, pour le développement professionnel ou personnel." - duration: La durée peut être exprimée en heure ou en jour. Elle peut également être forfaitisée ou estimée. - registration: "Délai d’accès : durée estimée entre la demande du bénéficiaire et le début de la prestation." - pricing: Prix de la prestation ou conditions tarifaires. pedagogy: Modalités pédagogiques et/ou moyens et/ou outils utilisés pour mener à bien la prestation dispensée. - evaluation: Moyens mobilisés pour mesurer à l'aide de critères objectifs les acquis du bénéficiaire en cours et/ou à la fin de la prestation. - accessibility: Conditions d'accueil et d’accès des publics en situation de handicap (locaux, adaptation des moyens de la prestation). - description: Texte simple, sans HTML, pour le SEO + prerequisites: Préalables nécessaires ou indispensables pour bénéficier d'une prestation déterminée. L'absence de prérequis doit être mentionnée. + pricing: Prix de la prestation ou conditions tarifaires. + registration: "Délai d’accès : durée estimée entre la demande du bénéficiaire et le début de la prestation." include_blanks: defaults: program: "Sélectionnez une formation" diff --git a/config/locales/en.yml b/config/locales/en.yml index 496ba1cc3..7111d6398 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -96,6 +96,9 @@ en: sentence_without_link: Value inherited sentence_html: Value inherited from %{link} status: Inherited value + meta_description: + hint: Plain text without HTML, dedicated to SEO + label: Meta description pending_tasks: label: Background tasks pending hint: Those tasks precompute your data in order to minimize its carbon footprint. It creates a delay before your changes are online. diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 046e74c74..844af3b00 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -96,6 +96,9 @@ fr: sentence_without_link: Valeur héritée sentence_html: Valeur héritée de %{link} status: Valeur héritée + meta_description: + hint: Texte simple, dédié au SEO + label: Meta description pending_tasks: label: Tâches en cours de traitement hint: L'exécution de ces tâches contribue à diminuer l'empreinte carbone du numérique, en précalculant ce qui peut l'être. Cela peut générer un délai avant que vos modifications ne soient visibles. diff --git a/config/locales/research/en.yml b/config/locales/research/en.yml index 09f9bc071..7e0270965 100644 --- a/config/locales/research/en.yml +++ b/config/locales/research/en.yml @@ -28,7 +28,6 @@ en: title: Title research/journal/paper: abstract: Abstract - description: Meta Description keywords: Keywords pdf: PDF published: Published? @@ -40,7 +39,6 @@ en: research/journal/volume: featured_image: Cover featured_image_alt: Alt text - description: Meta Description keywords: Keywords number: Number published: Published? @@ -54,7 +52,6 @@ en: name: Name zipcode: Zipcode research/laboratory/axis: - description: Meta Description name: Name short_name: Short name text: Text @@ -75,10 +72,5 @@ en: other: Researchers simple_form: hints: - research_journal_paper: - description: If this field is empty the main text's begining will be used. research_journal_volume: cover: JPG or PNG file - description: If this field is empty the main text's begining will be used. - research_laboratory_axis: - description: If this field is empty the main text's begining will be used. diff --git a/config/locales/research/fr.yml b/config/locales/research/fr.yml index 1dc6d8e66..2b5e8e04a 100644 --- a/config/locales/research/fr.yml +++ b/config/locales/research/fr.yml @@ -28,7 +28,6 @@ fr: title: Titre research/journal/paper: abstract: Extrait - description: Meta Description keywords: Mots clés pdf: PDF published: Publié ? @@ -40,7 +39,6 @@ fr: research/journal/volume: featured_image: Couverture featured_image_alt: Texte alternatif - description: Meta Description keywords: Mots clés number: Numéro published: Publié ? @@ -54,7 +52,6 @@ fr: name: Nom zipcode: Code postal research/laboratory/axis: - description: Meta Description name: Nom short_name: Nom court text: Texte @@ -75,10 +72,5 @@ fr: other: Chercheu·rs·ses simple_form: hints: - research_journal_paper: - description: Si ce champ est vide le début de l'extrait sera utilisé. research_journal_volume: cover: Fichier JPG ou PNG - description: Si ce champ est vide le début du texte principal sera utilisé. - research_laboratory_axis: - description: Si ce champ est vide le début du texte principal sera utilisé. diff --git a/config/locales/university/en.yml b/config/locales/university/en.yml index 17babc0fd..59c16d2d2 100644 --- a/config/locales/university/en.yml +++ b/config/locales/university/en.yml @@ -34,7 +34,6 @@ en: communication_website_posts: Posts contacts: Contact information country: Country - description: Meta description education_programs: Programs email: Email essentials: Essentials @@ -84,7 +83,6 @@ en: city: City contact: Contact information country: Country - description: Meta description email: Email kind: Kind legal: Legal information diff --git a/config/locales/university/fr.yml b/config/locales/university/fr.yml index 8ab4f5e4d..045293d1a 100644 --- a/config/locales/university/fr.yml +++ b/config/locales/university/fr.yml @@ -34,7 +34,6 @@ fr: communication_website_posts: Actualités contacts: Coordonnées country: Pays - description: Meta description education_programs: Formations email: Email essentials: Informations essentielles @@ -84,7 +83,6 @@ fr: city: Ville contact: Informations de contact country: Pays - description: Meta description email: Email kind: Type legal: Informations légales diff --git a/db/migrate/20230109143628_rename_description_to_meta_description.rb b/db/migrate/20230109143628_rename_description_to_meta_description.rb new file mode 100644 index 000000000..30b6d6a31 --- /dev/null +++ b/db/migrate/20230109143628_rename_description_to_meta_description.rb @@ -0,0 +1,14 @@ +class RenameDescriptionToMetaDescription < ActiveRecord::Migration[7.0] + def change + rename_column :communication_website_categories, :description, :meta_description + rename_column :communication_website_pages, :description, :meta_description + rename_column :communication_website_posts, :description, :meta_description + rename_column :education_programs, :description, :meta_description + rename_column :research_journals, :description, :meta_description + rename_column :research_journal_papers, :description, :meta_description + rename_column :research_journal_volumes, :description, :meta_description + rename_column :research_laboratory_axes, :description, :meta_description + rename_column :university_organizations, :description, :meta_description + rename_column :university_people, :description, :meta_description + end +end diff --git a/db/schema.rb b/db/schema.rb index 0199ee059..e241f54c6 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[7.0].define(version: 2023_01_09_140347) do +ActiveRecord::Schema[7.0].define(version: 2023_01_09_143628) do # These are extensions that must be enabled in order to support this database enable_extension "pgcrypto" enable_extension "plpgsql" @@ -121,7 +121,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_01_09_140347) do t.uuid "university_id", null: false t.uuid "communication_website_id", null: false t.string "name" - t.text "description" + t.text "meta_description" t.integer "position" t.datetime "created_at", null: false t.datetime "updated_at", null: false @@ -303,7 +303,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_01_09_140347) do t.uuid "university_id", null: false t.uuid "communication_website_id", null: false t.string "title" - t.text "description" + t.text "meta_description" t.string "slug" t.text "path" t.uuid "parent_id" @@ -347,7 +347,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_01_09_140347) do t.uuid "university_id", null: false t.uuid "communication_website_id", null: false t.string "title" - t.text "description" + t.text "meta_description" t.boolean "published", default: false t.datetime "published_at", precision: nil t.datetime "created_at", null: false @@ -480,7 +480,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_01_09_140347) do t.integer "position", default: 0 t.string "slug" t.string "path" - t.text "description" + t.text "meta_description" t.boolean "published", default: false t.string "featured_image_alt" t.text "accessibility" @@ -580,7 +580,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_01_09_140347) do t.boolean "published", default: false t.integer "position" t.text "text" - t.text "description" + t.text "meta_description" t.text "summary" t.index ["research_journal_id"], name: "index_research_journal_papers_on_research_journal_id" t.index ["research_journal_volume_id"], name: "index_research_journal_papers_on_research_journal_volume_id" @@ -603,7 +603,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_01_09_140347) do t.datetime "published_at", precision: nil t.datetime "created_at", null: false t.datetime "updated_at", null: false - t.text "description" + t.text "meta_description" t.text "keywords" t.string "slug" t.string "featured_image_alt" @@ -617,7 +617,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_01_09_140347) do create_table "research_journals", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.string "title" - t.text "description" + t.text "meta_description" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.string "access_token" @@ -642,7 +642,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_01_09_140347) do t.uuid "university_id", null: false t.uuid "research_laboratory_id", null: false t.string "name" - t.text "description" + t.text "meta_description" t.integer "position" t.datetime "created_at", null: false t.datetime "updated_at", null: false @@ -699,7 +699,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_01_09_140347) do t.uuid "university_id", null: false t.string "name" t.string "long_name" - t.text "description" + t.text "meta_description" t.string "address" t.string "zipcode" t.string "city" @@ -732,7 +732,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_01_09_140347) do t.datetime "updated_at", null: false t.string "phone_mobile" t.string "email" - t.text "description" + t.text "meta_description" t.boolean "habilitation", default: false t.boolean "tenure", default: false t.text "biography" diff --git a/test/fixtures/communication/website/posts.yml b/test/fixtures/communication/website/posts.yml index b22a21920..8a2cbd33b 100644 --- a/test/fixtures/communication/website/posts.yml +++ b/test/fixtures/communication/website/posts.yml @@ -3,10 +3,10 @@ # Table name: communication_website_posts # # id :uuid not null, primary key -# description :text # featured_image_alt :string # featured_image_credit :text # github_path :text +# meta_description :text # pinned :boolean default(FALSE) # published :boolean default(FALSE) # published_at :datetime diff --git a/test/fixtures/university/organizations.yml b/test/fixtures/university/organizations.yml index 351f7219f..09c3edddb 100644 --- a/test/fixtures/university/organizations.yml +++ b/test/fixtures/university/organizations.yml @@ -2,27 +2,27 @@ # # Table name: university_organizations # -# id :uuid not null, primary key -# active :boolean default(TRUE) -# address :string -# city :string -# country :string -# description :text -# email :string -# kind :integer default("company") -# long_name :string -# name :string -# nic :string -# phone :string -# siren :string -# slug :string -# summary :text -# text :text -# url :string -# zipcode :string -# created_at :datetime not null -# updated_at :datetime not null -# university_id :uuid not null, indexed +# id :uuid not null, primary key +# active :boolean default(TRUE) +# address :string +# city :string +# country :string +# email :string +# kind :integer default("company") +# long_name :string +# meta_description :text +# name :string +# nic :string +# phone :string +# siren :string +# slug :string +# summary :text +# text :text +# url :string +# zipcode :string +# created_at :datetime not null +# updated_at :datetime not null +# university_id :uuid not null, indexed # # Indexes # diff --git a/test/models/university/organization_test.rb b/test/models/university/organization_test.rb index 04e6d40e7..0de663bac 100644 --- a/test/models/university/organization_test.rb +++ b/test/models/university/organization_test.rb @@ -2,27 +2,27 @@ # # Table name: university_organizations # -# id :uuid not null, primary key -# active :boolean default(TRUE) -# address :string -# city :string -# country :string -# description :text -# email :string -# kind :integer default("company") -# long_name :string -# name :string -# nic :string -# phone :string -# siren :string -# slug :string -# summary :text -# text :text -# url :string -# zipcode :string -# created_at :datetime not null -# updated_at :datetime not null -# university_id :uuid not null, indexed +# id :uuid not null, primary key +# active :boolean default(TRUE) +# address :string +# city :string +# country :string +# email :string +# kind :integer default("company") +# long_name :string +# meta_description :text +# name :string +# nic :string +# phone :string +# siren :string +# slug :string +# summary :text +# text :text +# url :string +# zipcode :string +# created_at :datetime not null +# updated_at :datetime not null +# university_id :uuid not null, indexed # # Indexes # -- GitLab