diff --git a/app/views/admin/education/program/roles/_list.html.erb b/app/views/admin/education/program/roles/_list.html.erb index 9fbda8e94303c28ea6539804cf6efe4186e3961f..0a152d39a6e3204e32b1a026dbf9830b714074aa 100644 --- a/app/views/admin/education/program/roles/_list.html.erb +++ b/app/views/admin/education/program/roles/_list.html.erb @@ -1,33 +1,35 @@ -<table class="table table-sortable"> - <thead> - <tr> - <th><%= Education::Program::Role.model_name.human %></th> - <th><%= Education::Program::Role.human_attribute_name('people') %></th> - <th></th> - </tr> - </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 %>"> - <td> - <%= link_to_if can?(:read, role), - role, - admin_education_program_role_path(role, { program_id: @program.id }) %> - </td> - <td><%= role.people.includes(:person).ordered.map { |person| person.person.to_s }.to_sentence %></td> - <td class="text-end pe-0"> - <div class="btn-group" role="group"> - <%= link_to t('edit'), - edit_admin_education_program_role_path(role, { program_id: @program.id }), - class: button_classes %> - <%= 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 %> - </div> - </td> +<% if roles.any? %> + <table class="table table-sortable"> + <thead> + <tr> + <th class="ps-0"><%= Education::Program::Role.model_name.human %></th> + <th><%= Education::Program::Role.human_attribute_name('people') %></th> + <th></th> </tr> - <% end %> - </tbody> -</table> + </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 %>"> + <td class="ps-0"> + <%= link_to_if can?(:read, role), + role, + admin_education_program_role_path(role, { program_id: @program.id }) %> + </td> + <td><%= role.people.includes(:person).ordered.map { |person| person.person.to_s }.to_sentence %></td> + <td class="text-end pe-0"> + <div class="btn-group" role="group"> + <%= link_to t('edit'), + edit_admin_education_program_role_path(role, { program_id: @program.id }), + class: button_classes %> + <%= 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 %> + </div> + </td> + </tr> + <% end %> + </tbody> + </table> +<% end %> diff --git a/app/views/admin/education/program/teachers/_list.html.erb b/app/views/admin/education/program/teachers/_list.html.erb index d609934057f34ebea423ae7e43a87501700a9d58..5fb075887d0d93c3106f82133c7e966076b70fc1 100644 --- a/app/views/admin/education/program/teachers/_list.html.erb +++ b/app/views/admin/education/program/teachers/_list.html.erb @@ -2,7 +2,7 @@ <table class="table"> <thead> <tr> - <th><%= Education::Program::Teacher.model_name.human %></th> + <th class="ps-0"><%= Education::Program::Teacher.model_name.human %></th> <th><%= Education::Program::Teacher.human_attribute_name('description') %></th> <th></th> </tr> @@ -10,7 +10,7 @@ <tbody> <% teachers.each do |teacher| %> <tr> - <td> + <td class="ps-0"> <%= link_to_if can?(:read, teacher.person), teacher.person, admin_education_teacher_path(teacher.person) %> diff --git a/app/views/admin/education/programs/_form.html.erb b/app/views/admin/education/programs/_form.html.erb index c9574d775fa9ace5a45ca87c8896f91edb1c6d0f..f930ef9bfe4761f01d51c994ae8cd99c8d29ea66 100644 --- a/app/views/admin/education/programs/_form.html.erb +++ b/app/views/admin/education/programs/_form.html.erb @@ -28,7 +28,7 @@ </div> </div> </div> - <div class="col-md-5"> + <div class="col-md-6"> <div class="card flex-fill w-100"> <div class="card-header"> <h5 class="card-title mb-0"><%= t('education.program.useful_informations') %></h5> @@ -43,7 +43,7 @@ </div> </div> </div> - <div class="col-md-4"> + <div class="col-md-3"> <div class="card flex-fill w-100"> <div class="card-header"> <h5 class="card-title mb-0"><%= t('activerecord.attributes.education/program.featured_image') %></h5> @@ -75,18 +75,16 @@ </div> <div class="card-body"> <div class="row"> - <div class="col-md-4"> + <div class="col-md-6"> <%= render 'admin/education/programs/forms/input_with_inheritance', f: f, property: :objectives %> <%= render 'admin/education/programs/forms/input_with_inheritance', f: f, property: :content %> - </div> - <div class="col-md-4"> - <%= render 'admin/education/programs/forms/input_with_inheritance', f: f, property: :opportunities %> <%= render 'admin/education/programs/forms/input_with_inheritance', f: f, property: :prerequisites %> - <%= render 'admin/education/programs/forms/input_with_inheritance', f: f, property: :results %> </div> - <div class="col-md-4"> - <%= render 'admin/education/programs/forms/input_with_inheritance', f: f, property: :evaluation %> + <div class="col-md-6"> <%= render 'admin/education/programs/forms/input_with_inheritance', f: f, property: :pedagogy %> + <%= render 'admin/education/programs/forms/input_with_inheritance', f: f, property: :evaluation %> + <%= render 'admin/education/programs/forms/input_with_inheritance', f: f, property: :opportunities %> + <%= render 'admin/education/programs/forms/input_with_inheritance', f: f, property: :results %> </div> </div> </div> diff --git a/app/views/admin/education/programs/show.html.erb b/app/views/admin/education/programs/show.html.erb index 1a929183479aa4c93b6ef942f94c3a72e919b497..e3263475a8675bbb1f762c43708c6e7eb210c3c5 100644 --- a/app/views/admin/education/programs/show.html.erb +++ b/app/views/admin/education/programs/show.html.erb @@ -55,8 +55,6 @@ :duration, :contacts, :accessibility, - :content, - :results, :other ].each_with_index do |prop, index| %> <% @@ -87,7 +85,7 @@ <div class="row"> <div class="col-md-6"> <% i = 0 %> - <% ['prerequisites', 'objectives', 'opportunities'].each do |prop| %> + <% [:prerequisites, :objectives, :opportunities, :results].each do |prop| %> <% next if @program.public_send(prop).blank? %> <h3 class="h5 <%= 'mt-4' if i > 0 %>"><%= Education::Program.human_attribute_name(prop) %></h3> <%= @program.public_send prop %> @@ -96,16 +94,12 @@ </div> <div class="col-md-6"> <% i = 0 %> - <% ['pedagogy', 'evaluation'].each do |prop| %> + <% ['pedagogy', 'evaluation', 'content'].each do |prop| %> <% next if @program.public_send(prop).blank? %> <h3 class="h5 <%= 'mt-4' if i > 0 %>"><%= Education::Program.human_attribute_name(prop) %></h3> <%= @program.public_send prop %> <% i += 1 %> <% end %> - - <h3 class="h5 <%= 'mt-4' if i > 0 %>"><%= Education::Program.human_attribute_name('teachers') %></h3> - <p><%= link_to t('create'), new_admin_education_program_teacher_path(program_id: @program.id), class: 'btn btn-primary' %></p> - <%= render 'admin/education/program/teachers/list', teachers: @program.teachers.includes(:person).ordered %> </div> </div> </div> @@ -113,11 +107,21 @@ <div class="card flex-fill w-100"> <div class="card-header"> - <h5 class="card-title mb-0"><%= Education::Program.human_attribute_name('roles') %></h5> + <h5 class="card-title mb-0"><%= Education::Program.human_attribute_name('team') %></h5> </div> <div class="card-body"> - <p><%= link_to t('create'), new_admin_education_program_role_path(program_id: @program.id), class: 'btn btn-primary' %></p> - <%= render 'admin/education/program/roles/list', roles: @program.roles.ordered %> + <div class="row"> + <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 %> + </div> + <div class="col-md-6"> + <h3 class="h5"><%= Education::Program.human_attribute_name('teachers') %></h3> + <%= render 'admin/education/program/teachers/list', teachers: @program.teachers.includes(:person).ordered %> + <%= link_to t('create'), new_admin_education_program_teacher_path(program_id: @program.id), class: button_classes %> + </div> + </div> </div> </div> diff --git a/app/views/admin/education/programs/static.html.erb b/app/views/admin/education/programs/static.html.erb index de6e82c0ca39740be3a4fced08b3963b12a6060a..4fc644710346fc00df54796792e5f04b6a5acbba 100644 --- a/app/views/admin/education/programs/static.html.erb +++ b/app/views/admin/education/programs/static.html.erb @@ -11,20 +11,20 @@ image_alt: "<%= @program.featured_image_alt %>" <% end %> category: "<%= @website.categories.find_by(program_id: @program.id)&.id %>" teachers: - - "marlene-dulaurans" - - "arnaud-levy" -administrators: - - "quentin-bessiere" -contact_list: - - title: "Cheffe de département" - persons: - - "marlene-dulaurans" - - title: "Directeur des études" - persons: - - "arnaud-levy" - - title: "Secrétariat" +<% @program.teachers.includes(:person).ordered.each do |teacher| %> + - person: "<%= teacher.person.slug %>" + description: > + <%= teacher.description %> +<% end %> +roles: +<% @program.roles.ordered.each do |role| %> + - title: > + <%= role.to_s %> persons: - - "quentin-bessiere" + <% role.people.includes(:person).ordered.each do |role_person| %> + - "<%= role_person.person.slug %>" + <% end %> +<% end %> continuing: <%= @program.continuing %> level: <%= @program.level %> ects: <%= @program.ects %>