diff --git a/app/controllers/admin/education/school/roles_controller.rb b/app/controllers/admin/education/school/roles_controller.rb index 09d108e7f0cc50dd4441b4438e189cabfe2f1d63..afbdcd921bc989de362009d6ae70adeabb44b213 100644 --- a/app/controllers/admin/education/school/roles_controller.rb +++ b/app/controllers/admin/education/school/roles_controller.rb @@ -50,7 +50,7 @@ class Admin::Education::School::RolesController < Admin::Education::School::Appl def breadcrumb super - add_breadcrumb University::Role.model_name.human(count: 2), admin_education_school_roles_path(@school) + add_breadcrumb Education::School.human_attribute_name('roles'), admin_education_school_roles_path(@school) if @role @role.persisted? ? add_breadcrumb(@role, admin_education_school_role_path(@role, { school_id: @school.id })) : add_breadcrumb(t('create')) diff --git a/app/views/admin/education/program/role/people/_list.html.erb b/app/views/admin/education/program/role/people/_list.html.erb index 47f9942044a4a5e52a86f5e6987bc189148f61fa..80ffa160742efa23a2145d2f3a306a06278b4697 100644 --- a/app/views/admin/education/program/role/people/_list.html.erb +++ b/app/views/admin/education/program/role/people/_list.html.erb @@ -2,6 +2,9 @@ <table class="table table-sortable"> <thead> <tr> + <% if can? :reorder, University::Role %> + <th width="20" class="ps-0"> </th> + <% end %> <th class="ps-0"><%= University::Person.model_name.human %></th> <th><%= University::Person::Involvement.human_attribute_name("description") %></th> <th></th> @@ -9,7 +12,10 @@ </thead> <tbody data-reorder-url="<%= reorder_admin_education_program_role_people_path(@role, { program_id: @program.id }) %>"> <% involvements.each do |involvement| %> - <tr class="handle" data-id="<%= involvement.id %>"> + <tr data-id="<%= involvement.id %>"> + <% if can? :reorder, University::Role %> + <td><i class="fa fa-bars handle"></i></td> + <% end %> <td class="ps-0"> <%= link_to_if can?(:read, involvement.person), involvement.person, diff --git a/app/views/admin/education/program/roles/_list.html.erb b/app/views/admin/education/program/roles/_list.html.erb index ad85ad92ca96cccb1239b25753bfde1254351ea4..fbefad1732f392047c552e2a8a2a0107d202d118 100644 --- a/app/views/admin/education/program/roles/_list.html.erb +++ b/app/views/admin/education/program/roles/_list.html.erb @@ -2,6 +2,9 @@ <table class="table table-sortable"> <thead> <tr> + <% if can? :reorder, University::Role %> + <th width="20" class="ps-0"> </th> + <% end %> <th class="ps-0"><%= University::Role.model_name.human %></th> <th><%= University::Role.human_attribute_name('people') %></th> <th></th> @@ -9,7 +12,10 @@ </thead> <tbody data-reorder-url="<%= reorder_admin_education_program_roles_path(program_id: @program.id) %>"> <% roles.each do |role| %> - <tr class="handle" data-id="<%= role.id %>"> + <tr data-id="<%= role.id %>"> + <% if can? :reorder, University::Role %> + <td><i class="fa fa-bars handle"></i></td> + <% end %> <td class="ps-0"> <%= link_to_if can?(:read, role), role, diff --git a/app/views/admin/education/program/teachers/_list.html.erb b/app/views/admin/education/program/teachers/_list.html.erb index 638b44be03ac9918ce1ef83ffa028ca3af6452e1..acaaaefbacb2a9591694b1cbed601e85038391c5 100644 --- a/app/views/admin/education/program/teachers/_list.html.erb +++ b/app/views/admin/education/program/teachers/_list.html.erb @@ -2,6 +2,9 @@ <table class="table table-sortable"> <thead> <tr> + <% if can? :reorder, University::Person::Involvement %> + <th width="20" class="ps-0"> </th> + <% end %> <th class="ps-0"><%= University::Person.model_name.human %></th> <th><%= University::Person::Involvement.human_attribute_name('description') %></th> <th></th> @@ -9,7 +12,10 @@ </thead> <tbody data-reorder-url="<%= reorder_admin_education_program_teachers_path(@program) %>"> <% involvements.each do |involvement| %> - <tr class="handle" data-id="<%= involvement.id %>"> + <tr data-id="<%= involvement.id %>"> + <% if can? :reorder, University::Person::Involvement %> + <td><i class="fa fa-bars handle"></i></td> + <% end %> <td class="ps-0"> <%= involvement %> </td> diff --git a/app/views/admin/education/school/role/people/_list.html.erb b/app/views/admin/education/school/role/people/_list.html.erb index b8de0cf1946e0f347c4d8f34304dbcb60af28adc..146d9acfc6d48d54b93b2331b622cbd1a370399a 100644 --- a/app/views/admin/education/school/role/people/_list.html.erb +++ b/app/views/admin/education/school/role/people/_list.html.erb @@ -2,6 +2,9 @@ <table class="table table-sortable"> <thead> <tr> + <% if can? :reorder, University::Person::Involvement %> + <th width="20" class="ps-0"> </th> + <% end %> <th class="ps-0"><%= University::Person.model_name.human %></th> <th><%= University::Person::Involvement.human_attribute_name("description") %></th> <th></th> @@ -9,7 +12,10 @@ </thead> <tbody data-reorder-url="<%= reorder_admin_education_school_role_people_path(@role, { school_id: @school.id }) %>"> <% involvements.each do |involvement| %> - <tr class="handle" data-id="<%= involvement.id %>"> + <tr data-id="<%= involvement.id %>"> + <% if can? :reorder, University::Person::Involvement %> + <td><i class="fa fa-bars handle"></i></td> + <% end %> <td class="ps-0"> <%= link_to_if can?(:read, involvement.person), involvement.person, diff --git a/app/views/admin/education/school/roles/_list.html.erb b/app/views/admin/education/school/roles/_list.html.erb index 084f107a7b852baeb73d305aa13de692e8eb4f04..b11d96d828bd01b7e7373457785112637e0c9187 100644 --- a/app/views/admin/education/school/roles/_list.html.erb +++ b/app/views/admin/education/school/roles/_list.html.erb @@ -2,6 +2,9 @@ <table class="table table-sortable"> <thead> <tr> + <% if can? :reorder, University::Role %> + <th width="20" class="ps-0"> </th> + <% end %> <th class="ps-0"><%= University::Role.model_name.human %></th> <th><%= University::Role.human_attribute_name('people') %></th> <th></th> @@ -9,7 +12,10 @@ </thead> <tbody data-reorder-url="<%= reorder_admin_education_school_roles_path(school_id: @school.id) %>"> <% roles.each do |role| %> - <tr class="handle" data-id="<%= role.id %>"> + <tr data-id="<%= role.id %>"> + <% if can? :reorder, University::Role %> + <td><i class="fa fa-bars handle"></i></td> + <% end %> <td class="ps-0"> <%= link_to_if can?(:read, role), role, diff --git a/app/views/admin/education/school/roles/index.html.erb b/app/views/admin/education/school/roles/index.html.erb index d8dda13f8f93992acd13d167d6f47bc7f15b2b94..4d62fb4f58385ed1b66710e84dda2018f64a1a14 100644 --- a/app/views/admin/education/school/roles/index.html.erb +++ b/app/views/admin/education/school/roles/index.html.erb @@ -1,3 +1,6 @@ -<% content_for :title, University::Role.model_name.human(count: 2) %> -<%= link_to t('create'), new_admin_education_school_role_path(school_id: @school.id), class: button_classes %> +<% content_for :title, Education::School.human_attribute_name('roles') %> <%= render 'admin/education/school/roles/list', roles: @roles %> + +<% content_for :action_bar_right do %> + <%= link_to t('create'), new_admin_education_school_role_path(school_id: @school.id), class: button_classes if can? :create, University::Role %> +<% end %> diff --git a/app/views/admin/education/schools/show/_roles.html.erb b/app/views/admin/education/schools/show/_roles.html.erb index d2717a963b0d62ff11c1efef1c4b627f262ab6e9..536d65527f9c4683f6d11ba41021128f78d7ab9a 100644 --- a/app/views/admin/education/schools/show/_roles.html.erb +++ b/app/views/admin/education/schools/show/_roles.html.erb @@ -1,11 +1,11 @@ <div class="card flex-fill w-100"> <div class="card-header"> <div class="float-end"> - <%= link_to "Gérer les rôles", + <%= link_to t('education.schools.manage_roles'), admin_education_school_roles_path(school_id: @school.id), class: button_classes if can?(:update, University::Role) %> </div> - <h2 class="card-title mb-0 h5">Rôles</h2> + <h2 class="card-title mb-0 h5"><%= Education::School.human_attribute_name('roles') %></h2> </div> <div class="card-body"> <% if @roles.any? %> @@ -24,7 +24,13 @@ role, admin_education_school_role_path(role, { school_id: @school.id }) %> </td> - <td><%= role.involvements.includes(:person).ordered.map { |involvement| involvement.person.to_s }.to_sentence %></td> + <td> + <ul> + <% role.involvements.includes(:person).ordered.each do |involvement| %> + <li><%= link_to_if can?(:read, involvement.person), involvement.person.to_s, admin_university_person_path(involvement.person) %></li> + <% end %> + </ul> + </td> </tr> <% end %> </tbody> diff --git a/app/views/admin/research/journal/volumes/show.html.erb b/app/views/admin/research/journal/volumes/show.html.erb index da93defb44dc656924bfa7525c335a8b5b387732..beffd31e695148eaf67520daa7670f111f65a7e1 100644 --- a/app/views/admin/research/journal/volumes/show.html.erb +++ b/app/views/admin/research/journal/volumes/show.html.erb @@ -14,14 +14,20 @@ <table class="table table-sortable"> <thead> <tr> - <th><%= Research::Journal::Article.model_name.human %></th> + <% if can? :reorder, Research::Journal::Article %> + <th width="20" class="ps-0"> </th> + <% end %> + <th class="ps-0"><%= Research::Journal::Article.model_name.human %></th> <th><%= Research::Journal::Article.human_attribute_name('published_at') %></th> <th></th> </tr> </thead> <tbody data-reorder-url="<%= reorder_admin_research_journal_articles_path(journal_id: @journal.id) %>"> <% @articles.each do |article| %> - <tr class="handle" data-id="<%= article.id %>"> + <tr data-id="<%= article.id %>"> + <% if can? :reorder, Research::Journal::Article %> + <td><i class="fa fa-bars handle"></i></td> + <% end %> <td> <%= link_to article, admin_research_journal_article_path(journal_id: article.journal, id: article), diff --git a/app/views/admin/research/laboratory/axes/_list.html.erb b/app/views/admin/research/laboratory/axes/_list.html.erb index baf2e27f8c1f5365eb765453cbe898a151f12ad9..0e115451eaf94435167cb590842e50dcba037501 100644 --- a/app/views/admin/research/laboratory/axes/_list.html.erb +++ b/app/views/admin/research/laboratory/axes/_list.html.erb @@ -1,6 +1,9 @@ <table class="table table-sortable"> <thead> <tr> + <% if can? :reorder, Research::Laboratory::Axis %> + <th width="20" class="ps-0"> </th> + <% end %> <th><%= Research::Laboratory::Axis.model_name.human %></th> <th><%= Research::Laboratory::Axis.human_attribute_name('short_name') %></th> <th></th> @@ -8,7 +11,10 @@ </thead> <tbody data-reorder-url="<%= reorder_admin_research_laboratory_axes_path(laboratory_id: @laboratory.id) %>"> <% axes.each do |axis| %> - <tr class="handle" data-id="<%= axis.id %>"> + <tr data-id="<%= axis.id %>"> + <% if can? :reorder, Research::Laboratory::Axis %> + <td><i class="fa fa-bars handle"></i></td> + <% end %> <td> <%= link_to axis, admin_research_laboratory_axis_path(laboratory_id: axis.laboratory, id: axis) %> </td> diff --git a/config/locales/education/en.yml b/config/locales/education/en.yml index 9e37d8a58c322f861cad1c70f9669d4a1d4d3b0e..9b3b6540cdb16175466a0ef9969f7c2b2f72b206 100644 --- a/config/locales/education/en.yml +++ b/config/locales/education/en.yml @@ -46,6 +46,7 @@ en: name: Name phone: Phone programs: Programs provided + roles: Team Members websites: Associated websites zipcode: Zipcode education: diff --git a/config/locales/education/fr.yml b/config/locales/education/fr.yml index 7a1779a898a23af8017557f9be177bcdca5d6281..7827fd05444469df98af643a54b97daeac75393f 100644 --- a/config/locales/education/fr.yml +++ b/config/locales/education/fr.yml @@ -46,6 +46,7 @@ fr: name: Nom phone: Téléphone programs: Formations dispensées + roles: Membres de l'équipe websites: Sites webs associés zipcode: Code postal education: @@ -58,6 +59,8 @@ fr: roles: one: Rôle other: Rôles + schools: + manage_roles: Gérer l'équipe teachers: one: Enseignant·e other: Enseignants·es