diff --git a/app/views/admin/education/program/teachers/_form.html.erb b/app/views/admin/education/program/teachers/_form.html.erb index d15ac983106c67742ad2d26e56bef5d49bafd546..e8c8b9067196b35f5d0599974470e4820b0a1d1d 100644 --- a/app/views/admin/education/program/teachers/_form.html.erb +++ b/app/views/admin/education/program/teachers/_form.html.erb @@ -1,14 +1,16 @@ <%= simple_form_for [:admin, teacher] do |f| %> - <div class="row"> - <div class="col-md-8"> - <div class="card flex-fill w-100"> - <div class="card-header"> - <h5 class="card-title mb-0"><%= t('admin.infos') %></h5> - </div> - <div class="card-body"> + <div class="card flex-fill w-100"> + <div class="card-header"> + <h5 class="card-title mb-0"><%= t('admin.infos') %></h5> + </div> + <div class="card-body"> + <div class="row"> + <div class="col-md-6"> <% teacher_ids = @program.teachers.where.not(id: teacher.id).pluck(:person_id) %> <%= f.association :person, collection: current_university.people.teachers.where.not(id: teacher_ids).ordered %> - <%= f.input :description, input_html: { rows: 5 } %> + </div> + <div class="col-md-6"> + <%= f.input :description, as: :string %> </div> </div> </div> diff --git a/app/views/admin/education/program/teachers/_list.html.erb b/app/views/admin/education/program/teachers/_list.html.erb index 9bd8965dfed39198d4fcd9a72a8dc946f4be1101..d609934057f34ebea423ae7e43a87501700a9d58 100644 --- a/app/views/admin/education/program/teachers/_list.html.erb +++ b/app/views/admin/education/program/teachers/_list.html.erb @@ -1,33 +1,35 @@ -<table class="table"> - <thead> - <tr> - <th><%= Education::Program::Teacher.model_name.human %></th> - <th><%= Education::Program::Teacher.human_attribute_name('description') %></th> - <th></th> - </tr> - </thead> - <tbody> - <% teachers.each do |teacher| %> +<% if teachers.any? %> + <table class="table"> + <thead> <tr> - <td> - <%= link_to_if can?(:read, teacher.person), - teacher.person, - admin_education_teacher_path(teacher.person) %> - </td> - <td><%= teacher.description %></td> - <td class="text-end pe-0"> - <div class="btn-group" role="group"> - <%= link_to t('edit'), - edit_admin_education_program_teacher_path(teacher, { program_id: @program.id }), - class: button_classes %> - <%= 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 %> - </div> - </td> + <th><%= Education::Program::Teacher.model_name.human %></th> + <th><%= Education::Program::Teacher.human_attribute_name('description') %></th> + <th></th> </tr> - <% end %> - </tbody> -</table> + </thead> + <tbody> + <% teachers.each do |teacher| %> + <tr> + <td> + <%= link_to_if can?(:read, teacher.person), + teacher.person, + admin_education_teacher_path(teacher.person) %> + </td> + <td><%= teacher.description %></td> + <td class="text-end pe-0"> + <div class="btn-group" role="group"> + <%= link_to t('edit'), + edit_admin_education_program_teacher_path(teacher, { program_id: @program.id }), + class: button_classes %> + <%= 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 %> + </div> + </td> + </tr> + <% end %> + </tbody> + </table> +<% end %> diff --git a/app/views/admin/education/programs/show.html.erb b/app/views/admin/education/programs/show.html.erb index 355231df10da4dce55ae6f2b90dbbc86f68b8edf..1a929183479aa4c93b6ef942f94c3a72e919b497 100644 --- a/app/views/admin/education/programs/show.html.erb +++ b/app/views/admin/education/programs/show.html.erb @@ -48,8 +48,17 @@ <h3 class="h5 mt-4"> <%= Education::Program.human_attribute_name('description') %> </h3> - <p><% @program.description %></p> - <% ['registration', 'pricing', 'duration', 'contacts', 'accessibility', 'other'].each_with_index do |prop, index| %> + <p><%= @program.description %></p> + <% [ + :registration, + :pricing, + :duration, + :contacts, + :accessibility, + :content, + :results, + :other + ].each_with_index do |prop, index| %> <% best_prop_value = @program.public_send("best_#{prop}") best_prop_source = @program.public_send("best_#{prop}_source") diff --git a/app/views/admin/education/programs/static.html.erb b/app/views/admin/education/programs/static.html.erb index 5907c32ca463ba195dd1ef441e029ef4de850395..6bdeade466a4159b5b589a5290d10c96cde255ee 100644 --- a/app/views/admin/education/programs/static.html.erb +++ b/app/views/admin/education/programs/static.html.erb @@ -45,6 +45,6 @@ ects: <%= @program.ects %> :content ].each do |property| %> <%= property.to_s %>: > - <%= prepare_for_github @program.send "best_#{property}", @program.university %> + <%= prepare_for_github @program.send("best_#{property}"), @program.university %> <% end %> ---