noesya/osuny

View on GitHub
app/views/admin/education/programs/parts/pedagogy.html.erb

Summary

Maintainability
Test Coverage
<% content_for :title, @l10n %>

<p class="lead mb-5"><%= t('education.program.parts.pedagogy.hint') %>

<div class="row">
  <%
  [
    :content,
    :pedagogy,
    :evaluation,
    :opportunities,
    :results
  ].each do |property| %>
    <div class="col-xxl-4 col-md-6 mb-4">
      <%= render 'admin/application/property/text', object: @l10n, property: property %>
    </div>
  <% end %>
</div>

<%= osuny_label t('education.teachings') %>
<% if @teacher_involvements.any? %>
  <div class="row g-2 mb-3">
    <% @teacher_involvements.each do |involvement|
        person = involvement.person
        involvement_l10n = involvement.best_localization_for(current_language) %>
      <div>
        <div class="card card--horizontal">
          <%= osuny_thumbnail_localized person %>
          <div class="card-body">
            <%= osuny_link_localized_if can?(:read, person),
                                        person,
                                        admin_education_teacher_path(person) %>
          </div>
          <div class="card-footer">
            <%= involvement_l10n.description %>
          </div>
        </div>
      </div>
    <% end %>
  </div>
<% else %>
  <p>-</p>
<% end %>

<% content_for :action_bar_right do %>
  <%= link_to_if  can?(:edit, @program),
                  t('edit'),
                  edit_pedagogy_admin_education_program_path(@program),
                  class: button_classes %>
<% end %>