_metric_options.html.erb
2.3 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
<div class="form-row">
<div class="field-container">
<%= f.label :name, compound_metric_human_attribute_name('name'), class: 'control-label' %>
<%= f.text_field :name, :required => true, class: 'text-field form-control', value: (metric.name unless metric.nil?) %>
</div>
<div class="help-container">
<p>
<%= t_hint(:name) %>
</p>
</div>
</div>
<div class="form-row">
<div class="field-container">
<%= f.label :description, compound_metric_human_attribute_name('description'), class: 'control-label' %>
<%= f.text_field :description, class: 'text-field form-control', value: (metric.description unless metric.nil?) %>
</div>
<div class="help-container">
<p>
<%= t_hint(:description) %>
</p>
</div>
</div>
<div class="form-row">
<div class="field-container">
<%= f.label :script, compound_metric_human_attribute_name('script'), class: 'control-label' %>
<%= f.text_area :script, :required => true, class: 'text-area form-control', value: (metric.script unless metric.nil?) %>
</div>
<div class="help-container">
<p>
<%= t_hint(:script) %>
</p>
</div>
</div>
<div class="form-row">
<div class="field-container">
<%= f.fields_for :scope do |scope_form| %>
<%= scope_form.label :type, compound_metric_human_attribute_name('scope'), class: 'control-label' %>
<%= scope_form.select( :type, scope_options, {class: 'form-control', selected: (metric.scope.type unless metric.nil?)} ) %>
<% end %>
</div>
<div class="help-container">
<p>
<%= t_hint(:scope) %>
</p>
</div>
</div>
<div class="form-row">
<div class="field-container">
<%= f.label :code, compound_metric_human_attribute_name('code'), class: 'control-label' %>
<%= f.text_field :code, :required => true, class: 'text-field form-control', value: (metric.code unless metric.nil?) %>
</div>
<div class="help-container">
<p>
<%= t_hint('code.description') %>
</p>
<br>
<p>
<%= t_hint('code.example') %>
</p>
</div>
</div>
<%= f.hidden_field(:compound, { value: "true"}) %>