Commit 4b7a05d3d76b5db686d6a25b7e8a2f0778719ab4
Exists in
master
and in
29 other branches
Merge branch 'x_axis' of gitorious.org:+mezuro/noosfero/mezuro into x_axis
Conflicts: plugins/mezuro/controllers/mezuro_plugin_myprofile_controller.rb plugins/mezuro/controllers/mezuro_plugin_profile_controller.rb plugins/mezuro/lib/mezuro_plugin/helpers/content_viewer_helper.rb plugins/mezuro/views/mezuro_plugin_myprofile/_range_form.html.erb
Showing
2 changed files
with
11 additions
and
9 deletions
Show diff stats
plugins/mezuro/controllers/mezuro_plugin_myprofile_controller.rb
... | ... | @@ -60,7 +60,7 @@ class MezuroPluginMyprofileController < ProfileController |
60 | 60 | redirect_to "/myprofile/#{profile.identifier}/plugin/mezuro/edit_metric_configuration?id=#{id}&metric_name=#{metric_name.gsub(/\s/, '+')}" |
61 | 61 | end |
62 | 62 | end |
63 | - | |
63 | + | |
64 | 64 | def create_compound_metric_configuration |
65 | 65 | id = params[:id] |
66 | 66 | metric_name = params[:metric_configuration][:metric][:name] |
... | ... | @@ -108,33 +108,35 @@ class MezuroPluginMyprofileController < ProfileController |
108 | 108 | redirect_to "/#{profile.identifier}/#{configuration_content.slug}" |
109 | 109 | end |
110 | 110 | end |
111 | - | |
111 | + | |
112 | 112 | def new_range |
113 | 113 | @configuration_content = profile.articles.find(params[:id]) |
114 | 114 | @metric_name = params[:metric_name] |
115 | 115 | @range = Kalibro::Range.new |
116 | + @range_color = "#000000" | |
116 | 117 | end |
117 | - | |
118 | + | |
118 | 119 | def edit_range |
119 | 120 | @configuration_content = profile.articles.find(params[:id]) |
120 | 121 | @metric_name = params[:metric_name] |
121 | 122 | @beginning_id = params[:beginning_id] |
122 | 123 | metric_configuration = Kalibro::MetricConfiguration.find_by_configuration_name_and_metric_name(@configuration_content.name, @metric_name) |
123 | 124 | @range = metric_configuration.ranges.find{|range| range.beginning == @beginning_id.to_f || @beginning_id =="-INF" } |
125 | + @range_color = "#" + @range.color.to_s.gsub(/^ff/, "") | |
124 | 126 | end |
125 | 127 | |
126 | 128 | def create_range |
127 | 129 | @configuration_content = profile.articles.find(params[:id]) |
128 | 130 | @range = Kalibro::Range.new params[:range] |
129 | 131 | metric_name = params[:metric_name] |
130 | - metric_configuration = Kalibro::MetricConfiguration.find_by_configuration_name_and_metric_name(@configuration_content.name, metric_name) | |
132 | + metric_configuration = Kalibro::MetricConfiguration.find_by_configuration_name_and_metric_name(@configuration_content.name, metric_name) | |
131 | 133 | metric_configuration.add_range(@range) |
132 | 134 | metric_configuration.save |
133 | 135 | if metric_configuration_has_errors? metric_configuration |
134 | 136 | redirect_to_error_page metric_configuration.errors[0].message |
135 | 137 | end |
136 | 138 | end |
137 | - | |
139 | + | |
138 | 140 | def update_range |
139 | 141 | configuration_content = profile.articles.find(params[:id]) |
140 | 142 | metric_name = params[:metric_name] |
... | ... | @@ -147,7 +149,7 @@ class MezuroPluginMyprofileController < ProfileController |
147 | 149 | redirect_to_error_page metric_configuration.errors[0].message |
148 | 150 | end |
149 | 151 | end |
150 | - | |
152 | + | |
151 | 153 | def remove_range |
152 | 154 | configuration_content = profile.articles.find(params[:id]) |
153 | 155 | metric_name = params[:metric_name] | ... | ... |
plugins/mezuro/controllers/mezuro_plugin_profile_controller.rb
... | ... | @@ -36,7 +36,7 @@ class MezuroPluginProfileController < ProfileController |
36 | 36 | else |
37 | 37 | render :partial => 'content_viewer/project_result' |
38 | 38 | end |
39 | - end | |
39 | + end | |
40 | 40 | |
41 | 41 | def module_result |
42 | 42 | @content = profile.articles.find(params[:id]) |
... | ... | @@ -87,9 +87,9 @@ class MezuroPluginProfileController < ProfileController |
87 | 87 | render :partial => 'content_viewer/score_history' |
88 | 88 | end |
89 | 89 | end |
90 | - | |
90 | + | |
91 | 91 | private |
92 | - | |
92 | + | |
93 | 93 | def filtering_metric_history(metric_name, module_history) |
94 | 94 | metrics_history = module_history.map do |module_result| |
95 | 95 | [module_result.metric_results, format_date_to_simple_form(module_result.date)] | ... | ... |