Skip to content
Snippets Groups Projects
Unverified Commit 2545adc3 authored by Sébastien Gaya's avatar Sébastien Gaya
Browse files

teachers

parent 550aa0bf
No related branches found
No related tags found
No related merge requests found
<%= simple_form_for [:admin, involvement],
url: involvement.new_record? ? admin_education_program_teachers_path(@program)
: admin_education_program_teacher_path(involvement, { program_id: @program.id }) do |f| %>
<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">
<%= f.association :person, collection: @available_people %>
</div>
<div class="col-md-6">
<%= f.input :description %>
</div>
</div>
</div>
</div>
<% content_for :action_bar_right do %>
<%= submit f %>
<% end %>
<% end %>
<% if involvements.any? %>
<table class="table table-sortable">
<thead>
<tr>
<th class="ps-0"><%= University::Person.model_name.human %></th>
<th><%= University::Person::Involvement.human_attribute_name('description') %></th>
<th></th>
</tr>
</thead>
<tbody data-reorder-url="<%= reorder_admin_education_program_teachers_path(@program) %>">
<% involvements.each do |involvement| %>
<tr class="handle" data-id="<%= involvement.id %>">
<td class="ps-0">
<%= involvement %>
</td>
<td><%= involvement.description %></td>
<td class="text-end pe-0">
<div class="btn-group" role="group">
<%= link_to t('edit'),
edit_admin_education_program_teacher_path(involvement, { program_id: @program.id }),
class: button_classes if can?(:edit, involvement) %>
<%= link_to t('delete'),
admin_education_program_teacher_path(involvement, { program_id: @program.id }),
method: :delete,
data: { confirm: t('please_confirm') },
class: button_classes_danger if can?(:destroy, involvement) %>
</div>
</td>
</tr>
<% end %>
</tbody>
</table>
<% end %>
<% content_for :title, @involvement %>
<%= render 'form', involvement: @involvement %>
<% content_for :title, Education::Program.human_attribute_name("teachers") %>
<%= link_to t('create'), new_admin_education_program_teacher_path(program_id: @program.id), class: button_classes %>
<%= render 'admin/education/program/teachers/list', involvements: @involvements %>
<% content_for :title, University::Person.model_name.human %>
<%= render 'form', involvement: @involvement %>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment