diff --git a/app/controllers/admin/communication/websites_controller.rb b/app/controllers/admin/communication/websites_controller.rb index 99bd27a0e9cc62633547d714daa14247e092d1a8..eb6ef821b7142d8fdff309e18b0f8a489c84a388 100644 --- a/app/controllers/admin/communication/websites_controller.rb +++ b/app/controllers/admin/communication/websites_controller.rb @@ -73,9 +73,10 @@ class Admin::Communication::WebsitesController < Admin::Communication::Applicati def website_params params.require(:communication_website).permit( :name, :url, :repository, :access_token, :about_type, :about_id, - :authors_github_directory, :posts_github_directory, :programs_github_directory, - :research_articles_github_directory, :research_volumes_github_directory, - :staff_github_directory + :static_pathname_posts, :static_pathname_programs, + :static_pathname_research_articles, :static_pathname_research_volumes, + :static_pathname_staff, :static_pathname_administrators, :static_pathname_authors, + :static_pathname_researchers, :static_pathname_teachers ) end end diff --git a/app/controllers/admin/education/program/role/people_controller.rb b/app/controllers/admin/education/program/role/people_controller.rb index 6202bf3e80f4bf070433fb13bcb5163d4688596b..bf9002f61b718b77f33eaf9f5d43a5b370e26624 100644 --- a/app/controllers/admin/education/program/role/people_controller.rb +++ b/app/controllers/admin/education/program/role/people_controller.rb @@ -2,7 +2,9 @@ class Admin::Education::Program::Role::PeopleController < Admin::Education::Prog load_and_authorize_resource :role, class: Education::Program::Role, through: :program load_and_authorize_resource class: Education::Program::Role::Person, through: :role - include Admin::Reorderable + before_action :get_available_people, except: :destroy + + include Admin::Reorderable def new breadcrumb @@ -24,6 +26,11 @@ class Admin::Education::Program::Role::PeopleController < Admin::Education::Prog protected + def get_available_people + used_person_ids = @role.people.where.not(id: @person.id).pluck(:person_id) + @available_people = current_university.people.where.not(id: used_person_ids).accessible_by(current_ability).ordered + end + def breadcrumb super add_breadcrumb Education::Program::Role.model_name.human(count: 2) diff --git a/app/controllers/admin/education/program/teachers_controller.rb b/app/controllers/admin/education/program/teachers_controller.rb index ab3cb3f3eed5e2f491c51c673fd6cfd39c902940..52d7085d53b763e28311db97fbfe040db9a152cc 100644 --- a/app/controllers/admin/education/program/teachers_controller.rb +++ b/app/controllers/admin/education/program/teachers_controller.rb @@ -1,6 +1,8 @@ class Admin::Education::Program::TeachersController < Admin::Education::Program::ApplicationController load_and_authorize_resource class: Education::Program::Teacher, through: :program + before_action :get_teachers, except: :destroy + def new breadcrumb end @@ -36,6 +38,11 @@ class Admin::Education::Program::TeachersController < Admin::Education::Program: protected + def get_teachers + used_teacher_ids = @program.teachers.where.not(id: @teacher.id).pluck(:person_id) + @teachers = current_university.people.teachers.where.not(id: used_teacher_ids).accessible_by(current_ability).ordered + end + def breadcrumb super add_breadcrumb Education::Program::Teacher.model_name.human(count: 2) diff --git a/app/models/ability.rb b/app/models/ability.rb index 63cb0f45470d8967614809321d9e345e12ea2a3d..5829446e32b2bd938a56afeac09db7374d86f5c3 100644 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -29,6 +29,18 @@ class Ability can :read, User, university_id: @user.university_id end + def teacher + can :manage, University::Person, user_id: @user.id + can :read, Education::Program, university_id: @user.university_id + can :manage, Education::Program::Teacher, person_id: @user.person&.id + can :read, Education::Program::Role, university_id: @user.university_id + can :manage, Education::Program::Role::Person, person_id: @user.person&.id + end + + def program_manager + + end + def admin can :read, Administration::Qualiopi::Criterion can :read, Administration::Qualiopi::Indicator @@ -44,6 +56,8 @@ 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, Education::Program::Role, university_id: @user.university_id + can :manage, Education::Program::Role::Person, university_id: @user.university_id 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 0d5fa3e254bfadee90e67b4416164848961f13b2..319cf59aace7406462143ac31936a939a64fdab7 100644 --- a/app/models/communication/website.rb +++ b/app/models/communication/website.rb @@ -2,22 +2,25 @@ # # Table name: communication_websites # -# id :uuid not null, primary key -# about_type :string -# access_token :string -# authors_github_directory :string default("authors") -# name :string -# posts_github_directory :string default("posts") -# programs_github_directory :string default("programs") -# repository :string -# research_articles_github_directory :string default("articles") -# research_volumes_github_directory :string default("volumes") -# staff_github_directory :string default("staff") -# url :string -# created_at :datetime not null -# updated_at :datetime not null -# about_id :uuid -# university_id :uuid not null +# id :uuid not null, primary key +# about_type :string +# access_token :string +# name :string +# repository :string +# static_pathname_administrators :string default("administrators") +# static_pathname_authors :string default("authors") +# static_pathname_posts :string default("posts") +# static_pathname_programs :string default("programs") +# static_pathname_research_articles :string default("articles") +# static_pathname_research_volumes :string default("volumes") +# static_pathname_researchers :string default("researchers") +# static_pathname_staff :string default("staff") +# static_pathname_teachers :string default("teachers") +# url :string +# created_at :datetime not null +# updated_at :datetime not null +# about_id :uuid +# university_id :uuid not null # # Indexes # diff --git a/app/models/communication/website/menu/item.rb b/app/models/communication/website/menu/item.rb index 707c9f7bf940aa34ea0243e95fa70cebda540ff1..59e88b4c343a399e044d25b59420e58e94692a73 100644 --- a/app/models/communication/website/menu/item.rb +++ b/app/models/communication/website/menu/item.rb @@ -57,6 +57,10 @@ class Communication::Website::Menu::Item < ApplicationRecord news_category: 41, news_article: 42, staff: 50, + administrators: 51, + authors: 52, + researchers: 53, + teachers: 54, research_volumes: 60, research_volume: 61, research_articles: 62, @@ -77,24 +81,34 @@ class Communication::Website::Menu::Item < ApplicationRecord case self.kind when 'url' target = url - when 'page', 'news_article' - target = about.path if about&.published_at + when 'page' + target = about.path if about&.published when 'programs' - target = "/#{website.programs_github_directory}" if website.programs.any? + target = "/#{website.static_pathname_programs}" if website.programs.any? when 'program' - target = "/#{website.programs_github_directory}#{about.path}" if website.about_school? + target = "/#{website.static_pathname_programs}#{about.path}" if website.about_school? when 'news' - target = "/#{website.posts_github_directory}" if website.posts.published.any? + target = "/#{website.static_pathname_posts}" if website.posts.published.any? + when 'news_article' + target = "/#{website.static_pathname_posts}#{about.path}" if about&.published_at when 'staff' - target = "/#{website.staff_github_directory}" if website.people.any? + target = "/#{website.static_pathname_staff}" if website.people.any? + when 'administrators' + target = "/#{website.static_pathname_administrators}" if website.university_people_through_administrators.any? + when 'authors' + target = "/#{website.static_pathname_authors}" if website.authors.compact.any? + when 'researchers' + target = "/#{website.static_pathname_researchers}" if website.research_articles.collect(&:researchers).flatten.any? + when 'teachers' + target = "/#{website.static_pathname_teachers}" if website.programs.collect(&:university_people_through_teachers).flatten.any? when 'research_volumes' - target = "/#{website.research_volumes_github_directory}" if website.research_volumes.published.any? + target = "/#{website.static_pathname_research_volumes}" if website.research_volumes.published.any? when 'research_volume' - target = "/#{website.research_volumes_github_directory}#{about.path}" if about&.published_at + target = "/#{website.static_pathname_research_volumes}#{about.path}" if about&.published_at when 'research_articles' - target = "/#{website.research_articles_github_directory}" if website.research_articles.published.any? + target = "/#{website.static_pathname_research_articles}" if website.research_articles.published.any? when 'research_article' - target = "/#{website.research_articles_github_directory}#{about.path}" if about&.published_at + target = "/#{website.static_pathname_research_articles}#{about.path}" if about&.published_at when 'blank' target = '' else diff --git a/app/models/communication/website/post.rb b/app/models/communication/website/post.rb index 353e781e24be9ebcc021fa2e50d9c15ef1038dce..693b64bc55caf159f0a4cdfc264c06503d4cd05c 100644 --- a/app/models/communication/website/post.rb +++ b/app/models/communication/website/post.rb @@ -65,7 +65,7 @@ class Communication::Website::Post < ApplicationRecord def path # used in menu_item#static_target - "/#{website.posts_github_directory}/#{published_at.strftime "%Y/%m/%d"}/#{slug}/" + "/#{published_at.strftime "%Y/%m/%d"}/#{slug}" end def git_path(website) diff --git a/app/models/communication/website/with_abouts.rb b/app/models/communication/website/with_abouts.rb index 79bae2de7c73ba8329426f3b928024439fbbc74f..0f2a83d0601ca62954eae31f1f475ca58f4e1fb0 100644 --- a/app/models/communication/website/with_abouts.rb +++ b/app/models/communication/website/with_abouts.rb @@ -65,8 +65,8 @@ module Communication::Website::WithAbouts people += research_articles.collect(&:researchers).flatten people += research_articles.collect(&:researchers).flatten.map(&:researcher) end + people.uniq.compact end - people.uniq.compact end def set_programs_categories! diff --git a/app/models/user/with_roles.rb b/app/models/user/with_roles.rb index 2853b84432441b8b2156e8447d0cf11dc03df2c6..84fb51a7d8304eb19685f7a6aebcbe78ab525e5c 100644 --- a/app/models/user/with_roles.rb +++ b/app/models/user/with_roles.rb @@ -4,7 +4,7 @@ module User::WithRoles included do attr_accessor :modified_by - enum role: { visitor: 0, admin: 20, server_admin: 30 } + enum role: { visitor: 0, teacher: 10, program_manager: 12, admin: 20, server_admin: 30 } scope :for_role, -> (role) { where(role: role) } diff --git a/app/views/admin/communication/websites/_form.html.erb b/app/views/admin/communication/websites/_form.html.erb index 0b2a65e53b3727248e894c8551de8edfd3eb858b..124af3265697b9a2894aefe7a31395464874c392 100644 --- a/app/views/admin/communication/websites/_form.html.erb +++ b/app/views/admin/communication/websites/_form.html.erb @@ -28,21 +28,54 @@ </div> </div> </div> - <div class="col-md-4"> + <div class="col-md-8"> <div class="card flex-fill w-100"> <div class="card-header"> <h5 class="card-title mb-0"><%= t('metadata') %></h5> </div> <div class="card-body"> <%= f.input :url %> - <%= f.input :repository %> - <%= f.input :access_token %> - <%= f.input :authors_github_directory %> - <%= f.input :posts_github_directory %> - <%= f.input :programs_github_directory %> - <%= f.input :research_articles_github_directory %> - <%= f.input :research_volumes_github_directory %> - <%= f.input :staff_github_directory %> + + <p><strong><%= t('communication.website.git') %></strong></p> + <div class="row"> + <div class="col-md-6"> + <%= f.input :repository %> + </div> + <div class="col-md-6"> + <%= f.input :access_token %> + </div> + </div> + + <p><strong><%= t('communication.website.static_pathnames') %></strong></p> + <div class="row"> + <div class="col-md-6"> + <%= f.input :static_pathname_posts %> + </div> + <div class="col-md-6"> + <%= f.input :static_pathname_programs %> + </div> + <div class="col-md-6"> + <%= f.input :static_pathname_research_articles %> + </div> + <div class="col-md-6"> + <%= f.input :static_pathname_research_volumes %> + </div> + <div class="col-md-6"> + <%= f.input :static_pathname_staff %> + </div> + <div class="col-md-6"> + <%= f.input :static_pathname_administrators %> + </div> + <div class="col-md-6"> + <%= f.input :static_pathname_authors %> + </div> + <div class="col-md-6"> + <%= f.input :static_pathname_researchers %> + </div> + <div class="col-md-6"> + <%= f.input :static_pathname_teachers %> + </div> + </div> </div> </div> </div> diff --git a/app/views/admin/education/program/role/people/new.html.erb b/app/views/admin/education/program/role/people/new.html.erb index 402d1727d98c843d5b6807ec06bdd7d73a1f607b..d2a7ac69768b51844a88ea8619cf00ff449dd98e 100644 --- a/app/views/admin/education/program/role/people/new.html.erb +++ b/app/views/admin/education/program/role/people/new.html.erb @@ -8,8 +8,7 @@ <h5 class="card-title mb-0"><%= t('admin.infos') %></h5> </div> <div class="card-body"> - <% used_person_ids = @role.people.where.not(id: @person.id).pluck(:person_id) %> - <%= f.association :person, collection: current_university.people.where.not(id: used_person_ids).ordered %> + <%= f.association :person, collection: @available_people %> </div> </div> </div> diff --git a/app/views/admin/education/program/roles/_list.html.erb b/app/views/admin/education/program/roles/_list.html.erb index 0a152d39a6e3204e32b1a026dbf9830b714074aa..c4465b6573d625c4e5fee70a81ee2240a26b8f47 100644 --- a/app/views/admin/education/program/roles/_list.html.erb +++ b/app/views/admin/education/program/roles/_list.html.erb @@ -20,12 +20,12 @@ <div class="btn-group" role="group"> <%= link_to t('edit'), edit_admin_education_program_role_path(role, { program_id: @program.id }), - class: button_classes %> + class: button_classes if can?(:edit, role) %> <%= link_to t('delete'), admin_education_program_role_path(role, { program_id: @program.id }), method: :delete, data: { confirm: t('please_confirm') }, - class: button_classes_danger %> + class: button_classes_danger if can?(:destroy, role) %> </div> </td> </tr> diff --git a/app/views/admin/education/program/roles/show.html.erb b/app/views/admin/education/program/roles/show.html.erb index 051d0859a6b646ee517b4ced7cfab8b9568fae08..09d1438bae5ebeb50909afb7c2d79e657036ada7 100644 --- a/app/views/admin/education/program/roles/show.html.erb +++ b/app/views/admin/education/program/roles/show.html.erb @@ -18,8 +18,10 @@ <h2 class="card-title mb-0 h5"><%= Education::Program::Role.human_attribute_name('people') %></h2> </div> <div class="card-body"> - <p><%= link_to t('create'), new_admin_education_program_role_person_path(role_id: @role.id), class: 'btn btn-primary' %></p> <%= render 'admin/education/program/role/people/list', people: @role.people.includes(:person).ordered %> + <% if can? :create, Education::Program::Role::Person %> + <p><%= link_to t('create'), new_admin_education_program_role_person_path(role_id: @role.id), class: 'btn btn-primary' %></p> + <% end %> </div> </div> </div> diff --git a/app/views/admin/education/program/teachers/_form.html.erb b/app/views/admin/education/program/teachers/_form.html.erb index 503032b23e866226f69cd4455e81ada146777148..31950531cded62732c883007d24af5dd0f8a7685 100644 --- a/app/views/admin/education/program/teachers/_form.html.erb +++ b/app/views/admin/education/program/teachers/_form.html.erb @@ -6,8 +6,7 @@ <div class="card-body"> <div class="row"> <div class="col-md-6"> - <% used_teacher_ids = @program.teachers.where.not(id: teacher.id).pluck(:person_id) %> - <%= f.association :person, collection: current_university.people.teachers.where.not(id: used_teacher_ids).ordered %> + <%= f.association :person, collection: @teachers %> </div> <div class="col-md-6"> <%= f.input :description, as: :string %> diff --git a/app/views/admin/education/program/teachers/_list.html.erb b/app/views/admin/education/program/teachers/_list.html.erb index 5fb075887d0d93c3106f82133c7e966076b70fc1..cc7d9c17b4e0f0bd685a4fc0525771250f30610f 100644 --- a/app/views/admin/education/program/teachers/_list.html.erb +++ b/app/views/admin/education/program/teachers/_list.html.erb @@ -20,12 +20,12 @@ <div class="btn-group" role="group"> <%= link_to t('edit'), edit_admin_education_program_teacher_path(teacher, { program_id: @program.id }), - class: button_classes %> + class: button_classes if can? :update, teacher.person %> <%= link_to t('delete'), admin_education_program_teacher_path(teacher, { program_id: @program.id }), method: :delete, data: { confirm: t('please_confirm') }, - class: button_classes_danger %> + class: button_classes_danger if can? :update, teacher.person %> </div> </td> </tr> diff --git a/app/views/admin/education/programs/_list.html.erb b/app/views/admin/education/programs/_list.html.erb index 1694c7d619ccb23bfe2a7a014ca9389df7287e02..0aa706121699f7dc97becf241a58eebc82096b56 100644 --- a/app/views/admin/education/programs/_list.html.erb +++ b/app/views/admin/education/programs/_list.html.erb @@ -15,12 +15,12 @@ <div class="btn-group" role="group"> <%= link_to t('edit'), edit_admin_education_program_path(program), - class: button_classes %> + class: button_classes if can?(:update, program) %> <%= link_to t('delete'), admin_education_program_path(program), method: :delete, data: { confirm: program.children.any? ? t('please_confirm_with_children') : t('please_confirm') }, - class: button_classes_danger %> + class: button_classes_danger if can?(:destroy, program) %> </div> </td> </tr> diff --git a/app/views/admin/education/programs/show.html.erb b/app/views/admin/education/programs/show.html.erb index 1cd1e48366ec359e093e45b81427d2f86153ef34..4ebd03b90caa3aa1586b5ea5b0ac6d798ec67e58 100644 --- a/app/views/admin/education/programs/show.html.erb +++ b/app/views/admin/education/programs/show.html.erb @@ -123,7 +123,7 @@ <div class="col-md-6"> <h3 class="h5"><%= Education::Program.human_attribute_name('roles') %></h3> <%= render 'admin/education/program/roles/list', roles: @program.roles.ordered %> - <%= link_to t('create'), new_admin_education_program_role_path(program_id: @program.id), class: button_classes %> + <%= link_to t('create'), new_admin_education_program_role_path(program_id: @program.id), class: button_classes if can?(:create, Education::Program::Role) %> </div> <div class="col-md-6"> <h3 class="h5"><%= Education::Program.human_attribute_name('teachers') %></h3> diff --git a/app/views/admin/education/programs/static.html.erb b/app/views/admin/education/programs/static.html.erb index 45cfd5d1e6e8b8c559070711ffdf005179425468..505c7a206bfa7aefb738391ca926a37e7660a1e7 100644 --- a/app/views/admin/education/programs/static.html.erb +++ b/app/views/admin/education/programs/static.html.erb @@ -1,7 +1,7 @@ --- title: > <%= @program.name %> -url: /<%= @website.programs_github_directory %><%= @program.path %>/ +url: /<%= @website.static_pathname_programs %><%= @program.path %>/ description: > <%= prepare_text_for_static @program.description %> position: <%= @program.position %> diff --git a/app/views/admin/research/journal/articles/static.html.erb b/app/views/admin/research/journal/articles/static.html.erb index 5899fe017b2647ec5f8b59d5039709664f88fe22..345de93af4b3f354d1151a2ecffd6dc3f4b87a58 100644 --- a/app/views/admin/research/journal/articles/static.html.erb +++ b/app/views/admin/research/journal/articles/static.html.erb @@ -12,7 +12,7 @@ keywords: > <%= @article.keywords %> researchers: <% @article.researchers.each do |researcher| %> -- "<%= researcher.id %>" +- "<%= researcher.slug %>" <% end %> abstract: "<%= @article.abstract %>" references: "<%= @article.references %>" diff --git a/app/views/admin/university/people/_form.html.erb b/app/views/admin/university/people/_form.html.erb index 498d3415064421a7f3e8db884bcdc71e9390019d..9c0ae01d0ed5dfe3143d2baa7f05eb20e637dfcd 100644 --- a/app/views/admin/university/people/_form.html.erb +++ b/app/views/admin/university/people/_form.html.erb @@ -57,7 +57,7 @@ class: 'js-slug-input', data: { source: '#university_person_first_name, #university_person_last_name' } } %> - <%= f.association :user, collection: current_university.users.ordered %> + <%= f.association :user, collection: current_university.users.ordered if can?(:manage, User) %> </div> </div> <div class="card flex-fill w-100"> diff --git a/app/views/admin/university/people/_main_infos.html.erb b/app/views/admin/university/people/_main_infos.html.erb index bf82980bdcb3f4331af572bb2d1b47a0f2e24071..ac859c5eece68165f4c5c54a727d0b6b63fc7d20 100644 --- a/app/views/admin/university/people/_main_infos.html.erb +++ b/app/views/admin/university/people/_main_infos.html.erb @@ -43,7 +43,7 @@ <% if person.best_picture_inherits_from_user? %> <p> <span class="small text-muted"> - <%= t 'admin.inheritance.sentence_html', link: link_to(person.user, [:admin, person.user]) %> + <%= t 'admin.inheritance.sentence_html', link: link_to_if(can?(:read, person.user), person.user, [:admin, person.user]) %> </span> </p> <% end %> diff --git a/app/views/admin/users/_form.html.erb b/app/views/admin/users/_form.html.erb index 317c715232946f7596a3ff9e27cb21d60377dfb6..15f7c0d6dcbab185cd9c2497597f2180e4fe6112 100644 --- a/app/views/admin/users/_form.html.erb +++ b/app/views/admin/users/_form.html.erb @@ -29,7 +29,7 @@ }, input_html: { autocomplete: "new-password" } %> <%= f.input :mobile_phone %> - <%= f.input :role, include_blank: false, collection: current_user.managed_roles %> + <%= f.input :role, include_blank: false, collection: current_user.managed_roles, label_method: lambda { |k| t("activerecord.attributes.user.roles.#{k[1]}")} %> </div> </div> </div> diff --git a/config/locales/communication/en.yml b/config/locales/communication/en.yml index a79392d8f92f56e20742ddcd08cb4d2631e00350..81386b5242d88cec7b2f847b44becb337806f4a3 100644 --- a/config/locales/communication/en.yml +++ b/config/locales/communication/en.yml @@ -7,9 +7,6 @@ en: communication/website: one: Website other: Websites - communication/website/author: - one: Author - other: Authors communication/website/category: one: Category other: Categories @@ -41,21 +38,17 @@ en: about_Education::School: School website about_Research::Journal: Journal website about_type: About - authors_github_directory: Authors' GitHub directory name: Name - posts_github_directory: Posts' GitHub directory - programs_github_directory: Programs' GitHub directory - research_articles_github_directory: Research articles' GitHub directory - research_volumes_github_directory: Research volumes' GitHub directory - staff_github_directory: Staff's GitHub directory + static_pathname_administrators: Administration staff's static pathname + static_pathname_authors: Editorial staff's static pathname + static_pathname_posts: Posts' static pathname + static_pathname_programs: Programs' static pathname + static_pathname_research_articles: Research articles' static pathname + static_pathname_research_volumes: Research volumes' static pathname + static_pathname_researchers: Research staff's static pathname + static_pathname_staff: Staff's static pathname + static_pathname_teachers: Educational staff's static pathname url: URL - communication/website/author: - biography: Biography - first_name: First name - last_name: Last name - name: Name - slug: Slug - user: User communication/website/category: children: Children categories description: Description @@ -114,6 +107,7 @@ en: number_of_posts: Nunber of posts website: force_publication: 'Force publication' + git: Git imported: from: Imported from launch: Launch import @@ -130,12 +124,15 @@ en: posts: new_curation: New curation see_all: See the full list (%{number} elements) + static_pathnames: Static pathnames enums: communication: website: menu: item: kind: + administrators: Administration staff + authors: Editorial staff blank: Title news: News index news_article: Specific news @@ -147,5 +144,7 @@ en: research_articles: Research articles index research_volume: Specific research volume research_volumes: Research volumes index + researchers: Research staff staff: Staff + teachers: Educational staff url: URL diff --git a/config/locales/communication/fr.yml b/config/locales/communication/fr.yml index 9204e1a67c961b231d9003ede7a7fcf4aa23a0b7..4cf63e710b704fb75f67cfe93e686506826125f4 100644 --- a/config/locales/communication/fr.yml +++ b/config/locales/communication/fr.yml @@ -38,13 +38,16 @@ fr: about_Education::School: Site d'école about_Research::Journal: Site de revue scientifique about_type: Sujet du site - authors_github_directory: Dossier GitHub des auteurs name: Nom - posts_github_directory: Dossier GitHub des actualités - programs_github_directory: Dossier GitHub des formations - research_articles_github_directory: Dossier GitHub des articles de recherche - research_volumes_github_directory: Dossier GitHub des volumes de recherche - staff_github_directory: Dossier GitHub de l'équipe + static_pathname_administrators: Chemin statique de l'équipe administrative + static_pathname_authors: Chemin statique de l'équipe éditoriale + static_pathname_posts: Chemin statique des actualités + static_pathname_programs: Chemin statique des formations + static_pathname_research_articles: Chemin statique des articles de recherche + static_pathname_research_volumes: Chemin statique des volumes de recherche + static_pathname_researchers: Chemin statique de l'équipe de recherche + static_pathname_staff: Chemin statique de l'équipe + static_pathname_teachers: Chemin statique de l'équipe pédagogique url: URL communication/website/category: children: Catégories enfants @@ -104,6 +107,7 @@ fr: number_of_posts: Nombre d'actualités website: force_publication: 'Forcer la publication' + git: Git imported: from: Importé depuis launch: Importer le site @@ -120,12 +124,15 @@ fr: posts: new_curation: Nouvelle curation see_all: Voir la liste complète (%{number} éléments) + static_pathnames: Chemins statiques enums: communication: website: menu: item: kind: + administrators: Équipe administrative + authors: Équipe éditoriale blank: Titre intermédiaire news: Index des actualités news_article: Actualité spécifique @@ -137,5 +144,7 @@ fr: research_articles: Index des articles de recherche research_volume: Volume de recherche spécifique research_volumes: Index des volumes de recherche + researchers: Équipe de recherche staff: Équipe + teachers: Équipe pédagogique url: URL diff --git a/config/locales/en.yml b/config/locales/en.yml index aea1857ea0e32fc83b615261681bef125abddd19..c692b52c30b57506cce0168e7d49cf8a83b99efe 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -13,6 +13,12 @@ en: mobile_phone: Mobile phone picture: Profile picture role: Role + roles: + admin: Administrator + program_manager: Program manager + server_admin: Server admin + teacher: Teacher + visitor: Visitor errors: models: user: diff --git a/config/locales/fr.yml b/config/locales/fr.yml index ebbd8d67b579b7226fb5c6e3c0a70da68da989cd..768f6224d7e927bcbf8074ed9592f72993c6cc91 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -13,6 +13,12 @@ fr: mobile_phone: Téléphone portable picture: Photo de profil role: Rôle + roles: + admin: Administrateur + program_manager: Responsable de formation + server_admin: Administrateur du serveur + teacher: Enseignant·e + visitor: Visiteur errors: models: user: diff --git a/db/migrate/20220117130748_rename_github_dirs_to_static_pathnames_in_communication_websites.rb b/db/migrate/20220117130748_rename_github_dirs_to_static_pathnames_in_communication_websites.rb new file mode 100644 index 0000000000000000000000000000000000000000..0a55521a183d0293241e90eead6d8b41752b2314 --- /dev/null +++ b/db/migrate/20220117130748_rename_github_dirs_to_static_pathnames_in_communication_websites.rb @@ -0,0 +1,10 @@ +class RenameGithubDirsToStaticPathnamesInCommunicationWebsites < ActiveRecord::Migration[6.1] + def change + rename_column :communication_websites, :authors_github_directory, :static_pathname_authors + rename_column :communication_websites, :posts_github_directory, :static_pathname_posts + rename_column :communication_websites, :programs_github_directory, :static_pathname_programs + rename_column :communication_websites, :research_articles_github_directory, :static_pathname_research_articles + rename_column :communication_websites, :research_volumes_github_directory, :static_pathname_research_volumes + rename_column :communication_websites, :staff_github_directory, :static_pathname_staff + end +end diff --git a/db/migrate/20220117134401_add_staff_static_pathnames_to_communication_websites.rb b/db/migrate/20220117134401_add_staff_static_pathnames_to_communication_websites.rb new file mode 100644 index 0000000000000000000000000000000000000000..cd79111b2c5a3ec67df5bf30b4d2be42364e677b --- /dev/null +++ b/db/migrate/20220117134401_add_staff_static_pathnames_to_communication_websites.rb @@ -0,0 +1,7 @@ +class AddStaffStaticPathnamesToCommunicationWebsites < ActiveRecord::Migration[6.1] + def change + add_column :communication_websites, :static_pathname_administrators, :string, default: 'administrators' + add_column :communication_websites, :static_pathname_researchers, :string, default: 'researchers' + add_column :communication_websites, :static_pathname_teachers, :string, default: 'teachers' + end +end diff --git a/db/schema.rb b/db/schema.rb index f9248b9d7a507eec6089cc85cf08e9c4d2cfc23a..159b3f490c8953aee1966af09f4b5a47beecb2c0 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: 2022_01_14_130021) do +ActiveRecord::Schema.define(version: 2022_01_17_134401) do # These are extensions that must be enabled in order to support this database enable_extension "pgcrypto" @@ -323,12 +323,15 @@ ActiveRecord::Schema.define(version: 2022_01_14_130021) do t.string "repository" t.string "about_type" t.uuid "about_id" - t.string "authors_github_directory", default: "authors" - t.string "posts_github_directory", default: "posts" - t.string "programs_github_directory", default: "programs" - t.string "staff_github_directory", default: "staff" - t.string "research_volumes_github_directory", default: "volumes" - t.string "research_articles_github_directory", default: "articles" + t.string "static_pathname_authors", default: "authors" + t.string "static_pathname_posts", default: "posts" + t.string "static_pathname_programs", default: "programs" + t.string "static_pathname_staff", default: "staff" + t.string "static_pathname_research_volumes", default: "volumes" + t.string "static_pathname_research_articles", default: "articles" + t.string "static_pathname_administrators", default: "administrators" + t.string "static_pathname_researchers", default: "researchers" + t.string "static_pathname_teachers", default: "teachers" t.index ["about_type", "about_id"], name: "index_communication_websites_on_about" t.index ["university_id"], name: "index_communication_websites_on_university_id" end