show.html.erb 2.39 KB
<div class="page-header">
  <h1><%=@metric_configuration.metric.name %></h1>
</div>

<p>
  <strong><%= t('metric_base_tool_name') %>:</strong>
  <%= @metric_configuration.metric.metric_collector_name %>
</p>

<p>
  <strong><%= t('code') %>:</strong>
  <%= @metric_configuration.metric.code %>
</p>

<p>
  <strong><%= t('weight') %>:</strong>
  <%= @metric_configuration.weight %>
</p>

<p>
  <strong><%= t('language') %>:</strong>
  <%= @metric_configuration.metric.languages %>
</p>

<p>
  <strong><%= t('metric_scope') %>:</strong>
  <%= t(@metric_configuration.metric.scope.to_s, scope: 'scopes') %>
</p>

<p>
  <strong><%= t('metric_aggregation_form') %>:</strong>
  <%=
    f = @metric_configuration.aggregation_form
    t(f, scope: 'aggregation_forms', default: f)
  %>
</p>

<p>
  <strong><%= t('reading_group_name') %>:</strong>
  <%= @reading_group.name %>
</p>

<p>
  <strong><%= t('description') %>:</strong>
  <% if @metric_configuration.metric.description.blank? %>
    <%= t('no_description_available') %>
  <% else %>
    <%= @metric_configuration.metric.description %>
  <% end %>

</p>
<hr>

<h2><%= KalibroRange.model_name.human(count: 2) %></h2>
<% if kalibro_configuration_owner? @metric_configuration.kalibro_configuration_id %>
  <%= link_to t_action(:add, KalibroRange), kalibro_configuration_metric_configuration_new_kalibro_range_path(@metric_configuration.kalibro_configuration_id,
      @metric_configuration.id), class: 'btn btn-info' %>
<% end %>

<table class="table table-hover">
  <thead>
    <tr>
      <th><%= t('label') %></th>
      <th><%= t('beginning') %></th>
      <th><%= t('end') %></th>
    </tr>
  </thead>
  <tbody>
    <% if @kalibro_ranges.empty? %>
      <%= render partial: 'no_ranges' %>
    <% else %>
      <%= render partial: 'ranges', collection: @kalibro_ranges, as: :kalibro_range %>
    <% end %>
  </tbody>
</table>

<p>
 <%= link_to t('back'), kalibro_configuration_path(@metric_configuration.kalibro_configuration_id), class: 'btn btn-default' %>
<% if kalibro_configuration_owner? @metric_configuration.kalibro_configuration_id %>
      <%= link_to t_action(:destroy, MetricConfiguration), kalibro_configuration_metric_configuration_path(@metric_configuration.kalibro_configuration_id,
      @metric_configuration.id), method: :delete, data: { confirm: t('want_destroy_metric_configuration') },
      class: 'btn btn-danger' %>
 <% end %>
</p>


<%= javascript_include_tag "popover.js" %>