]> source.dussan.org Git - sonarqube.git/commitdiff
Display widget title for filter widgets added to project dashboard
authorDavid Gageot <david@gageot.net>
Mon, 21 May 2012 14:11:02 +0000 (16:11 +0200)
committerDavid Gageot <david@gageot.net>
Mon, 21 May 2012 14:24:35 +0000 (16:24 +0200)
sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_widget_title.html.erb

index e4c262908e12cd8d2cdc0cbd553356d668830e04..ce1adbd2c335bb63272938e1d0ad0b9a9e9ebb5a 100644 (file)
@@ -1,17 +1,13 @@
-<% if @dashboard.global %>
-
-  <% if widget.properties_as_hash['filter'] %>
-    <% filter = ::Filter.find_by_id(widget.properties_as_hash['filter']) %>
-    <div class="widget-title" id="widget_title_<%= widget.id -%>">
-      <% if filter %>
-        <%= filter.name -%>
-        <% if filter.period_index %>
-          (<%= period_names[filter.period_index-1] -%>)
-        <% end %>
+<% if widget.properties_as_hash['filter'] %>
+  <% filter = ::Filter.find_by_id(widget.properties_as_hash['filter']) %>
+  <div class="widget-title" id="widget_title_<%= widget.id -%>">
+    <% if filter %>
+      <%= filter.name -%>
+      <% if filter.period_index %>
+        (<%= period_names[filter.period_index-1] -%>)
       <% end %>
-    </div>
-  <% elsif @resource && !widget.java_definition.global %>
-    <div class="widget-title"><%= @resource.name -%></div>
-  <% end %>
-
+    <% end %>
+  </div>
+<% elsif @dashboard.global and @resource and !widget.java_definition.global %>
+  <div class="widget-title"><%= @resource.name -%></div>
 <% end %>