show.html.erb
2.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<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" %>