diff options
author | Stas Vilchik <vilchiks@gmail.com> | 2015-03-17 13:45:53 +0100 |
---|---|---|
committer | Stas Vilchik <vilchiks@gmail.com> | 2015-03-17 13:45:53 +0100 |
commit | 698475e10b0f3cfedb87399cae0711eded0d416b (patch) | |
tree | dda1f58ac5270578d5ba7d10a16d1bbec3a9f402 | |
parent | 9e1ac06ecd2f9998f5126401e4ee3d6af205e004 (diff) | |
download | sonarqube-698475e10b0f3cfedb87399cae0711eded0d416b.tar.gz sonarqube-698475e10b0f3cfedb87399cae0711eded0d416b.zip |
improve the display of dashboard in the context nav
4 files changed, 7 insertions, 3 deletions
diff --git a/server/sonar-web/src/main/hbs/nav/nav-context-navbar.hbs b/server/sonar-web/src/main/hbs/nav/nav-context-navbar.hbs index 0239245f9ee..eaa48a1d8a0 100644 --- a/server/sonar-web/src/main/hbs/nav/nav-context-navbar.hbs +++ b/server/sonar-web/src/main/hbs/nav/nav-context-navbar.hbs @@ -34,11 +34,11 @@ <a class="dropdown-toggle" data-toggle="dropdown" href="#">{{t 'more'}} <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> diff --git a/server/sonar-web/src/main/js/nav/context-navbar-view.js b/server/sonar-web/src/main/js/nav/context-navbar-view.js index e52a490eb20..ddf73914459 100644 --- a/server/sonar-web/src/main/js/nav/context-navbar-view.js +++ b/server/sonar-web/src/main/js/nav/context-navbar-view.js @@ -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, diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboards/_my_dashboards.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboards/_my_dashboards.html.erb index 68240dea729..181eb94369d 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboards/_my_dashboards.html.erb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboards/_my_dashboards.html.erb @@ -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 %> diff --git a/sonar-core/src/main/resources/org/sonar/l10n/core.properties b/sonar-core/src/main/resources/org/sonar/l10n/core.properties index 1c2fb9256d0..ef1603954a4 100644 --- a/sonar-core/src/main/resources/org/sonar/l10n/core.properties +++ b/sonar-core/src/main/resources/org/sonar/l10n/core.properties @@ -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". #------------------------------------------------------------------------------ |