Commit e12536097451b01041a247d91623c4845d0f8a9b
Committed by
Rafael Manzo
1 parent
3c114538
Exists in
colab
and in
4 other branches
Update variable references in MetricConfiguration views before refactor
There will no longer be a @kalibro_configuration_id instance variable, and all the views will use @metric_configuration, with no special cases like Compound previously had. Signed off by: Daniel Miranda <danielkza2@gmail.com>
Showing
7 changed files
with
29 additions
and
29 deletions
Show diff stats
app/views/compound_metric_configurations/_form.html.erb
1 | -<%= render :partial => 'shared/form_errors', :locals => {:object => @compound_metric_configuration} %> | 1 | +<%= render :partial => 'shared/form_errors', :locals => {:object => @metric_configuration} %> |
2 | <div class="row margin-left-none"> | 2 | <div class="row margin-left-none"> |
3 | <div class="form-table col-md-9"> | 3 | <div class="form-table col-md-9"> |
4 | 4 | ||
5 | <%= f.fields_for :metric do |metric| %> | 5 | <%= f.fields_for :metric do |metric| %> |
6 | - <%= render partial: "metric_options", :locals => {:f => metric, :metric => @compound_metric_configuration.metric} %> | 6 | + <%= render partial: "metric_options", :locals => {:f => metric, :metric => @metric_configuration.metric} %> |
7 | <% end %> | 7 | <% end %> |
8 | 8 | ||
9 | <div class="form-row"> | 9 | <div class="form-row"> |
@@ -18,10 +18,10 @@ | @@ -18,10 +18,10 @@ | ||
18 | </div> | 18 | </div> |
19 | </div> | 19 | </div> |
20 | 20 | ||
21 | - <% if @compound_metric_configuration.persisted? %> | ||
22 | - <%= hidden_field_tag(:reading_group_id, @compound_metric_configuration.reading_group_id) %> | ||
23 | - <%= hidden_field_tag(:kalibro_configuration_id, @compound_metric_configuration.kalibro_configuration_id) %> | ||
24 | - <%= link_to t('back'), kalibro_configuration_path(@compound_metric_configuration.kalibro_configuration_id), class: 'btn btn-default' %> | 21 | + <% if @metric_configuration.persisted? %> |
22 | + <%= hidden_field_tag(:reading_group_id, @metric_configuration.reading_group_id) %> | ||
23 | + <%= hidden_field_tag(:kalibro_configuration_id, @metric_configuration.kalibro_configuration_id) %> | ||
24 | + <%= link_to t('back'), kalibro_configuration_path(@metric_configuration.kalibro_configuration_id), class: 'btn btn-default' %> | ||
25 | <% else %> | 25 | <% else %> |
26 | <div class="form-row"> | 26 | <div class="form-row"> |
27 | <div class="field-container"> | 27 | <div class="field-container"> |
@@ -34,8 +34,8 @@ | @@ -34,8 +34,8 @@ | ||
34 | </p> | 34 | </p> |
35 | </div> | 35 | </div> |
36 | </div> | 36 | </div> |
37 | - <%= f.hidden_field(:kalibro_configuration_id, value: @kalibro_configuration_id) %> | ||
38 | - <%= link_to t('back'), kalibro_configuration_path(@kalibro_configuration_id), class: 'btn btn-default' %> | 37 | + <%= f.hidden_field(:kalibro_configuration_id, value: @kalibro_configuration.id) %> |
38 | + <%= link_to t('back'), kalibro_configuration_path(@kalibro_configuration.id), class: 'btn btn-default' %> | ||
39 | <% end %> | 39 | <% end %> |
40 | <%= f.submit t('save'), class: 'btn btn-primary' %> | 40 | <%= f.submit t('save'), class: 'btn btn-primary' %> |
41 | </div> | 41 | </div> |
app/views/compound_metric_configurations/edit.html.erb
@@ -6,7 +6,7 @@ | @@ -6,7 +6,7 @@ | ||
6 | 6 | ||
7 | <br> | 7 | <br> |
8 | 8 | ||
9 | -<%= form_for(@compound_metric_configuration, :url => kalibro_configuration_compound_metric_configuration_update_path(@compound_metric_configuration.kalibro_configuration_id, @compound_metric_configuration.id), method: :put) do |f| %> | 9 | +<%= form_for(@metric_configuration, :url => kalibro_configuration_compound_metric_configuration_update_path(@metric_configuration.kalibro_configuration_id, @metric_configuration.id), method: :put) do |f| %> |
10 | <%= render partial: 'form', locals: {f: f} %> | 10 | <%= render partial: 'form', locals: {f: f} %> |
11 | <% end %> | 11 | <% end %> |
12 | 12 |
app/views/compound_metric_configurations/new.html.erb
@@ -6,7 +6,7 @@ | @@ -6,7 +6,7 @@ | ||
6 | 6 | ||
7 | <br> | 7 | <br> |
8 | 8 | ||
9 | -<%= form_for(@compound_metric_configuration, :url => kalibro_configuration_compound_metric_configurations_path(@kalibro_configuration_id)) do |f| %> | 9 | +<%= form_for(@metric_configuration, :url => kalibro_configuration_compound_metric_configurations_path(@kalibro_configuration.id)) do |f| %> |
10 | <%= render partial: 'form', locals: {f: f} %> | 10 | <%= render partial: 'form', locals: {f: f} %> |
11 | <% end %> | 11 | <% end %> |
12 | 12 |
app/views/compound_metric_configurations/show.html.erb
1 | <div class="page-header"> | 1 | <div class="page-header"> |
2 | - <h1><%=@compound_metric_configuration.metric.name %></h1> | 2 | + <h1><%=@metric_configuration.metric.name %></h1> |
3 | </div> | 3 | </div> |
4 | 4 | ||
5 | <p> | 5 | <p> |
6 | <strong> <%= t('description') %>:</strong> | 6 | <strong> <%= t('description') %>:</strong> |
7 | - <% if @compound_metric_configuration.metric.description.nil? %> | 7 | + <% if @metric_configuration.metric.description.nil? %> |
8 | <%= t('no_description') %> | 8 | <%= t('no_description') %> |
9 | <% else %> | 9 | <% else %> |
10 | - <%= @compound_metric_configuration.metric.description %> | 10 | + <%= @metric_configuration.metric.description %> |
11 | <% end %> | 11 | <% end %> |
12 | </p> | 12 | </p> |
13 | 13 | ||
14 | <p> | 14 | <p> |
15 | <strong> <%= t('script') %>:</strong> | 15 | <strong> <%= t('script') %>:</strong> |
16 | - <%= @compound_metric_configuration.metric.script %> | 16 | + <%= @metric_configuration.metric.script %> |
17 | </p> | 17 | </p> |
18 | 18 | ||
19 | <p> | 19 | <p> |
20 | <strong> <%= t('scope') %>:</strong> | 20 | <strong> <%= t('scope') %>:</strong> |
21 | - <%= @compound_metric_configuration.metric.scope %> | 21 | + <%= @metric_configuration.metric.scope %> |
22 | </p> | 22 | </p> |
23 | 23 | ||
24 | <p> | 24 | <p> |
25 | <strong> <%= t('code') %>:</strong> | 25 | <strong> <%= t('code') %>:</strong> |
26 | - <%= @compound_metric_configuration.metric.code %> | 26 | + <%= @metric_configuration.metric.code %> |
27 | </p> | 27 | </p> |
28 | 28 | ||
29 | <p> | 29 | <p> |
30 | <strong> <%= t('weight') %>:</strong> | 30 | <strong> <%= t('weight') %>:</strong> |
31 | - <%= @compound_metric_configuration.weight %> | 31 | + <%= @metric_configuration.weight %> |
32 | </p> | 32 | </p> |
33 | 33 | ||
34 | <p> | 34 | <p> |
35 | <strong> <%= t('metric_configurations_aggregation') %>:</strong> | 35 | <strong> <%= t('metric_configurations_aggregation') %>:</strong> |
36 | - <%= @compound_metric_configuration.aggregation_form %> | 36 | + <%= @metric_configuration.aggregation_form %> |
37 | </p> | 37 | </p> |
38 | 38 | ||
39 | <p> | 39 | <p> |
@@ -44,9 +44,9 @@ | @@ -44,9 +44,9 @@ | ||
44 | <hr> | 44 | <hr> |
45 | 45 | ||
46 | <h2> <%= t('ranges') %> </h2> | 46 | <h2> <%= t('ranges') %> </h2> |
47 | -<% if kalibro_configuration_owner? @compound_metric_configuration.kalibro_configuration_id %> | ||
48 | - <%= link_to t_action(:add, KalibroRange), kalibro_configuration_metric_configuration_new_kalibro_range_path(@compound_metric_configuration.kalibro_configuration_id, | ||
49 | - @compound_metric_configuration.id), class: 'btn btn-info' %> | 47 | +<% if kalibro_configuration_owner? @metric_configuration.kalibro_configuration_id %> |
48 | + <%= link_to t_action(:add, KalibroRange), kalibro_configuration_metric_configuration_new_kalibro_range_path(@metric_configuration.kalibro_configuration_id, | ||
49 | + @metric_configuration.id), class: 'btn btn-info' %> | ||
50 | <% end %> | 50 | <% end %> |
51 | 51 | ||
52 | <table class="table table-hover"> | 52 | <table class="table table-hover"> |
@@ -69,10 +69,10 @@ | @@ -69,10 +69,10 @@ | ||
69 | <hr> | 69 | <hr> |
70 | 70 | ||
71 | <p> | 71 | <p> |
72 | - <%= link_to t('back'), kalibro_configuration_path(@compound_metric_configuration.kalibro_configuration_id), class: 'btn btn-default' %> | ||
73 | -<% if kalibro_configuration_owner? @compound_metric_configuration.kalibro_configuration_id %> | ||
74 | - <%= link_to t_action(:destroy, MetricConfiguration), kalibro_configuration_metric_configuration_path(@compound_metric_configuration.kalibro_configuration_id, | ||
75 | - @compound_metric_configuration.id), method: :delete, data: { confirm: t('want_destroy_metric_configuration') }, | 72 | + <%= link_to t('back'), kalibro_configuration_path(@metric_configuration.kalibro_configuration_id), class: 'btn btn-default' %> |
73 | +<% if kalibro_configuration_owner? @metric_configuration.kalibro_configuration_id %> | ||
74 | + <%= link_to t_action(:destroy, MetricConfiguration), kalibro_configuration_metric_configuration_path(@metric_configuration.kalibro_configuration_id, | ||
75 | + @metric_configuration.id), method: :delete, data: { confirm: t('want_destroy_metric_configuration') }, | ||
76 | class: 'btn btn-danger' %> | 76 | class: 'btn btn-danger' %> |
77 | <% end %> | 77 | <% end %> |
78 | </p> | 78 | </p> |
app/views/metric_configurations/_form.html.erb
@@ -42,7 +42,7 @@ | @@ -42,7 +42,7 @@ | ||
42 | </p> | 42 | </p> |
43 | </div> | 43 | </div> |
44 | </div> | 44 | </div> |
45 | - <%= f.hidden_field(:kalibro_configuration_id, value: @kalibro_configuration_id) %> | 45 | + <%= f.hidden_field(:kalibro_configuration_id, value: @kalibro_configuration.id) %> |
46 | <% end %> | 46 | <% end %> |
47 | 47 | ||
48 | </div> | 48 | </div> |
app/views/metric_configurations/edit.html.erb
@@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
2 | <h1><%= t('editing_metric_configuration') %></h1> | 2 | <h1><%= t('editing_metric_configuration') %></h1> |
3 | </div> | 3 | </div> |
4 | 4 | ||
5 | -<%= form_for(@metric_configuration, :url => kalibro_configuration_metric_configuration_update_path(@kalibro_configuration_id, @metric_configuration.id), method: :put) do |f| %> | 5 | +<%= form_for(@metric_configuration, :url => kalibro_configuration_metric_configuration_update_path(@kalibro_configuration.id, @metric_configuration.id), method: :put) do |f| %> |
6 | <%= render partial: 'form', locals: {f: f} %> | 6 | <%= render partial: 'form', locals: {f: f} %> |
7 | <div class="row margin-left-none" style="margin-top: 20px"> | 7 | <div class="row margin-left-none" style="margin-top: 20px"> |
8 | <%= f.submit t('save'), class: 'btn btn-primary' %> | 8 | <%= f.submit t('save'), class: 'btn btn-primary' %> |
app/views/metric_configurations/new.html.erb
@@ -24,10 +24,10 @@ | @@ -24,10 +24,10 @@ | ||
24 | 24 | ||
25 | <br> | 25 | <br> |
26 | 26 | ||
27 | -<%= form_for(@metric_configuration, :url => kalibro_configuration_metric_configurations_path(@kalibro_configuration_id)) do |f| %> | 27 | +<%= form_for(@metric_configuration, :url => kalibro_configuration_metric_configurations_path(@kalibro_configuration.id)) do |f| %> |
28 | <%= render partial: 'form', locals: {f: f} %> | 28 | <%= render partial: 'form', locals: {f: f} %> |
29 | <div class="row margin-left-none" style="margin-top: 20px"> | 29 | <div class="row margin-left-none" style="margin-top: 20px"> |
30 | <%= f.submit t('save'), class: 'btn btn-primary' %> | 30 | <%= f.submit t('save'), class: 'btn btn-primary' %> |
31 | - <%= link_to t('back'), kalibro_configuration_choose_metric_path(@kalibro_configuration_id), class: 'btn btn-default' %> | 31 | + <%= link_to t('back'), kalibro_configuration_choose_metric_path(@kalibro_configuration.id), class: 'btn btn-default' %> |
32 | </div> | 32 | </div> |
33 | <% end %> | 33 | <% end %> |