Skip to content
Snippets Groups Projects
Commit 6eadbc1f authored by pabois's avatar pabois
Browse files

Merge branch 'master' of github.com:noesya/osuny

parents 6cdf6220 4fb21f3c
No related branches found
No related tags found
No related merge requests found
<%= 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>
......
<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 %>
......@@ -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")
......
......@@ -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 %>
---
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