From 91fc9b5b2a76ba2457a9a409ce35308e332d13c5 Mon Sep 17 00:00:00 2001 From: simonbrandhof Date: Wed, 20 Oct 2010 15:01:28 +0000 Subject: [PATCH] SONAR-1830 display background color of measures with rating type --- .../WEB-INF/app/helpers/application_helper.rb | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/sonar-server/src/main/webapp/WEB-INF/app/helpers/application_helper.rb b/sonar-server/src/main/webapp/WEB-INF/app/helpers/application_helper.rb index 266997f087e..e46c91ce347 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/helpers/application_helper.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/helpers/application_helper.rb @@ -108,14 +108,17 @@ module ApplicationHelper alert_class='' alert_link = false + style='' if show_alert_status && !measure.alert_status.blank? - alert_class="alert_#{measure.alert_status}" unless measure.metric.val_type==Metric::VALUE_TYPE_LEVEL + alert_class="class='alert_#{measure.alert_status}'" unless measure.metric.val_type==Metric::VALUE_TYPE_LEVEL link_rel=h(measure.alert_text) show_link=true alert_link=true + elsif measure.metric.val_type==Metric::VALUE_TYPE_RATING && measure.color + style = "style='background-color: #{measure.color};padding: 2px 5px'" end - html="#{html}" + html="#{html}" if metric_name html="#{html} #{metric_name}" end @@ -255,14 +258,18 @@ module ApplicationHelper alert_class='' alert_link = false - unless m.alert_status.blank? - alert_class="alert_#{m.alert_status}" unless m.metric.val_type==Metric::VALUE_TYPE_LEVEL + style = '' + if !(m.alert_status.blank?) + alert_class="class='alert_#{m.alert_status}'" unless m.metric.val_type==Metric::VALUE_TYPE_LEVEL link_rel=h(m.alert_text) show_link=true alert_link = true + + elsif m.metric.val_type==Metric::VALUE_TYPE_RATING && m.color + style = "style='background-color: #{m.color};padding: 2px 5px'" end - html="#{html}" + html="#{html}" if options[:prefix] html="#{options[:prefix]}#{html}" end -- 2.39.5