_form.html.erb
3.13 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
<%= render :partial => 'shared/form_errors', :locals => {:object => @kalibro_range} %>
<div class="row margin-left-none">
<div class="form-table col-md-9">
<div class="form-row">
<% if @readings.size == 0 %>
<%= render partial: 'no_readings' %>
<% else %>
<div class="field-container">
<%= f.label :reading_id, t('reading'), class: 'control-label' %>
<%= f.select( :reading_id, readings_options(@readings), {class: 'form-control'} ) %>
</div>
<div class="help-container">
<p>
<%= t_hint('reading', 'kalibro_range',
reading_href: link_to(t('reading'), "http://mezuro.github.io/tutorial/2016/04/04/tutorial-keywords.html#reading", target: "_blank"),
range_href: link_to(KalibroRange.model_name.human, "http://mezuro.github.io/tutorial/2016/04/04/tutorial-keywords.html#range", target: "_blank")
).html_safe
%>
</p>
</div>
<% end %>
</div>
<div class="form-row">
<div class="field-container" >
<%= f.label :beginning, class: 'control-label' %>
<div class="input-group">
<%= f.text_field :beginning, :required => true, class: 'diminished-text-field form-control' %>
<span class="input-group-btn">
<%= link_to '-∞'.html_safe, 'javascript:void(0)', :onClick => "jQuery( '#kalibro_range_beginning' ).val('-INF');", class: 'btn btn-default' %>
</span>
</div>
</div>
<div class="help-container">
<p>
<%= t_hint('beginning', 'kalibro_range') %>
</p>
</div>
</div>
<div class="form-row">
<div class="field-container">
<%= f.label :end, class: 'control-label' %>
<div class="input-group">
<%= f.text_field :end, :required => true, class: 'diminished-text-field form-control' %>
<span class="input-group-btn">
<%= link_to '∞'.html_safe, 'javascript:void(0)', :onClick => "jQuery( '#kalibro_range_end' ).val('INF');", class: 'btn btn-default align-button' %>
</span>
</div>
</div>
<div class="help-container">
<p>
<%= t_hint('end', 'kalibro_range') %>
</p>
</div>
</div>
<div class="form-row">
<div class="field-container">
<%= f.label :comments, class: 'control-label' %>
<%= f.text_area :comments, class: 'text-area form-control' %>
</div>
<div class="help-container">
<p>
<%= t_hint('comments', 'kalibro_range', metric_href: link_to(t('metric'), "http://mezuro.github.io/tutorial/2016/04/04/tutorial-keywords.html#metric", target: "_blank")).html_safe %>
</p>
</div>
</div>
</div>
</div>
<div class="row margin-left-none" style="margin-top: 20px">
<%= f.submit t('save'), class: 'btn btn-primary' %>
<%= link_to t('back'), kalibro_configuration_metric_configuration_path(@kalibro_configuration_id, @metric_configuration_id), class: 'btn btn-default' %>
</div>