aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@gmail.com>2012-12-14 14:56:41 +0100
committerJulien Lancelot <julien.lancelot@gmail.com>2012-12-14 14:56:41 +0100
commit2a37004125cdcae3aced2c0c20a90c92afb1dabc (patch)
tree82d491b4398b5bf5c399da0576a40f4208d5f8b7
parent076c185acf13a5a98d54ffb8b9bcffe4d82e437e (diff)
downloadsonarqube-2a37004125cdcae3aced2c0c20a90c92afb1dabc.tar.gz
sonarqube-2a37004125cdcae3aced2c0c20a90c92afb1dabc.zip
Display alert on quality profile even if user is not logged (regression since 3.3)
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/helpers/alerts_helper.rb9
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/alerts/_show.html.erb3
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/alerts/index.html.erb4
3 files changed, 15 insertions, 1 deletions
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
+ "&Delta; #{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
@@ -4,6 +4,9 @@
<%= h alert.name %>
</td>
<td width="10%">
+ <%= period_label(alert) -%>
+ </td>
+ <td width="10%">
<%= message("alerts.operator.#{alert.operator}") -%>
</td>
<td width="20%">
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 @@
<tr class="<%= cycle('even','odd') -%>">
<td id="row_alert_<%= alert.id -%>">
<% if is_admin? %>
- <%= render :partial => 'edit', :locals => {:alert => alert} %>
+ <%= render :partial => 'edit', :locals => {:alert => alert} %>
+ <% else %>
+ <%= render :partial => 'show', :locals => {:alert => alert} %>
<% end %>
</td>
</tr>