Commit d3747526fdcb2066fe8d7e05733eb9173d0e2010
Committed by
fllsouto
1 parent
4223992a
Exists in
colab
and in
4 other branches
Making the metric configuration form view conform to the tooltips specification.
signed-off-by: Pedro Paulo Vezza Campos <pedro@vezza.com.br>
Showing
3 changed files
with
66 additions
and
24 deletions
Show diff stats
app/views/metric_configurations/_form.html.erb
| 1 | 1 | <%= render :partial => 'shared/form_errors', :locals => {:object => @metric_configuration} %> |
| 2 | 2 | |
| 3 | -<div class="form-group"> | |
| 4 | - <%= f.label :code, class: 'control-label' %> | |
| 5 | - <%= f.text_field :code, class: 'form-control' %> | |
| 6 | -</div> | |
| 3 | +<div class="row margin-left-none"> | |
| 4 | + <div class="form-table span9"> | |
| 7 | 5 | |
| 8 | -<div class="form-group"> | |
| 9 | - <%= f.label :weight, class: 'control-label' %> | |
| 10 | - <%= f.text_field :weight, class: 'form-control' %> | |
| 11 | -</div> | |
| 6 | + <div class="form-row"> | |
| 7 | + <div class="field-container"> | |
| 8 | + <%= f.label :code, class: 'control-label' %> | |
| 9 | + <%= f.text_field :code, class: 'text-field' %> | |
| 10 | + </div> | |
| 11 | + <div class="help-container"> | |
| 12 | + <p> | |
| 13 | + Code it is a variable that holds the value of a metric analysis. It's used inside a compound metric | |
| 14 | + </p> | |
| 15 | + <p> | |
| 16 | + Example : | |
| 17 | + Code foo := 10 | |
| 18 | + </p> | |
| 19 | + </div> | |
| 20 | + </div> | |
| 12 | 21 | |
| 13 | -<div class="form-group"> | |
| 14 | - <%= f.label :aggregation_form, 'Aggregation Form', class: 'control-label' %> | |
| 15 | - <%= f.select( :aggregation_form, aggregation_options, {class: 'form-control'} ) %> | |
| 16 | -</div> | |
| 22 | + <div class="form-row"> | |
| 23 | + <div class="field-container"> | |
| 24 | + <%= f.label :weight, class: 'control-label' %> | |
| 25 | + <%= f.text_field :weight, class: 'text-field' %> | |
| 26 | + </div> | |
| 27 | + <div class="help-container"> | |
| 28 | + <p> | |
| 29 | + It's the weight of the metric | |
| 30 | + </p> | |
| 31 | + </div> | |
| 32 | + </div> | |
| 33 | + | |
| 34 | + <div class="form-row"> | |
| 35 | + <div class="field-container"> | |
| 36 | + <%= f.label :aggregation_form, 'Aggregation Form', class: 'control-label' %> | |
| 37 | + <%= f.select( :aggregation_form, aggregation_options, {class: 'form-control'} ) %> | |
| 38 | + </div> | |
| 39 | + <div class="help-container"> | |
| 40 | + <p> | |
| 41 | + It's the aggregation form of the metric | |
| 42 | + </p> | |
| 43 | + </div> | |
| 44 | + </div> | |
| 45 | + | |
| 46 | + <% if @metric_configuration.persisted? %> | |
| 47 | + <%= hidden_field_tag(:reading_group_id, @metric_configuration.reading_group_id) %> | |
| 48 | + <% else %> | |
| 49 | + <div class="form-row"> | |
| 50 | + <div class="field-container"> | |
| 51 | + <%= f.label :reading_group_id, 'Reading Group', class: 'control-label' %> | |
| 52 | + <%= f.select( :reading_group_id, reading_group_options, {class: 'form-control'} ) %> | |
| 53 | + </div> | |
| 54 | + <div class="help-container"> | |
| 55 | + <p> | |
| 56 | + The reading group that is associated with this metric | |
| 57 | + </p> | |
| 58 | + </div> | |
| 59 | + </div> | |
| 60 | + <% end %> | |
| 17 | 61 | |
| 18 | -<% if @metric_configuration.persisted? %> | |
| 19 | - <%= hidden_field_tag(:reading_group_id, @metric_configuration.reading_group_id) %> | |
| 20 | -<% else %> | |
| 21 | - <div class="form-group"> | |
| 22 | - <%= f.label :reading_group_id, 'Reading Group', class: 'control-label' %> | |
| 23 | - <%= f.select( :reading_group_id, reading_group_options, {class: 'form-control'} ) %> | |
| 24 | 62 | </div> |
| 25 | -<% end %> | |
| 63 | +</div> | |
| 26 | 64 | |
| 27 | 65 | <%= hidden_field_tag(:metric_name, @metric_configuration.metric.name) %> |
| 28 | 66 | <%= hidden_field_tag(:base_tool_name, @metric_configuration.base_tool_name) %> |
| 29 | - | |
| 30 | -<br> | |
| 31 | -<%= f.submit 'Save', class: 'btn btn-primary' %> | ... | ... |
app/views/metric_configurations/edit.html.erb
| ... | ... | @@ -4,5 +4,8 @@ |
| 4 | 4 | |
| 5 | 5 | <%= form_for(@metric_configuration, :url => mezuro_configuration_metric_configuration_update_url(@mezuro_configuration_id, @metric_configuration.id), method: :put) do |f| %> |
| 6 | 6 | <%= render partial: 'form', locals: {f: f} %> |
| 7 | - <%= link_to 'Back', mezuro_configuration_path(@metric_configuration.configuration_id), class: 'btn btn-default' %> | |
| 7 | + <div class="row margin-left-none" style="margin-top: 20px"> | |
| 8 | + <%= f.submit 'Save', class: 'btn btn-primary' %> | |
| 9 | + <%= link_to 'Back', mezuro_configuration_path(@metric_configuration.configuration_id), class: 'btn btn-default' %> | |
| 10 | + </div> | |
| 8 | 11 | <% end %> | ... | ... |
app/views/metric_configurations/new.html.erb
| ... | ... | @@ -23,5 +23,9 @@ |
| 23 | 23 | |
| 24 | 24 | <%= form_for(@metric_configuration, :url => mezuro_configuration_metric_configurations_path(@metric_configuration.configuration_id)) do |f| %> |
| 25 | 25 | <%= render partial: 'form', locals: {f: f} %> |
| 26 | - <%= link_to 'Back', mezuro_configuration_choose_metric_path(@metric_configuration.configuration_id), class: 'btn btn-default' %> | |
| 26 | + <div class="row margin-left-none" style="margin-top: 20px"> | |
| 27 | + <%= f.submit 'Save', class: 'btn btn-primary' %> | |
| 28 | + <%= link_to 'Back', mezuro_configuration_choose_metric_path(@metric_configuration.configuration_id), class: 'btn btn-default' %> | |
| 29 | + </div> | |
| 30 | + | |
| 27 | 31 | <% end %> | ... | ... |