diff options
author | David Gageot <david@gageot.net> | 2012-05-09 16:39:05 +0200 |
---|---|---|
committer | David Gageot <david@gageot.net> | 2012-05-09 16:51:32 +0200 |
commit | 131add4858ec39c78790880bc50f2da4a20b13ee (patch) | |
tree | a951c3a4de60037377bf3b36a5f9f9aa9bb659ea | |
parent | c48688951a43985f3f96f42d6ed68aa61457ac86 (diff) | |
download | sonarqube-131add4858ec39c78790880bc50f2da4a20b13ee.tar.gz sonarqube-131add4858ec39c78790880bc50f2da4a20b13ee.zip |
SONAR-1927 Add resource name in widgets linked to a resource
3 files changed, 12 insertions, 2 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/helpers/dashboard_helper.rb b/sonar-server/src/main/webapp/WEB-INF/app/helpers/dashboard_helper.rb index 2be2647d9f2..73412725de4 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/helpers/dashboard_helper.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/helpers/dashboard_helper.rb @@ -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 diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_widget.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_widget.html.erb index 3c24067b55e..c07a4657feb 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_widget.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_widget.html.erb @@ -15,7 +15,10 @@ 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> diff --git a/sonar-server/src/main/webapp/stylesheets/dashboard.css b/sonar-server/src/main/webapp/stylesheets/dashboard.css index 72302b0dbd8..bbdca6b8a7b 100644 --- a/sonar-server/src/main/webapp/stylesheets/dashboard.css +++ b/sonar-server/src/main/webapp/stylesheets/dashboard.css @@ -43,6 +43,12 @@ -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; |