From: Julien Lancelot Date: Fri, 14 Dec 2012 13:56:41 +0000 (+0100) Subject: Display alert on quality profile even if user is not logged (regression since 3.3) X-Git-Tag: 3.4~31^2~1 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=2a37004125cdcae3aced2c0c20a90c92afb1dabc;p=sonarqube.git Display alert on quality profile even if user is not logged (regression since 3.3) --- diff --git a/sonar-server/src/main/webapp/WEB-INF/app/helpers/alerts_helper.rb b/sonar-server/src/main/webapp/WEB-INF/app/helpers/alerts_helper.rb index fa338a0617b..8f43923b641 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/helpers/alerts_helper.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/helpers/alerts_helper.rb @@ -109,4 +109,13 @@ module AlertsHelper end end + def period_label(alert) + index = alert.period + if index + "Δ #{Api::Utils.period_label(index)}" + else + "#{message('value')}" + end + end + end \ No newline at end of file diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/alerts/_show.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/alerts/_show.html.erb index ed533127abc..5e4a58b2750 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/alerts/_show.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/alerts/_show.html.erb @@ -3,6 +3,9 @@ <%= h alert.name %> + + <%= period_label(alert) -%> + <%= message("alerts.operator.#{alert.operator}") -%> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/alerts/index.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/alerts/index.html.erb index c50067f0e02..c672968789d 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/alerts/index.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/alerts/index.html.erb @@ -20,7 +20,9 @@ <% if is_admin? %> - <%= render :partial => 'edit', :locals => {:alert => alert} %> + <%= render :partial => 'edit', :locals => {:alert => alert} %> + <% else %> + <%= render :partial => 'show', :locals => {:alert => alert} %> <% end %>