noesya/osuny

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

Summary

Maintainability
Test Coverage
<%
  hide_diploma ||= false
  hide_parent ||= false
%>
<div class="row g-2 mb-3">
  <%
  programs.each do |program|
    parent = program.parent
    diploma = program.diploma
    %>
    <div>
      <div class="<%= osuny_card_classes(horizontal: true) %>">
        <%= osuny_thumbnail_localized program %>
        <div class="card-body">
          <%= osuny_published_localized program %>
          <%= osuny_link_localized program, [:admin, program], classes: 'stretched-link' %>
          <% if !hide_parent && parent.present? %>
            <br>
            <span class="small text-muted">
              <%= parent.best_localization_for(current_language) %>
            </span>
          <% end %>
        </div>
        <% if !hide_diploma && diploma.present? %>
          <div class="card-footer">
            <%= diploma.best_localization_for(current_language).short_name %>
          </div>
        <% end %>
      </div>
    </div>
  <% end %>
</div>