show.html.erb
1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<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>