aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Gageot <david@gageot.net>2012-05-10 13:05:21 +0200
committerDavid Gageot <david@gageot.net>2012-05-10 13:05:21 +0200
commit70d9f756ca3be5630adaa65d26b2f61345bba6d8 (patch)
tree4969a0fea6312d0929268ab7c0ad0a7f3debe489
parentc77fea328729bc374f0151c18ce455dd2ea22357 (diff)
downloadsonarqube-70d9f756ca3be5630adaa65d26b2f61345bba6d8.tar.gz
sonarqube-70d9f756ca3be5630adaa65d26b2f61345bba6d8.zip
SONAR-3457 Show nicer project/filter names. Theses names are also visible in configuration mode.
-rw-r--r--plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/filter.html.erb5
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_configure_widget.html.erb1
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_widget.html.erb5
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_widget_title.html.erb10
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/filters/_treemap.html.erb7
-rw-r--r--sonar-server/src/main/webapp/stylesheets/dashboard.css21
6 files changed, 32 insertions, 17 deletions
diff --git a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/filter.html.erb b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/filter.html.erb
index 5cf4beb02e8..cecb95ce2eb 100644
--- a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/filter.html.erb
+++ b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/filter.html.erb
@@ -3,7 +3,4 @@
@filter_context=Filters.execute(@filter, self, params)
%>
-<div class="filter_widget">
- <div class="filter-title"><%= @filter.name %></div>
- <%= render :partial => "filters/#{@filter.default_view}", :locals => {:edit_mode => false} %>
-</div>
+<%= render :partial => "filters/#{@filter.default_view}", :locals => {:edit_mode => false} %>
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_configure_widget.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_configure_widget.html.erb
index 5a68ada50b7..eafc561b5fc 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_configure_widget.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_configure_widget.html.erb
@@ -25,6 +25,7 @@
<%= render :partial => 'widget_properties', :locals => {:widget => widget} -%>
</div>
+<%= render :partial => 'widget_title', :locals => {:widget => widget} -%>
<div id="widget_<%= widget.id -%>" class="configure_widget <%= h widget.java_definition.getId() -%>" style="height:100%;<%= 'display:none;' if !widget.configured -%>">
<!--[if lte IE 6]>
<style type="text/css">
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 c07a4657feb..6795e8673bd 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
@@ -1,5 +1,7 @@
<% switch_to_widget_resource(widget) %>
+<%= render :partial => 'widget_title', :locals => {:widget => widget} -%>
+
<div class="<%= h widget.key -%>" style="height:100%;">
<% if widget.configured
begin
@@ -15,9 +17,6 @@
if default_layout
%>
<div class="widget">
- <% if !widget.java_definition.global && @dashboard.global %>
- <div class="widget-title"><%= @resource.name if @resource -%></div>
- <% end %>
<% end %>
<%= widget_body -%>
<% if default_layout %>
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_widget_title.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_widget_title.html.erb
new file mode 100644
index 00000000000..e3bf0099291
--- /dev/null
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_widget_title.html.erb
@@ -0,0 +1,10 @@
+<% if @dashboard.global %>
+
+ <% if widget.properties_as_hash['filter'] %>
+ <% filter = ::Filter.find_by_id(widget.properties_as_hash['filter']) %>
+ <div class="widget-title"><%= filter.name if filter -%></div>
+ <% elsif @resource && !widget.java_definition.global %>
+ <div class="widget-title"><%= @resource.name -%></div>
+ <% end %>
+
+<% end %>
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/filters/_treemap.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/filters/_treemap.html.erb
index ad27a953079..9b82a610108 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/filters/_treemap.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/filters/_treemap.html.erb
@@ -1,11 +1,8 @@
<% if @filter.period? %>
<%= message('filters.treemap_not_supported_for_period_selection') -%>
-
<% else %>
- <%
- metrics=treemap_metrics(@filter)
- %>
- <div class="line-block"></div>
+ <% metrics=treemap_metrics(@filter) %>
+
<%= render :partial => 'treemap/treemap_container', :locals => {
:treemap_id => @filter.id,
:size_metric => metrics[0],
diff --git a/sonar-server/src/main/webapp/stylesheets/dashboard.css b/sonar-server/src/main/webapp/stylesheets/dashboard.css
index 98d0172de9b..e8008505aea 100644
--- a/sonar-server/src/main/webapp/stylesheets/dashboard.css
+++ b/sonar-server/src/main/webapp/stylesheets/dashboard.css
@@ -23,6 +23,7 @@
border: 1px solid #ddd;
border-radius: 0 0 3px 3px;
-moz-border-radius: 0 0 3px 3px;
+ -webkit-border-radius: 0 0 3px 3px;
}
#dashboard .block {
@@ -41,12 +42,19 @@
padding: 5px;
border-radius: 0 0 3px 3px;
-moz-border-radius: 0 0 3px 3px;
+ -webkit-border-radius: 0 0 3px 3px;
}
-#dashboard .widget .widget-title {
- font-style: italic;
- font-weight: bold;
- margin-bottom: 10px;
+#dashboard .widget-title {
+ background-color: #4B9FD5;
+ color: #EFEFEF;
+ padding: 3px 0 3px 5px;
+ height: 16px;
+ line-height: 16px;
+ vertical-align: middle;
+ border-radius: 3px 3px 0 0;
+ -moz-border-radius: 3px 3px 0 0;
+ -webkit-border-radius: 3px 3px 0 0;
}
/*CONFIGURATION*/
@@ -60,6 +68,7 @@
background-color: #FFF6BF;
border: 2px solid #FFD324;
padding: 3px;
+ border-radius: 3px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
}
@@ -157,6 +166,7 @@
border: 1px solid #cdcdcd;
padding: 0;
margin: 0;
+ border-radius: 3px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
}
@@ -221,7 +231,7 @@
border-bottom: 0;
border-radius: 3px 3px 0 0;
-moz-border-radius: 3px 3px 0 0;
-
+ -webkit-border-radius: 3px 3px 0 0;
}
#dashboard .widget-handle {
@@ -249,6 +259,7 @@
#dashboard .shadow-block {
box-shadow: 8px 8px 8px #ddd;
+ box-shadow: 8px 8px 8px #ddd;
-moz-box-shadow: 8px 8px 8px #ddd;
-webkit-box-shadow: 8px 8px 8px #ddd;
}