]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-1927 Add resource name in widgets linked to a resource
authorDavid Gageot <david@gageot.net>
Wed, 9 May 2012 14:39:05 +0000 (16:39 +0200)
committerDavid Gageot <david@gageot.net>
Wed, 9 May 2012 14:51:32 +0000 (16:51 +0200)
sonar-server/src/main/webapp/WEB-INF/app/helpers/dashboard_helper.rb
sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_widget.html.erb
sonar-server/src/main/webapp/stylesheets/dashboard.css

index 2be2647d9f2138993ff1b6cd8c24af21b73ddf02..73412725de4a84a87ce1d4b82e51f95578e678eb 100644 (file)
@@ -99,7 +99,8 @@ module DashboardHelper
     if widget.resource_id
       widget_resource = Project.find_by_id(widget.resource_id)
       if widget_resource
-        @project = @resource = widget_resource
+        @resource = widget_resource
+        @project = @resource
         @snapshot=@resource.last_snapshot
         @dashboard_configuration=Api::DashboardConfiguration.new(@dashboard, :period_index => params[:period], :snapshot => @snapshot)
       end
index 3c24067b55e8c8a1080f6558e1fb244cde00420f..c07a4657febf3a233284e2ed9129c70c1c477b98 100644 (file)
          if default_layout
       %>
         <div class="widget">
-      <% end %>
+          <% if !widget.java_definition.global && @dashboard.global %>
+            <div class="widget-title"><%= @resource.name if @resource -%></div>
+          <% end %>
+    <% end %>
       <%= widget_body -%>
       <% if default_layout %>
         <div class="clear"></div>
index 72302b0dbd8153511dc357ebc6f977cdac79e872..bbdca6b8a7ba46b06e024b69e9d90014f00ee0b6 100644 (file)
   -moz-border-radius: 0 0 3px 3px;
 }
 
+#dashboard .widget .widget-title {
+    font-style: italic;
+    font-weight: bold;
+    margin-bottom: 10px;
+}
+
 /*CONFIGURATION*/
 #dashboard #configure {
     position: relative;