diff --git a/app/controllers/admin/communication/website/authors_controller.rb b/app/controllers/admin/communication/website/authors_controller.rb index d53ac3ba901cdf99c09e93699e91ee4c0d26f442..83c09f2d0bfa1bd4640d9d618db1635f137173df 100644 --- a/app/controllers/admin/communication/website/authors_controller.rb +++ b/app/controllers/admin/communication/website/authors_controller.rb @@ -15,7 +15,7 @@ class Admin::Communication::Website::AuthorsController < Admin::Communication::W def breadcrumb super - add_breadcrumb Communication::Website::Author.model_name.human(count: 2), + add_breadcrumb t('communication.authors', count: 2), admin_communication_website_authors_path breadcrumb_for @author end diff --git a/app/controllers/admin/education/teachers_controller.rb b/app/controllers/admin/education/teachers_controller.rb index d0df5079ce2b126bcd23237e5da1b6ca8dc9808e..aac641dce130181db9445390570842c5b08096d2 100644 --- a/app/controllers/admin/education/teachers_controller.rb +++ b/app/controllers/admin/education/teachers_controller.rb @@ -34,7 +34,7 @@ class Admin::Education::TeachersController < Admin::Education::ApplicationContro def breadcrumb super - add_breadcrumb Education::Teacher.model_name.human(count: 2), + add_breadcrumb t('education.teachers', count: 2), admin_education_teachers_path breadcrumb_for @teacher end diff --git a/app/controllers/admin/research/researchers_controller.rb b/app/controllers/admin/research/researchers_controller.rb index e8eeec4debc9536d0752286960e479262cf463e4..608248c025a82406a6e0ae0f0977398c1bb37dbe 100644 --- a/app/controllers/admin/research/researchers_controller.rb +++ b/app/controllers/admin/research/researchers_controller.rb @@ -15,7 +15,7 @@ class Admin::Research::ResearchersController < Admin::Research::ApplicationContr def breadcrumb super - add_breadcrumb Research::Researcher.model_name.human(count: 2), + add_breadcrumb t('researcher.researchers', count: 2), admin_research_researchers_path breadcrumb_for @researcher end diff --git a/app/models/ability.rb b/app/models/ability.rb index 72e77c19270bb9dd909780c1e72033853d5d34b3..2f1e93d76a447b288e7de9f3af06b07dba99138d 100644 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -13,6 +13,7 @@ class Ability def visitor can :read, Administration::Qualiopi::Criterion can :read, Administration::Qualiopi::Indicator + can :read, Administration::Member can :read, Communication::Website, university_id: @user.university_id can :read, Communication::Website::Page, university_id: @user.university_id can :read, Communication::Website::Post, university_id: @user.university_id @@ -22,7 +23,6 @@ class Ability can :read, Communication::Website::Imported::Post, university_id: @user.university_id can :read, Education::Program, university_id: @user.university_id can :read, Education::School, university_id: @user.university_id - can :read, Research::Researcher can :read, Research::Journal, university_id: @user.university_id can :read, Research::Journal::Article, university_id: @user.university_id can :read, Research::Journal::Volume, university_id: @user.university_id @@ -32,6 +32,7 @@ class Ability def admin can :read, Administration::Qualiopi::Criterion can :read, Administration::Qualiopi::Indicator + can :manage, Administration::Member can :read, Communication::Website, university_id: @user.university_id can :manage, Communication::Website::Page, university_id: @user.university_id can :manage, Communication::Website::Post, university_id: @user.university_id @@ -43,7 +44,6 @@ class Ability can :manage, Communication::Website::Imported::Page, university_id: @user.university_id can :manage, Communication::Website::Imported::Post, university_id: @user.university_id can :manage, Education::Program, university_id: @user.university_id - can :manage, Research::Researcher can :manage, Research::Journal, university_id: @user.university_id can :manage, Research::Journal::Article, university_id: @user.university_id can :manage, Research::Journal::Volume, university_id: @user.university_id diff --git a/app/models/communication/website.rb b/app/models/communication/website.rb index 3c318cbaee870d2c7afdd7337371d6b7a8107b41..2553b6d9debb529c1fdf0e9fbb680f77b9176cbb 100644 --- a/app/models/communication/website.rb +++ b/app/models/communication/website.rb @@ -47,10 +47,6 @@ class Communication::Website < ApplicationRecord class_name: 'Communication::Website::Category', foreign_key: :communication_website_id, dependent: :destroy - has_many :authors, - class_name: 'Communication::Website::Author', - foreign_key: :communication_website_id, - dependent: :destroy has_many :menus, class_name: 'Communication::Website::Menu', foreign_key: :communication_website_id, diff --git a/app/models/communication/website/author.rb b/app/models/communication/website/author.rb deleted file mode 100644 index fe7a41c2c5efffa36a59c899f530f0efb003f204..0000000000000000000000000000000000000000 --- a/app/models/communication/website/author.rb +++ /dev/null @@ -1,76 +0,0 @@ -# == Schema Information -# -# Table name: communication_website_authors -# -# id :uuid not null, primary key -# first_name :string -# github_path :text -# last_name :string -# slug :string -# created_at :datetime not null -# updated_at :datetime not null -# communication_website_id :uuid not null -# university_id :uuid not null -# user_id :uuid -# -# Indexes -# -# idx_comm_website_authors_on_communication_website_id (communication_website_id) -# index_communication_website_authors_on_university_id (university_id) -# index_communication_website_authors_on_user_id (user_id) -# -# Foreign Keys -# -# fk_rails_... (communication_website_id => communication_websites.id) -# fk_rails_... (university_id => universities.id) -# fk_rails_... (user_id => users.id) -# -class Communication::Website::Author < ApplicationRecord - include WithGithubFiles - include WithSlug - - has_rich_text :biography - - has_one :imported_author, - class_name: 'Communication::Website::Imported::Author', - dependent: :destroy - belongs_to :university - belongs_to :user, optional: true - belongs_to :website, - foreign_key: :communication_website_id - has_many :posts, - class_name: 'Communication::Website::Post', - dependent: :nullify - - validates :slug, uniqueness: { scope: :communication_website_id } - - scope :ordered, -> { order(:last_name, :first_name) } - - def to_s - "#{last_name} #{first_name}" - end - - # Override from WithGithubFiles - def github_path_generated - "#{website.authors_github_directory}/#{slug}.html" - end - - def github_manifest - super << { - identifier: "collection_item", - generated_path: -> { "_data/authors/#{slug}.yml" }, - data: -> (github_file) { ApplicationController.render( - template: "admin/communication/website/authors/jekyll_collection", - formats: [:yml], - layout: false, - assigns: { author: self, github_file: github_file } - ) } - } - end - - protected - - def slug_unavailable?(slug) - self.class.unscoped.where(communication_website_id: self.communication_website_id, slug: slug).where.not(id: self.id).exists? - end -end diff --git a/app/models/communication/website/imported/author.rb b/app/models/communication/website/imported/author.rb index d36eb831d985a99e6fa1e342a33cd2f737d6212d..d88ec753838ada192d0e7d994b0be0404555c667 100644 --- a/app/models/communication/website/imported/author.rb +++ b/app/models/communication/website/imported/author.rb @@ -22,7 +22,7 @@ # # Foreign Keys # -# fk_rails_... (author_id => communication_website_authors.id) +# fk_rails_... (author_id => administration_members.id) # fk_rails_... (university_id => universities.id) # fk_rails_... (website_id => communication_website_imported_websites.id) # @@ -32,7 +32,7 @@ class Communication::Website::Imported::Author < ApplicationRecord belongs_to :website, class_name: 'Communication::Website::Imported::Website' belongs_to :author, - class_name: 'Communication::Website::Author', + class_name: 'Administration::Member', optional: true before_validation :sync diff --git a/app/models/education/teacher.rb b/app/models/education/teacher.rb deleted file mode 100644 index 90519d164795a786188aee24aa3a296890939719..0000000000000000000000000000000000000000 --- a/app/models/education/teacher.rb +++ /dev/null @@ -1,45 +0,0 @@ -# == Schema Information -# -# Table name: education_teachers -# -# id :uuid not null, primary key -# first_name :string -# last_name :string -# slug :string -# created_at :datetime not null -# updated_at :datetime not null -# university_id :uuid not null -# user_id :uuid -# -# Indexes -# -# index_education_teachers_on_university_id (university_id) -# index_education_teachers_on_user_id (user_id) -# -# Foreign Keys -# -# fk_rails_... (university_id => universities.id) -# fk_rails_... (user_id => users.id) -# -class Education::Teacher < ApplicationRecord - include WithGithubFiles - include WithSlug - - has_rich_text :biography - - belongs_to :university - belongs_to :user, optional: true - has_and_belongs_to_many :programs, - class_name: 'Education::Program', - join_table: 'education_programs_teachers', - foreign_key: 'education_teacher_id', - association_foreign_key: 'education_program_id' - has_many :websites, -> { distinct }, through: :programs - - scope :ordered, -> { order(:last_name, :first_name) } - - def to_s - "#{last_name} #{first_name}" - end - -end diff --git a/app/models/research/researcher.rb b/app/models/research/researcher.rb deleted file mode 100644 index 582522b866e8ddfcc24e0a3a3e88253c12bd85e2..0000000000000000000000000000000000000000 --- a/app/models/research/researcher.rb +++ /dev/null @@ -1,40 +0,0 @@ -# == Schema Information -# -# Table name: research_researchers -# -# id :uuid not null, primary key -# first_name :string -# last_name :string -# slug :string -# created_at :datetime not null -# updated_at :datetime not null -# university_id :uuid -# user_id :uuid -# -# Indexes -# -# idx_researcher_university (university_id) -# index_research_researchers_on_user_id (user_id) -# -# Foreign Keys -# -# fk_rails_... (university_id => universities.id) -# fk_rails_... (user_id => users.id) -# -class Research::Researcher < ApplicationRecord - include WithGithubFiles - - has_rich_text :biography - - belongs_to :university - belongs_to :user, optional: true - has_and_belongs_to_many :articles, class_name: 'Research::Journal::Article' - has_many :journals, through: :articles - has_many :websites, -> { distinct }, through: :journals - - scope :ordered, -> { order(:last_name, :first_name) } - - def to_s - "#{ first_name } #{ last_name }" - end -end diff --git a/app/models/user.rb b/app/models/user.rb index 5257ded154caa3dda4a560d12622cd8ccc292b05..43d21694c80e7739cb6672216898b9bee50dffd6 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -60,8 +60,7 @@ class User < ApplicationRecord belongs_to :university belongs_to :language - has_one :researcher, class_name: 'Research::Researcher', dependent: :nullify - has_one :author, class_name: 'Communication::Website::Author', dependent: :nullify + has_one :member, class_name: 'Administration::Member', dependent: :nullify scope :ordered, -> { order(:last_name, :first_name) } diff --git a/app/views/admin/communication/website/authors/index.html.erb b/app/views/admin/communication/website/authors/index.html.erb index 71439e8eff3e3984dd32cddd703ec62760290aaa..47e934231aac9da06e6d919c3acbe633006849d8 100644 --- a/app/views/admin/communication/website/authors/index.html.erb +++ b/app/views/admin/communication/website/authors/index.html.erb @@ -1,4 +1,4 @@ -<% content_for :title, "#{Communication::Website::Author.model_name.human(count: 2)} (#{@authors.total_count})" %> +<% content_for :title, "#{t('communication.authors', count: 2)} (#{@authors.total_count})" %> <%= render 'admin/communication/websites/sidebar' do %> <div class="card"> diff --git a/app/views/admin/communication/websites/_sidebar.html.erb b/app/views/admin/communication/websites/_sidebar.html.erb index eafb88153774ba0448299ca6443edbb161c70c14..a3884070e2aaa6cf1f6ee8e9f877ebad5aeb8ec0 100644 --- a/app/views/admin/communication/websites/_sidebar.html.erb +++ b/app/views/admin/communication/websites/_sidebar.html.erb @@ -25,7 +25,7 @@ path: admin_communication_website_categories_path(website_id: @website) }, { - title: Communication::Website::Author.model_name.human(count: 2), + title: t('communication.authors', count: 2), path: admin_communication_website_authors_path(website_id: @website) }, { diff --git a/app/views/admin/communication/websites/import.html.erb b/app/views/admin/communication/websites/import.html.erb index d32cdcfd0c715a2f1fe84b3d31ba7209f1228117..98e815301ce221486657d54626efe940d6d0614a 100644 --- a/app/views/admin/communication/websites/import.html.erb +++ b/app/views/admin/communication/websites/import.html.erb @@ -111,7 +111,7 @@ <table class="<%= table_classes %>"> <thead> <tr> - <th><%= Communication::Website::Author.human_attribute_name('name') %></th> + <th><%= Administration::Member.human_attribute_name('name') %></th> <th class="text-end" width="150"> </th> </tr> </thead> diff --git a/app/views/admin/communication/websites/show/_authors.html.erb b/app/views/admin/communication/websites/show/_authors.html.erb index ff6bf3f1e64c8238454cd823fc9a2ccca2e5cff0..0953a1a4149fcb6a19a65326e92c6f6668d405cc 100644 --- a/app/views/admin/communication/websites/show/_authors.html.erb +++ b/app/views/admin/communication/websites/show/_authors.html.erb @@ -7,7 +7,7 @@ </div> <h2 class="card-title"> <%= link_to admin_communication_website_authors_path(website_id: @website) do %> - <%= Communication::Website::Author.model_name.human(count: 2) %> + <%= t('communication.authors', count: 2) %> <small> - <%= t('communication.website.see_all', number: @website.authors.count) %> diff --git a/app/views/admin/education/teachers/_list.html.erb b/app/views/admin/education/teachers/_list.html.erb index dd77f12486fdb0c7a3b3ad7a21cad2b4bf1f5734..ec41239ac10899b7f6e144c42ee2e38f62448cd7 100644 --- a/app/views/admin/education/teachers/_list.html.erb +++ b/app/views/admin/education/teachers/_list.html.erb @@ -1,7 +1,7 @@ <table class="<%= table_classes %>"> <thead> <tr> - <th><%= Education::Teacher.human_attribute_name('name') %></th> + <th><%= Administration::Member.human_attribute_name('name') %></th> <th></th> </tr> </thead> diff --git a/app/views/admin/education/teachers/index.html.erb b/app/views/admin/education/teachers/index.html.erb index a539fb8836be60b31e18644cb6cb4e6c99ad92b6..70d6d6ebc2fa0e5c81e234e542a61bd4046c9514 100644 --- a/app/views/admin/education/teachers/index.html.erb +++ b/app/views/admin/education/teachers/index.html.erb @@ -1,4 +1,4 @@ -<% content_for :title, "#{Education::Teacher.model_name.human(count: 2)} (#{@teachers.total_count})" %> +<% content_for :title, "#{t('education.teachers', count: 2)} (#{@teachers.total_count})" %> <%= render 'admin/education/teachers/list', teachers: @teachers %> diff --git a/app/views/admin/research/researchers/index.html.erb b/app/views/admin/research/researchers/index.html.erb index a5a7053184e40d408d3817e0a8cb97f87e5fd3e0..eb0e7bb1d8298cb326262210814682bd7241c04e 100644 --- a/app/views/admin/research/researchers/index.html.erb +++ b/app/views/admin/research/researchers/index.html.erb @@ -1,4 +1,4 @@ -<% content_for :title, Research::Researcher.model_name.human(count: 2) %> +<% content_for :title, t('researcher.researchers', count: 2) %> <table class="table"> <thead> diff --git a/config/admin_navigation.rb b/config/admin_navigation.rb index 4ff4e4eb8051d8a3c2da4d346e17c799fe1201be..39ef3a21a0a3649d3fdd43b5eeb226a68e22fd90 100644 --- a/config/admin_navigation.rb +++ b/config/admin_navigation.rb @@ -8,16 +8,16 @@ SimpleNavigation::Configuration.run do |navigation| if can?(:read, Education::Program) primary.item :education, Education.model_name.human, nil, { kind: :header } - primary.item :education, Education::Teacher.model_name.human(count: 2), admin_education_teachers_path, { icon: 'user-graduate' } + primary.item :education, t('education.teachers', count: 2), admin_education_teachers_path, { icon: 'user-graduate' } if can?(:read, Administration::Member) primary.item :education, Education::School.model_name.human(count: 2), admin_education_schools_path, { icon: 'university' } if can?(:read, Education::School) primary.item :education_programs, Education::Program.model_name.human(count: 2), admin_education_programs_path, { icon: 'graduation-cap' } if can?(:read, Education::Program) primary.item :education, 'Ressources éducatives', nil, { icon: 'laptop' } primary.item :education, 'Feedbacks', nil, { icon: 'comments' } end - if can?(:read, Research::Researcher) || can?(:read, Research::Journal) + if can?(:read, Research::Journal) primary.item :research, Research.model_name.human, nil, { kind: :header } - primary.item :research_researchers, Research::Researcher.model_name.human(count: 2), admin_research_researchers_path(journal_id: nil), { icon: 'microscope' } if can?(:read, Research::Researcher) + primary.item :research_researchers, t('research.researchers', count: 2), admin_research_researchers_path(journal_id: nil), { icon: 'microscope' } if can?(:read, Administration::Member) primary.item :research, 'Laboratoires', nil, { icon: 'flask' } primary.item :research, 'Veille', nil, { icon: 'eye' } primary.item :research_journals, Research::Journal.model_name.human(count: 2), admin_research_journals_path, { icon: 'newspaper' } if can?(:read, Research::Journal) diff --git a/config/locales/communication/en.yml b/config/locales/communication/en.yml index 028fe052c7853bc5885ea9e9387a0ce0ebe9ec48..c7dc5a884fb6bcceb7a249de98826ba3a3c680f8 100644 --- a/config/locales/communication/en.yml +++ b/config/locales/communication/en.yml @@ -1,25 +1,4 @@ en: - communication: - manage_authors: Manage authors - number_of_posts: Nunber of posts - website: - force_publication: 'Force publication' - imported: - from: Imported from - launch: Launch import - launched: Import in progress - original_url: Original URL - media: - file_size: File size - not_imported_yet: Not imported yet - refresh: Refresh import - show: Show import - pending: Import in progress - last_pages: Last pages - last_posts: Last posts - posts: - new_curation: New curation - see_all: See the full list (%{number} elements) activemodel: models: communication: Communication @@ -121,6 +100,30 @@ en: text: Text title: Title website: Website + communication: + authors: + one: Author + other: Authors + manage_authors: Manage authors + number_of_posts: Nunber of posts + website: + force_publication: 'Force publication' + imported: + from: Imported from + launch: Launch import + launched: Import in progress + original_url: Original URL + media: + file_size: File size + not_imported_yet: Not imported yet + refresh: Refresh import + show: Show import + pending: Import in progress + last_pages: Last pages + last_posts: Last posts + posts: + new_curation: New curation + see_all: See the full list (%{number} elements) enums: communication/website/menu/item: kind: diff --git a/config/locales/communication/fr.yml b/config/locales/communication/fr.yml index 36196b318506387a5369b9d3edc2a1b879150742..80b8097fbcace9f0a7606f2c9b471660af7809c5 100644 --- a/config/locales/communication/fr.yml +++ b/config/locales/communication/fr.yml @@ -1,25 +1,4 @@ fr: - communication: - manage_authors: Gérer les auteurs - number_of_posts: Nombre d'actualités - website: - force_publication: 'Forcer la publication' - imported: - from: Importé depuis - launch: Importer le site - launched: Importation en cours - original_url: URL originale - media: - file_size: Taille du fichier - not_imported_yet: Non importé pour le moment - refresh: Relancer l'import - show: Voir l'import - pending: Import en cours - last_pages: Dernières pages - last_posts: Dernières actualités - posts: - new_curation: Nouvelle curation - see_all: Voir la liste complète (%{number} éléments) activemodel: models: communication: Communication @@ -28,9 +7,6 @@ fr: communication/website: one: Site Web other: Sites Web - communication/website/author: - one: Auteur·rice - other: Auteur·rice·s communication/website/category: one: Catégorie other: Catégories @@ -68,13 +44,6 @@ fr: programs_github_directory: Dossier GitHub des formations staff_github_directory: Dossier GitHub de l'équipe url: URL - communication/website/author: - biography: Biographie - first_name: Prénom - last_name: Nom de famille - name: Nom - slug: Slug - user: Utilisateur communication/website/category: children: Catégories enfants description: Description @@ -121,6 +90,30 @@ fr: text: Texte title: Titre website: Site Web + communication: + authors: + one: Auteur·rice + other: Auteur·rice·s + manage_authors: Gérer les auteur·rice·s + number_of_posts: Nombre d'actualités + website: + force_publication: 'Forcer la publication' + imported: + from: Importé depuis + launch: Importer le site + launched: Importation en cours + original_url: URL originale + media: + file_size: Taille du fichier + not_imported_yet: Non importé pour le moment + refresh: Relancer l'import + show: Voir l'import + pending: Import en cours + last_pages: Dernières pages + last_posts: Dernières actualités + posts: + new_curation: Nouvelle curation + see_all: Voir la liste complète (%{number} éléments) enums: communication/website/menu/item: kind: diff --git a/config/locales/education/en.yml b/config/locales/education/en.yml index 6489af0985fa5c45716b9f914dcf4d6fed32650f..375f0b15167ab86051b660f30f0291e8fdc16c69 100644 --- a/config/locales/education/en.yml +++ b/config/locales/education/en.yml @@ -10,9 +10,6 @@ en: education/school: one: School other: Schools - education/teacher: - one: Teacher - other: Teachers attributes: education/program: accessibility: Accessibilité @@ -42,14 +39,6 @@ en: programs: Programs provided websites: Associated websites zipcode: Zipcode - education/teacher: - biography: Biography - first_name: First name - last_name: Last name - name: Name - programs: Programs done - slug: Slug - user: User education: manage_teachers: Manage teachers number_of_programs: Number of programs @@ -57,6 +46,9 @@ en: educational_informations: Educational informations main_informations: Main informations useful_informations: Useful informations + teachers: + one: Teacher + other: Teachers enums: education/program: level: diff --git a/config/locales/education/fr.yml b/config/locales/education/fr.yml index 36bd3a02a07d12fab1e9835249ed92d424ef6603..edf5d22d099581f1792be1ba007ff54131a1ca28 100644 --- a/config/locales/education/fr.yml +++ b/config/locales/education/fr.yml @@ -10,9 +10,6 @@ fr: education/school: one: École other: Écoles - education/teacher: - one: Enseignant·e - other: Enseignants·es attributes: education/program: accessibility: Accessibilité @@ -42,14 +39,6 @@ fr: programs: Formations dispensées websites: Sites webs associés zipcode: Code postal - education/teacher: - biography: Biographie - first_name: Prénom - last_name: Nom de famille - name: Nom - programs: Formations assurées - slug: Slug - user: Utilisateur education: manage_teachers: Gérer les Enseignants·es number_of_programs: Nombre de formations @@ -57,7 +46,9 @@ fr: educational_informations: Informations pédagogiques main_informations: Informations essentielles useful_informations: Informations pratiques - + teachers: + one: Enseignant·e + other: Enseignants·es enums: education/program: level: diff --git a/config/locales/research/en.yml b/config/locales/research/en.yml index c6770e1d7d831198571ee7bce9f0608a5e1538ce..43651a895ebeddb2a5a0e6c3c0bc9c4b292d4549 100644 --- a/config/locales/research/en.yml +++ b/config/locales/research/en.yml @@ -1,7 +1,4 @@ en: - research: - manage_researchers: Managege researchers - number_of_articles: Number of articles activemodel: models: research: Research @@ -16,9 +13,6 @@ en: research/journal/volume: one: Volume other: Volumes - research/researcher: - one: Researcher - other: Researchers attributes: research/journal: issn: ISSN @@ -39,11 +33,12 @@ en: number: Number published_at: Published at title: Title - research/researcher: - biography: Biography - first_name: First name - last_name: Last name - user: User + research: + manage_researchers: Managege researchers + number_of_articles: Number of articles + researchers: + one: Researcher + other: Researchers simple_form: hints: research_journal_volume: diff --git a/config/locales/research/fr.yml b/config/locales/research/fr.yml index 6a2a44920fb42d5b6ebc7af3a4b7a4751b3b8a01..345543bf2823ad464aa6b653c53ef2504db5d945 100644 --- a/config/locales/research/fr.yml +++ b/config/locales/research/fr.yml @@ -1,7 +1,4 @@ fr: - research: - manage_researchers: Gérer les Chercheu·rs·ses - number_of_articles: Nombre d'articles activemodel: models: research: Recherche @@ -16,9 +13,6 @@ fr: research/journal/volume: one: Volumes other: Volumes - research/researcher: - one: Chercheu·r·se - other: Chercheu·rs·ses attributes: research/journal: issn: ISSN @@ -39,11 +33,12 @@ fr: number: Numéro published_at: Publié le title: Titre - research/researcher: - biography: Biographie - first_name: Prénom - last_name: Nom - user: Utilisateur + research: + manage_researchers: Gérer les Chercheu·rs·ses + number_of_articles: Nombre d'articles + researchers: + one: Chercheu·r·se + other: Chercheu·rs·ses simple_form: hints: research_journal_volume: diff --git a/db/migrate/20211215133833_remove_unused_models.rb b/db/migrate/20211215133833_remove_unused_models.rb new file mode 100644 index 0000000000000000000000000000000000000000..41ea43ca5b7b8ce4fb8c4e5243b777f1f0598578 --- /dev/null +++ b/db/migrate/20211215133833_remove_unused_models.rb @@ -0,0 +1,10 @@ +class RemoveUnusedModels < ActiveRecord::Migration[6.1] + def change + remove_foreign_key :communication_website_imported_authors, column: :author_id + add_foreign_key :communication_website_imported_authors, :administration_members, column: :author_id + + drop_table :education_teachers + drop_table :research_researchers + drop_table :communication_website_authors + end +end diff --git a/db/schema.rb b/db/schema.rb index 9de4c35f0e1169c6bee99191ae28f60a47ab7d87..f88c9b41c37d28762bfca286dd472f0b97d747c5 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.define(version: 2021_12_15_110752) do +ActiveRecord::Schema.define(version: 2021_12_15_133833) do # These are extensions that must be enabled in order to support this database enable_extension "pgcrypto" @@ -96,21 +96,6 @@ ActiveRecord::Schema.define(version: 2021_12_15_110752) do t.index ["criterion_id"], name: "index_administration_qualiopi_indicators_on_criterion_id" end - create_table "communication_website_authors", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| - t.uuid "university_id", null: false - t.uuid "user_id" - t.uuid "communication_website_id", null: false - t.string "last_name" - t.string "first_name" - t.string "slug" - t.datetime "created_at", precision: 6, null: false - t.datetime "updated_at", precision: 6, null: false - t.text "github_path" - t.index ["communication_website_id"], name: "idx_comm_website_authors_on_communication_website_id" - t.index ["university_id"], name: "index_communication_website_authors_on_university_id" - t.index ["user_id"], name: "index_communication_website_authors_on_user_id" - end - create_table "communication_website_categories", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.uuid "communication_website_id", null: false @@ -420,18 +405,6 @@ ActiveRecord::Schema.define(version: 2021_12_15_110752) do t.index ["university_id"], name: "index_education_schools_on_university_id" end - create_table "education_teachers", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| - t.uuid "university_id", null: false - t.string "first_name" - t.string "last_name" - t.string "slug" - t.uuid "user_id" - t.datetime "created_at", precision: 6, null: false - t.datetime "updated_at", precision: 6, null: false - t.index ["university_id"], name: "index_education_teachers_on_university_id" - t.index ["user_id"], name: "index_education_teachers_on_user_id" - end - create_table "languages", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.string "name" t.string "iso_code" @@ -493,18 +466,6 @@ ActiveRecord::Schema.define(version: 2021_12_15_110752) do t.index ["university_id"], name: "index_research_journals_on_university_id" end - create_table "research_researchers", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| - t.string "first_name" - t.string "last_name" - t.uuid "user_id" - t.datetime "created_at", precision: 6, null: false - t.datetime "updated_at", precision: 6, null: false - t.uuid "university_id" - t.string "slug" - t.index ["university_id"], name: "idx_researcher_university" - t.index ["user_id"], name: "index_research_researchers_on_user_id" - end - create_table "universities", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.string "name" t.string "identifier" @@ -568,9 +529,6 @@ ActiveRecord::Schema.define(version: 2021_12_15_110752) do add_foreign_key "administration_members", "universities" add_foreign_key "administration_members", "users" add_foreign_key "administration_qualiopi_indicators", "administration_qualiopi_criterions", column: "criterion_id" - add_foreign_key "communication_website_authors", "communication_websites" - add_foreign_key "communication_website_authors", "universities" - add_foreign_key "communication_website_authors", "users" add_foreign_key "communication_website_categories", "communication_website_categories", column: "parent_id" add_foreign_key "communication_website_categories", "communication_websites" add_foreign_key "communication_website_categories", "education_programs", column: "program_id" @@ -578,7 +536,7 @@ ActiveRecord::Schema.define(version: 2021_12_15_110752) do add_foreign_key "communication_website_github_files", "communication_websites", column: "website_id" add_foreign_key "communication_website_homes", "communication_websites" add_foreign_key "communication_website_homes", "universities" - add_foreign_key "communication_website_imported_authors", "communication_website_authors", column: "author_id" + add_foreign_key "communication_website_imported_authors", "administration_members", column: "author_id" add_foreign_key "communication_website_imported_authors", "communication_website_imported_websites", column: "website_id" add_foreign_key "communication_website_imported_authors", "universities" add_foreign_key "communication_website_imported_categories", "communication_website_categories", column: "category_id" @@ -614,8 +572,6 @@ ActiveRecord::Schema.define(version: 2021_12_15_110752) do add_foreign_key "education_programs", "universities" add_foreign_key "education_programs_teachers", "administration_members", column: "education_teacher_id" add_foreign_key "education_schools", "universities" - add_foreign_key "education_teachers", "universities" - add_foreign_key "education_teachers", "users" add_foreign_key "research_journal_articles", "research_journal_volumes" add_foreign_key "research_journal_articles", "research_journals" add_foreign_key "research_journal_articles", "universities" @@ -625,8 +581,6 @@ ActiveRecord::Schema.define(version: 2021_12_15_110752) do add_foreign_key "research_journal_volumes", "research_journals" add_foreign_key "research_journal_volumes", "universities" add_foreign_key "research_journals", "universities" - add_foreign_key "research_researchers", "universities" - add_foreign_key "research_researchers", "users" add_foreign_key "users", "languages" add_foreign_key "users", "universities" end