]> source.dussan.org Git - sonarqube.git/commitdiff
Display alert on quality profile even if user is not logged (regression since 3.3)
authorJulien Lancelot <julien.lancelot@gmail.com>
Fri, 14 Dec 2012 13:56:41 +0000 (14:56 +0100)
committerJulien Lancelot <julien.lancelot@gmail.com>
Fri, 14 Dec 2012 13:56:41 +0000 (14:56 +0100)
sonar-server/src/main/webapp/WEB-INF/app/helpers/alerts_helper.rb
sonar-server/src/main/webapp/WEB-INF/app/views/alerts/_show.html.erb
sonar-server/src/main/webapp/WEB-INF/app/views/alerts/index.html.erb

index fa338a0617b952879f810f19484521601bb16dab..8f43923b641cbb93c0142476dedc845a903e2b1d 100644 (file)
@@ -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
index ed533127abcacd09e8539ec3418ac4426cd9e5b7..5e4a58b27504d8f006d0a0823bd1bf312de71885 100644 (file)
@@ -3,6 +3,9 @@
   <td>
     <%= h alert.name %>
   </td>
+  <td width="10%">
+    <%= period_label(alert) -%>
+  </td>
   <td width="10%">
     <%= message("alerts.operator.#{alert.operator}") -%>
   </td>
index c50067f0e02c736c14fe4c70b6cbffe507fdf636..c672968789d8f44febe00e35eb2c8869cf506c39 100644 (file)
@@ -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>