Commit ec7d4270e0e8b9edd2fcb9a2f3f4ef04b2ee90e5

Authored by Caio Salgado + Alessandro Palmeira
Committed by João da Silva
1 parent 4b33b10a

[Mezuro] trying to fix compound metrics edition

plugins/mezuro/views/mezuro_plugin_myprofile/edit_compound_metric_configuration.html.erb
1 1 <h2><%= @configuration_name %> Configuration</h2>
2 2  
3   -<% form_for :metric_configuration, :url => {:action =>"update_compound_metric_configuration", :controller => "mezuro_plugin_myprofile"}, :method => :get do |f| %>
  3 +<% form_for @metric_configuration, :url => {:action =>"update_compound_metric_configuration", :controller => "mezuro_plugin_myprofile"}, :method => :get do |f| %>
4 4 <%= hidden_field_tag :configuration_name, @configuration_name %>
5   - <%= hidden_field_tag :scope, @metric.scope %>
6   -
7 5 <p>
8   - <%= f.label :metric_name, "Metric Name:" %>
9   - <%= @metric.name %>
10   - <%= hidden_field_tag "metric[name]", @metric.name %>
11   - </p>
12   - <p>
13   - <%= f.label :description, "Description:" %>
14   - <%= text_field_tag "metric[description]", @metric.description %>
15   - </p>
16   - <p>
17   - <%= f.label :scope, "Scope:" %>
18   - <%= select_tag "metric[scope]", options_for_select([["Teste", "NIL"], ["Class", "CLASS"]], :selected => @metric.scope) %>
19   - </p>
  6 + <%= "Metric Name:" + @metric.name %>
  7 + </p>
  8 + <% f.fields_for :metric do |m| %>
  9 + <%= m.hidden_field :name, :value => @metric.name %>
  10 + <p>
  11 + <%= m.label :description, "Description:" %>
  12 + <%= m.text_field "description" %>
  13 + </p>
  14 + <p>
  15 + <%= m.label :scope, "Scope:" %>
  16 + <%= m.select :scope, [["Teste", "NIL"], ["Class", "CLASS"]] %>
  17 + </p>
  18 + <p>
  19 + <%= m.label :script, "Script:" %>
  20 + <%= m.text_area "script" %>
  21 + </p>
  22 + <% end %>
20 23 <p>
21 24 <%= f.label :code, "Code:" %>
22   - <%= text_field_tag "metric[code]", @metric_configuration.code %>
  25 + <%= f.text_field "code" %>
23 26 </p>
24 27 <p>
25 28 <%= f.label :aggregation_form, "Aggregation Form:" %>
... ... @@ -30,12 +33,6 @@
30 33 <%= f.label :weight, "Weight:" %>
31 34 <%= f.text_field :weight %>
32 35 </p>
33   -
34   - <p>
35   - <%= f.label :script, "Script:" %>
36   - <%= text_area_tag "metric[script]", @metric.script %>
37   - </p>
38   -
39 36 <p>
40 37 <%= f.submit "Save" %>
41 38 </p>
... ...