]> source.dussan.org Git - sonarqube.git/commitdiff
improve the display of dashboard in the context nav
authorStas Vilchik <vilchiks@gmail.com>
Tue, 17 Mar 2015 12:45:53 +0000 (13:45 +0100)
committerStas Vilchik <vilchiks@gmail.com>
Tue, 17 Mar 2015 12:45:53 +0000 (13:45 +0100)
server/sonar-web/src/main/hbs/nav/nav-context-navbar.hbs
server/sonar-web/src/main/js/nav/context-navbar-view.js
server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboards/_my_dashboards.html.erb
sonar-core/src/main/resources/org/sonar/l10n/core.properties

index 0239245f9ee6727d63f821297623b85a91abb18f..eaa48a1d8a011af93ec14bce9d7f5a91b116b557 100644 (file)
       <a class="dropdown-toggle" data-toggle="dropdown" href="#">{{t 'more'}}&nbsp;<i class="icon-dropdown"></i></a>
       <ul class="dropdown-menu">
         <li class="dropdown-header">{{t 'layout.dashboards'}}</li>
-        {{#each contextDashboards}}
+        {{#withoutFirst contextDashboards}}
           <li>
             <a href="{{link url}}">{{name}}</a>
           </li>
-        {{/each}}
+        {{/withoutFirst}}
         {{#if canManageContextDashboards}}
           <li class="small-divider"></li>
           <li>
index e52a490eb204fed1f0c84975c3834671bd287127..ddf73914459817ae73f6d61bd44a4bd787d6945b 100644 (file)
@@ -58,7 +58,7 @@ define([
               href.indexOf('/component_issues') === -1;
 
       return _.extend(Marionette.Layout.prototype.serializeData.apply(this, arguments), {
-        canManageContextDashboards: window.SS.user != null,
+        canManageContextDashboards: !!window.SS.user,
         contextKeyEncoded: encodeURIComponent(this.model.get('contextKey')),
 
         isOverviewActive: isOverviewActive,
index 68240dea7290489216710efc0633c88df7414e07..181eb94369d12721ef1744aef76784bbfac2116a 100644 (file)
@@ -21,6 +21,9 @@
           <%= link_to h(dashboard.name(true)), {:controller => :dashboard, :action => :index, :did => dashboard.id, :id => (resource_id unless dashboard.global?)},
                       :id => "view-#{u dashboard.name}" %>
           <div class="description"><%= h dashboard.description -%></div>
+          <% if index == 0 %>
+            <div class="note spacer-top"><%= h message('dashboard.default_dashboard') -%></div>
+          <% end %>
         </td>
         <td class="shared">
           <% if (dashboard.shared) %><i class="icon-check" id='<%= "dashboard-#{index}-shared" -%>'></i><% end %>
index 1c2fb9256d0869adb7b5ca6a4550d866ca569674..ef1603954a44bfe310867a9538528c38880a7728 100644 (file)
@@ -964,6 +964,7 @@ dashboard.username.default=[SonarQube]
 dashboard.delete_confirm_title=Delete dashboard
 dashboard.delete_dashboard=Delete dashboard
 dashboard.project_not_found=The requested project does not exist. Either it has never been analyzed successfully or it has been deleted.
+dashboard.default_dashboard=This dashboard is the default one and is displayed when clicking on "Overview".
 
 
 #------------------------------------------------------------------------------