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 | 2 | <div class="row margin-left-none"> |
3 | 3 | <div class="form-table col-md-9"> |
4 | 4 | |
5 | 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 | 7 | <% end %> |
8 | 8 | |
9 | 9 | <div class="form-row"> |
... | ... | @@ -18,10 +18,10 @@ |
18 | 18 | </div> |
19 | 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 | 25 | <% else %> |
26 | 26 | <div class="form-row"> |
27 | 27 | <div class="field-container"> |
... | ... | @@ -34,8 +34,8 @@ |
34 | 34 | </p> |
35 | 35 | </div> |
36 | 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 | 39 | <% end %> |
40 | 40 | <%= f.submit t('save'), class: 'btn btn-primary' %> |
41 | 41 | </div> | ... | ... |
app/views/compound_metric_configurations/edit.html.erb
... | ... | @@ -6,7 +6,7 @@ |
6 | 6 | |
7 | 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 | 10 | <%= render partial: 'form', locals: {f: f} %> |
11 | 11 | <% end %> |
12 | 12 | ... | ... |
app/views/compound_metric_configurations/new.html.erb
... | ... | @@ -6,7 +6,7 @@ |
6 | 6 | |
7 | 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 | 10 | <%= render partial: 'form', locals: {f: f} %> |
11 | 11 | <% end %> |
12 | 12 | ... | ... |
app/views/compound_metric_configurations/show.html.erb
1 | 1 | <div class="page-header"> |
2 | - <h1><%=@compound_metric_configuration.metric.name %></h1> | |
2 | + <h1><%=@metric_configuration.metric.name %></h1> | |
3 | 3 | </div> |
4 | 4 | |
5 | 5 | <p> |
6 | 6 | <strong> <%= t('description') %>:</strong> |
7 | - <% if @compound_metric_configuration.metric.description.nil? %> | |
7 | + <% if @metric_configuration.metric.description.nil? %> | |
8 | 8 | <%= t('no_description') %> |
9 | 9 | <% else %> |
10 | - <%= @compound_metric_configuration.metric.description %> | |
10 | + <%= @metric_configuration.metric.description %> | |
11 | 11 | <% end %> |
12 | 12 | </p> |
13 | 13 | |
14 | 14 | <p> |
15 | 15 | <strong> <%= t('script') %>:</strong> |
16 | - <%= @compound_metric_configuration.metric.script %> | |
16 | + <%= @metric_configuration.metric.script %> | |
17 | 17 | </p> |
18 | 18 | |
19 | 19 | <p> |
20 | 20 | <strong> <%= t('scope') %>:</strong> |
21 | - <%= @compound_metric_configuration.metric.scope %> | |
21 | + <%= @metric_configuration.metric.scope %> | |
22 | 22 | </p> |
23 | 23 | |
24 | 24 | <p> |
25 | 25 | <strong> <%= t('code') %>:</strong> |
26 | - <%= @compound_metric_configuration.metric.code %> | |
26 | + <%= @metric_configuration.metric.code %> | |
27 | 27 | </p> |
28 | 28 | |
29 | 29 | <p> |
30 | 30 | <strong> <%= t('weight') %>:</strong> |
31 | - <%= @compound_metric_configuration.weight %> | |
31 | + <%= @metric_configuration.weight %> | |
32 | 32 | </p> |
33 | 33 | |
34 | 34 | <p> |
35 | 35 | <strong> <%= t('metric_configurations_aggregation') %>:</strong> |
36 | - <%= @compound_metric_configuration.aggregation_form %> | |
36 | + <%= @metric_configuration.aggregation_form %> | |
37 | 37 | </p> |
38 | 38 | |
39 | 39 | <p> |
... | ... | @@ -44,9 +44,9 @@ |
44 | 44 | <hr> |
45 | 45 | |
46 | 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 | 50 | <% end %> |
51 | 51 | |
52 | 52 | <table class="table table-hover"> |
... | ... | @@ -69,10 +69,10 @@ |
69 | 69 | <hr> |
70 | 70 | |
71 | 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 | 76 | class: 'btn btn-danger' %> |
77 | 77 | <% end %> |
78 | 78 | </p> | ... | ... |
app/views/metric_configurations/_form.html.erb
app/views/metric_configurations/edit.html.erb
... | ... | @@ -2,7 +2,7 @@ |
2 | 2 | <h1><%= t('editing_metric_configuration') %></h1> |
3 | 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 | 6 | <%= render partial: 'form', locals: {f: f} %> |
7 | 7 | <div class="row margin-left-none" style="margin-top: 20px"> |
8 | 8 | <%= f.submit t('save'), class: 'btn btn-primary' %> | ... | ... |
app/views/metric_configurations/new.html.erb
... | ... | @@ -24,10 +24,10 @@ |
24 | 24 | |
25 | 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 | 28 | <%= render partial: 'form', locals: {f: f} %> |
29 | 29 | <div class="row margin-left-none" style="margin-top: 20px"> |
30 | 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 | 32 | </div> |
33 | 33 | <% end %> | ... | ... |