noesya/osuny

View on GitHub
app/views/admin/education/diplomas/show.html.erb

Summary

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

<div class="row">
  <div class="col-lg-4">
    <%= osuny_panel Education::Diploma::Localization.human_attribute_name('name'), small: true do %>
      <p class="lead"><%= @l10n.name %></p>
    <% end %>
  </div>
  <div class="col-lg-8">
    <%= render 'admin/application/summary/show', about: @l10n, small: true %>
  </div>
</div>

<div class="row">
  <div class="col-lg-4">
    <h2 class="h4">Informations administratives</h2>
  </div>
  <div class="col-lg-8">
    <% if @diploma.certification.present? %>
      <div class="mb-4">
        <%= image_tag @diploma.certification_icon_path, width: 150 %>
      </div>
    <% end %>
    <table class="table">
      <tbody>
        <tr>
          <th><%= osuny_label Education::Diploma.human_attribute_name('level') %></th>
          <td class="text-end"><%= @diploma.level_i18n %></td>
        </tr>
        <tr>
          <th><%= osuny_label Education::Diploma.human_attribute_name('ects') %></th>
          <td class="text-end"><%= @diploma.ects %></td>
        </tr>
        <tr>
          <th><%= osuny_label Education::Diploma::Localization.human_attribute_name('duration') %></th>
          <td class="text-end"><%= @l10n.duration %></td>
        </tr>
        <tr>
          <th><%= osuny_label Education::Diploma::Localization.human_attribute_name('short_name') %></th>
          <td class="text-end"><%= @l10n.short_name %></td>
        </tr>
      </tbody>
    </table>
  </div>
</div>

<%= render 'admin/communication/contents/editor', about: @l10n %>

<%= osuny_separator %>

<%= osuny_label t('admin.education.diplomas.fields_for_programs') %>
<div class="row">
  <%
  [
    :pedagogy,
    :evaluation,
    :prerequisites,
    :registration,
    :other,
    :pricing,
    :pricing_initial,
    :pricing_continuing,
    :pricing_apprenticeship,
    :accessibility,
    :contacts
  ].each do |property| 
    value = @l10n.send property
    %>
    <div class="col-xxl-4 col-md-6 mb-4">
      <%= osuny_label Education::Diploma::Localization.human_attribute_name(property) %>
      <% if value.blank? %>
        <p>-</p>
      <% else %>
        <%= sanitize value %>
      <% end %>
    </div>
  <% end %>
</div>

<h2 class="h4 mt-5"><%= Education::Program.model_name.human(count: 2) %></h2>
<%= render 'admin/education/programs/list', programs: @programs, hide_diploma: true %>

<% content_for :action_bar_left do %>
  <%= destroy_link @diploma %>
  <%= static_link static_admin_education_diploma_path(@diploma) %>
<% end %>

<% content_for :action_bar_right do %>
  <%= edit_link @diploma %>
<% end %>