From 2a37004125cdcae3aced2c0c20a90c92afb1dabc Mon Sep 17 00:00:00 2001 From: Julien Lancelot Date: Fri, 14 Dec 2012 14:56:41 +0100 Subject: [PATCH] Display alert on quality profile even if user is not logged (regression since 3.3) --- .../src/main/webapp/WEB-INF/app/helpers/alerts_helper.rb | 9 +++++++++ .../main/webapp/WEB-INF/app/views/alerts/_show.html.erb | 3 +++ .../main/webapp/WEB-INF/app/views/alerts/index.html.erb | 4 +++- 3 files changed, 15 insertions(+), 1 deletion(-) 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 %> -- 2.39.5