diff --git a/plugins/mezuro/controllers/mezuro_plugin_profile_controller.rb b/plugins/mezuro/controllers/mezuro_plugin_profile_controller.rb index c57402b..3397f43 100644 --- a/plugins/mezuro/controllers/mezuro_plugin_profile_controller.rb +++ b/plugins/mezuro/controllers/mezuro_plugin_profile_controller.rb @@ -56,6 +56,13 @@ class MezuroPluginProfileController < ProfileController @metric_configuration.metric = Kalibro::Entities::NativeMetric.new @metric_configuration.metric.name = "Nome falso" @metric_configuration.metric.origin = "Origem Falsa" + range = Kalibro::Entities::Range.new + range.beginning = "0" + range.end = "100" + range.label = "fake label" + range.grade = "100" + range.color = "FFFFFF" + @metric_configuration.range = [range] end def create_metric_configuration @@ -67,4 +74,17 @@ class MezuroPluginProfileController < ProfileController @configuration_name = params[:configuration_name] redirect_to "/#{profile.identifier}/#{@configuration_name.downcase.gsub(/\s/, '-')}" end + + def new_range + end + + def create_range + @range = Kalibro::Entities::Range.new + @range.beginning = params[:range][:beginning] + @range.end = params[:range][:end] + @range.label = params[:range][:label] + @range.grade = params[:range][:grade] + @range.color = params[:range][:color] + @range.comments = params[:range][:comments] + end end diff --git a/plugins/mezuro/views/mezuro_plugin_profile/_new_range.html.erb b/plugins/mezuro/views/mezuro_plugin_profile/_new_range.html.erb new file mode 100644 index 0000000..0f5cc57 --- /dev/null +++ b/plugins/mezuro/views/mezuro_plugin_profile/_new_range.html.erb @@ -0,0 +1,55 @@ +<% remote_form_for :range, :url => {:action =>"create_range", :controller => "mezuro_plugin_profile"}, :method => :get do |f| %> + <%= hidden_field_tag :configuration_name, @configuration_name %> + <%= hidden_field_tag :metric_name, @metric_name %> +
| + <%= f.label :label, "Label:" %> + | ++ <%= f.text_field :label %> + | +
| + <%= f.label :beginning, "Beginning:" %> + | ++ <%= f.text_field :beginning %> + | +
| + <%= f.label :end, "End:" %> + | ++ <%= f.text_field :end %> + | +
| + <%= f.label :grade, "Grade:" %> + | ++ <%= f.text_field :grade %> + | +
| + <%= f.label :color, "Color:" %> + | ++ <%= f.text_field :color %> + | +
| + <%= f.label :comments, "Comments:" %> + | ++ <%= f.text_field :comments %> + | +
<%= f.submit "Save" %>
- <% end %> + + +| + Label + | ++ Beginning + | ++ End + | ++ Grade + | ++ Color + | +