From b5bc284bd0d1fcbd69905cf496504409a0350fd7 Mon Sep 17 00:00:00 2001
From: Arnaud Levy <contact@arnaudlevy.com>
Date: Thu, 17 Feb 2022 14:02:21 +0100
Subject: [PATCH] Ajustements

---
 .../roles/_involvement_fields.html.erb        |  2 +-
 .../programs/_involvement_fields.html.erb     |  2 +-
 .../school/roles/_involvement_fields.html.erb |  2 +-
 .../teachers/_involvement_fields.html.erb     | 23 ++++++++----
 .../admin/education/teachers/edit.html.erb    | 37 ++++++++++---------
 .../admin/education/teachers/show.html.erb    |  1 +
 .../admin/university/people/_form.html.erb    | 14 +------
 config/locales/university/fr.yml              |  2 +-
 8 files changed, 41 insertions(+), 42 deletions(-)

diff --git a/app/views/admin/education/program/roles/_involvement_fields.html.erb b/app/views/admin/education/program/roles/_involvement_fields.html.erb
index 0ce4a6118..3be0a41aa 100644
--- a/app/views/admin/education/program/roles/_involvement_fields.html.erb
+++ b/app/views/admin/education/program/roles/_involvement_fields.html.erb
@@ -9,7 +9,7 @@
         <%= f.association :person, collection: @administration_people, label: false, include_blank: :translate, wrapper: false, required: true %>
       </div>
       <div class="col-2">
-        <%= link_to_remove_association '<i class="fas fa-trash"></i>'.html_safe, f, class: 'btn btn-sm btn-danger' %>
+        <%= link_to_remove_association '<i class="fas fa-times"></i>'.html_safe, f, class: 'btn btn-sm btn-danger' %>
       </div>
     </div>
   </div>
diff --git a/app/views/admin/education/programs/_involvement_fields.html.erb b/app/views/admin/education/programs/_involvement_fields.html.erb
index fe5549b69..a849fd7b4 100644
--- a/app/views/admin/education/programs/_involvement_fields.html.erb
+++ b/app/views/admin/education/programs/_involvement_fields.html.erb
@@ -16,7 +16,7 @@
                   wrapper: false %>
     </div>
     <div class="col-md-1 text-end">
-      <%= link_to_remove_association  '<i class="fas fa-trash"></i>'.html_safe,
+      <%= link_to_remove_association  '<i class="fas fa-times"></i>'.html_safe,
                                       f,
                                       class: 'btn btn-sm btn-danger' %>
     </div>
diff --git a/app/views/admin/education/school/roles/_involvement_fields.html.erb b/app/views/admin/education/school/roles/_involvement_fields.html.erb
index 0ce4a6118..3be0a41aa 100644
--- a/app/views/admin/education/school/roles/_involvement_fields.html.erb
+++ b/app/views/admin/education/school/roles/_involvement_fields.html.erb
@@ -9,7 +9,7 @@
         <%= f.association :person, collection: @administration_people, label: false, include_blank: :translate, wrapper: false, required: true %>
       </div>
       <div class="col-2">
-        <%= link_to_remove_association '<i class="fas fa-trash"></i>'.html_safe, f, class: 'btn btn-sm btn-danger' %>
+        <%= link_to_remove_association '<i class="fas fa-times"></i>'.html_safe, f, class: 'btn btn-sm btn-danger' %>
       </div>
     </div>
   </div>
diff --git a/app/views/admin/education/teachers/_involvement_fields.html.erb b/app/views/admin/education/teachers/_involvement_fields.html.erb
index 9a7ec6093..3cbb4f76a 100644
--- a/app/views/admin/education/teachers/_involvement_fields.html.erb
+++ b/app/views/admin/education/teachers/_involvement_fields.html.erb
@@ -1,9 +1,9 @@
 <% include_id ||= false %>
-<div class="nested-fields col-md-4">
-  <div class="card mb-2">
+<div class="nested-fields">
+  <div class="card mb-3">
     <div class="card-body">
-      <div class="row align-items-center">
-        <div class="col-10">
+      <div class="row">
+        <div class="col-md-5">
           <%= f.hidden_field :target_type, value: "Education::Program" %>
           <%= f.association :target,
                             collection: collection_tree(current_university.education_programs),
@@ -11,11 +11,18 @@
                             value_method: ->(p) { p[:id] },
                             label: false,
                             include_blank: t('simple_form.include_blanks.defaults.program'),
-                            required: true %>
-          <%= f.input :description, label: false, placeholder: University::Person::Involvement.human_attribute_name('description'), wrapper: false %>
+                            required: true,
+                            wrapper: false %>
         </div>
-        <div class="col-2">
-          <%= link_to_remove_association '<i class="fas fa-trash"></i>'.html_safe,
+        <div class="col-md-6">
+          <%= f.input :description,
+                      as: :string,
+                      label: false,
+                      placeholder: University::Person::Involvement.human_attribute_name('description'),
+                      wrapper: false %>
+        </div>
+        <div class="col-md-1 text-end">
+          <%= link_to_remove_association '<i class="fas fa-times"></i>'.html_safe,
                                          f,
                                          class: 'btn btn-sm btn-danger' %>
         </div>
diff --git a/app/views/admin/education/teachers/edit.html.erb b/app/views/admin/education/teachers/edit.html.erb
index 769b9ea4c..ade84d913 100644
--- a/app/views/admin/education/teachers/edit.html.erb
+++ b/app/views/admin/education/teachers/edit.html.erb
@@ -1,27 +1,28 @@
 <% content_for :title, @teacher %>
 
+<h2 class="h3"><%= Education::Program.model_name.human(count: 2) %></h2>
+
 <%= simple_form_for [:admin, @teacher], url: admin_education_teacher_path(@teacher) do |f| %>
-  <div class="card flex-fill w-100">
-    <div class="card-header">
-      <h5 class="card-title mb-0"><%= Education::Program.model_name.human(count: 2) %></h5>
-    </div>
-    <div class="card-body">
-      <%= link_to_add_association t('add'), f, :involvements,
-                                  class: "btn btn-primary mb-3",
-                                  data: {
-                                    'association-insertion-method': 'append',
-                                    'association-insertion-node':   '#involvements',
-                                  } %>
+<div class="row">
+  <div class="col-md-2">
+    <%= link_to_add_association t('add'), f, :involvements,
+                                class: button_classes,
+                                data: {
+                                  'association-insertion-method': 'append',
+                                  'association-insertion-node':   '#involvements',
+                                } %>
 
-      <div class="row mb-3" id="involvements">
-        <% sorted_teacher_involvements = @teacher.involvements.select(&:teacher?).sort_by { |involvement| involvement.created_at || Time.zone.now } %>
-        <%= f.simple_fields_for :involvements, sorted_teacher_involvements, include_id: false do |involvement_f| %>
-          <%= render 'admin/education/teachers/involvement_fields', f: involvement_f, include_id: true %>
-        <% end %>
-      </div>
-    </div>
   </div>
+  <div class="col-md-10">
+    <div id="involvements">
+      <% sorted_teacher_involvements = @teacher.involvements.select(&:teacher?).sort_by { |involvement| involvement.created_at || Time.zone.now } %>
+      <%= f.simple_fields_for :involvements, sorted_teacher_involvements, include_id: false do |involvement_f| %>
+        <%= render 'admin/education/teachers/involvement_fields', f: involvement_f, include_id: true %>
+      <% end %>
+    </div>
 
+  </div>
+</div>
   <% content_for :action_bar_right do %>
     <%= submit f %>
   <% end %>
diff --git a/app/views/admin/education/teachers/show.html.erb b/app/views/admin/education/teachers/show.html.erb
index 2b67b3479..bbf2119bb 100644
--- a/app/views/admin/education/teachers/show.html.erb
+++ b/app/views/admin/education/teachers/show.html.erb
@@ -5,5 +5,6 @@
 <%= render 'admin/education/teachers/show/programs', involvements: @involvements %>
 
 <% content_for :action_bar_right do %>
+  <%= edit_link @teacher %>
   <%= link_to t('education.manage_programs'), edit_admin_education_teacher_path(@teacher), class: button_classes if can?(:manage, :all) %>
 <% end %>
diff --git a/app/views/admin/university/people/_form.html.erb b/app/views/admin/university/people/_form.html.erb
index 57edd82ed..278b7f696 100644
--- a/app/views/admin/university/people/_form.html.erb
+++ b/app/views/admin/university/people/_form.html.erb
@@ -34,23 +34,13 @@
           <div class="row">
             <div class="col-md-6">
               <%= f.input :is_teacher %>
-            </div>
-            <div class="col-md-6">
-              <%= f.input :is_researcher %>
-            </div>
-            <div class="col-md-6">
               <%= f.input :is_administration %>
+              <%= f.input :tenure %>
             </div>
-          </div>
-        </div>
-        <div class="card-body">
-          <div class="row">
             <div class="col-md-6">
+              <%= f.input :is_researcher %>
               <%= f.input :habilitation %>
             </div>
-            <div class="col-md-6">
-              <%= f.input :tenure %>
-            </div>
           </div>
         </div>
       </div>
diff --git a/config/locales/university/fr.yml b/config/locales/university/fr.yml
index b10a6d36c..c123047f9 100644
--- a/config/locales/university/fr.yml
+++ b/config/locales/university/fr.yml
@@ -59,7 +59,7 @@ fr:
       university:
         sms_sender_name: "11 caractères maximum."
       university_person:
-        habilitation: "Possède une Habilitation à Diriger des Recherches."
+        habilitation: "Bénéficie d’une Habilitation à Diriger des Recherches (HDR)."
         is_administration: "Remplit des missions administratives."
         is_author: "Écrit des articles pour les sites."
         is_researcher: "Écrit des articles dans des revues scientifiques."
-- 
GitLab