show.html.erb 1.39 KB
<div class="page-header">
  <h1><%= @kalibro_configuration.name %></h1>
</div>

<p>
  <strong><%= t('description') %>:</strong>
  <%= @kalibro_configuration.description %>
</p>

<hr>
<div id="metrics">
<h2><%= t('metric').pluralize %></h2>
<% if kalibro_configuration_owner? @kalibro_configuration.id %>
  <%= link_to "#{t('add')} #{t('metric')}", kalibro_configuration_choose_metric_path(@kalibro_configuration.id), class: 'btn btn-info' %>
<% end %>

<table class="table table-hover">
  <thead>
    <tr>
      <th><%= t('metric') %></th>
      <th><%= t('code') %></th>
      <th><%= t('weight') %></th>
      <th colspan="3"></th>
    </tr>
  </thead>
  <tbody>
    <% if Rails.cache.read("#{@kalibro_configuration.id}_metric_configurations").empty? %>
      <%= render partial: 'no_metric_configurations' %>
    <% else %>
      <%= render partial: 'metric_configurations', collection: Rails.cache.read("#{@kalibro_configuration.id}_metric_configurations"), as: :metric_configuration %>
    <% end %>
  </tbody>
</table>
</div>

<hr>

<p>
 <%= link_to t('back'), kalibro_configurations_path, class: 'btn btn-default' %>
 <% if kalibro_configuration_owner? @kalibro_configuration.id %>
   <%= link_to t('destroy_configuration'), kalibro_configuration_path(@kalibro_configuration.id), method: :delete, data: { confirm: 'Are you sure that you want to destroy this Configuration?' }, class: 'btn btn-danger' %>
 <% end %>
</p>