diff options
26 files changed, 552 insertions, 501 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 8c3053130e5..769f70fefc7 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 @@ -1,6 +1,6 @@ <div class="container"> <ul class="nav navbar-nav nav-crumbs"> - {{#each breadcrumbs}} + {{#each contextBreadcrumbs}} <li> <a href="{{link url}}"> {{qualifierIcon q}} {{name}} @@ -9,30 +9,53 @@ {{/each}} </ul> - <ul class="nav navbar-nav navbar-right"> - {{#each items}} - {{#notEmpty menu}} - <li class="dropdown {{#if active}}active{{/if}}"> - <a class="dropdown-toggle" data-toggle="dropdown" href="#"> - {{> '_nav-navbar-label'}} <i class="icon-dropdown"></i> - </a> - <ul class="dropdown-menu dropdown-menu-right"> - {{#each menu}} - <li {{#if active}}class="active"{{/if}}> - <a href="{{link url}}"> - {{> '_nav-navbar-label'}} - </a> - </li> - {{/each}} - </ul> + <div class="navbar-right navbar-context-meta"> + {{#if contextVersion}}Version {{contextVersion}}{{/if}} + {{#if contextDate}}{{dt contextDate}}{{/if}} + </div> + + <ul class="nav navbar-nav nav-tabs"> + <li {{#isActiveLink '/dashboard'}}class="active"{{/isActiveLink}}> + <a href="{{dashboardUrl contextKey}}">{{t 'overview.page'}}</a> + </li> + <li {{#isActiveLink '/components'}}class="active"{{/isActiveLink}}> + <a href="{{link '/components/index/' contextId }}">{{t 'components.page'}}</a> + </li> + <li> + <a href="{{link '/drilldown/issues/' contextId }}">{{t 'issues.page'}}</a> + </li> + <li class="dropdown {{#isActiveLink '/dashboard'}}{{else}}{{#isActiveLink '/components'}}{{else}}active{{/isActiveLink}}{{/isActiveLink}}"> + <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}} + <li> + <a href="{{link url}}">{{name}}</a> + </li> + {{/each}} + <li class="divider"></li> + <li class="dropdown-header">Tools</li> + <li> + <a href="{{link '/design/index/' contextId }}">{{t 'design.page'}}</a> </li> - {{else}} - <li {{#if active}}class="active"{{/if}}> - <a href="{{link url}}"> - {{> '_nav-navbar-label'}} - </a> + <li> + <a href="{{link '/libraries/index/' contextId }}">{{t 'libraries.page'}}</a> </li> - {{/notEmpty}} - {{/each}} + {{#if contextComparable}} + <li> + <a href="{{link '/comparison/index?resource=' contextKey}}">{{t 'comparison.page'}}</a> + </li> + {{/if}} + {{#if contextConfiguration}} + <li class="divider"></li> + <li class="dropdown-header">Configuration</li> + {{#each contextConfiguration}} + <li> + <a href="{{link url}}">{{name}}</a> + </li> + {{/each}} + {{/if}} + </ul> + </li> </ul> </div> diff --git a/server/sonar-web/src/main/hbs/nav/nav-global-navbar.hbs b/server/sonar-web/src/main/hbs/nav/nav-global-navbar.hbs index 5b000361c48..9556ef5bed5 100644 --- a/server/sonar-web/src/main/hbs/nav/nav-global-navbar.hbs +++ b/server/sonar-web/src/main/hbs/nav/nav-global-navbar.hbs @@ -1,29 +1,64 @@ <div class="container"> + <div class="navbar-header"> + <a class="navbar-brand" href="{{link '/'}}">{{> '_nav-logo'}}</a> + </div> + <ul class="nav navbar-nav"> - {{#each items}} - {{#notEmpty menu}} - <li class="dropdown {{#if active}}active{{/if}}"> - <a class="dropdown-toggle" data-toggle="dropdown" href="#"> - {{> '_nav-navbar-label'}} <i class="icon-dropdown"></i> - </a> - <ul class="dropdown-menu"> - {{#each menu}} - <li {{#if active}}class="active"{{/if}}> - <a href="{{link url}}"> - {{> '_nav-navbar-label'}} - </a> - </li> - {{/each}} - </ul> + <li class="dropdown"> + <a class="dropdown-toggle" data-toggle="dropdown" href="#"> + {{t 'layout.dashboards'}} <span class="icon-dropdown"></span> + </a> + <ul class="dropdown-menu"> + {{#each globalDashboards}} + <li> + <a href="{{link url}}">{{name}}</a> + </li> + {{/each}} + {{#if canManageGlobalDashboards}} + <li class="divider"></li> + <li> + <a href="{{link '/dashboards'}}">{{t 'manage'}}</a> + </li> + {{/if}} + </ul> + </li> + <li class="dropdown immediate-dropdown"> + <a href="{{link '/issues/search'}}">{{t 'issues.page'}}</a> + </li> + <li> + <a href="{{link '/measures/search?qualifiers[]=TRK'}}">{{t 'layout.measures'}}</a> + </li> + <li> + <a href="{{link '/coding_rules'}}">{{t 'coding_rules.page'}}</a> + </li> + <li> + <a href="{{link '/profiles'}}">{{t 'quality_profiles.page'}}</a> + </li> + <li> + <a href="{{link '/quality_gates'}}">{{t 'quality_gates.page'}}</a> + </li> + <li class="dropdown"> + <a class="dropdown-toggle" data-toggle="dropdown" href="#">{{t 'more'}} <i class="icon-dropdown"></i></a> + <ul class="dropdown-menu"> + <li> + <a href="{{link '/comparison'}}">{{t 'comparison.page'}}</a> </li> - {{else}} - <li {{#if active}}class="active"{{/if}}> - <a href="{{link url}}"> - {{> '_nav-navbar-label'}} - </a> + <li> + <a href="{{link '/dependencies'}}">{{t 'dependencies.page'}}</a> </li> - {{/notEmpty}} - {{/each}} + {{#each globalPages}} + <li> + <a href="{{link url}}">{{name}}</a> + </li> + {{/each}} + {{#if isUserAdmin}} + <li class="divider"></li> + <li> + <a href="{{link '/settings'}}">{{t 'layout.settings'}}</a> + </li> + {{/if}} + </ul> + </li> </ul> <ul class="nav navbar-nav navbar-right"> @@ -48,16 +83,12 @@ </li> {{/if}} <li class="dropdown js-search-dropdown"> - <a class="dropdown-toggle js-search-dropdown-toggle" data-toggle="dropdown" href="#"> + <a class="dropdown-toggle navbar-search-dropdown js-search-dropdown-toggle" data-toggle="dropdown" href="#"> <i class="icon-search navbar-icon"></i> <span class="icon-dropdown"></span> </a> + <div class="js-search-region dropdown-menu dropdown-menu-right"></div> </li> - {{#if isUserAdmin}} - <li> - <a href="{{link '/settings/index'}}"><i class="icon-settings navbar-icon"></i></a> - </li> - {{/if}} </ul> </div> diff --git a/server/sonar-web/src/main/hbs/nav/nav-search-item.hbs b/server/sonar-web/src/main/hbs/nav/nav-search-item.hbs index 1de73f23eab..7aa6c557080 100644 --- a/server/sonar-web/src/main/hbs/nav/nav-search-item.hbs +++ b/server/sonar-web/src/main/hbs/nav/nav-search-item.hbs @@ -1,14 +1,14 @@ +{{#if extra}} + {{#gt index 0}} + <div class="divider"></div> + {{/gt}} + <div class="dropdown-header">{{extra}}</div> +{{/if}} + <a href="{{url}}" title="{{name}}"> - {{#if extra}} - <span class="navbar-search-extra subtitle">{{extra}}</span> - {{/if}} {{#if q}}{{qualifierIcon q}}{{/if}} {{#if subtitle}} {{title}} - <br> - {{#if extra}} - <span class="navbar-search-extra subtitle"> </span> - {{/if}} <span class="subtitle">{{subtitle}}</span> {{else}} {{name}} diff --git a/server/sonar-web/src/main/hbs/nav/nav-settings-navbar.hbs b/server/sonar-web/src/main/hbs/nav/nav-settings-navbar.hbs new file mode 100644 index 00000000000..a3a80218b5c --- /dev/null +++ b/server/sonar-web/src/main/hbs/nav/nav-settings-navbar.hbs @@ -0,0 +1,75 @@ +<div class="container"> + <ul class="nav navbar-nav"> + <li class="dropdown"> + <a class="dropdown-toggle" data-toggle="dropdown" href="#"> + {{t 'sidebar.project_settings'}} <i class="icon-dropdown"></i> + </a> + <ul class="dropdown-menu"> + <li> + <a href="{{link '/settings/index'}}">{{t 'settings.page'}}</a> + </li> + <li> + <a href="{{link '/metrics/index'}}">{{t 'manual_metrics.page'}}</a> + </li> + <li> + <a href="{{link '/admin_dashboards/index'}}">{{t 'default_dashboards.page'}}</a> + </li> + {{#each settingsPages}} + <li> + <a href="{{link url}}">{{name}}</a> + </li> + {{/each}} + </ul> + </li> + + <li class="dropdown"> + <a class="dropdown-toggle" data-toggle="dropdown" href="#"> + {{t 'sidebar.security'}} <i class="icon-dropdown"></i> + </a> + <ul class="dropdown-menu"> + <li> + <a href="{{link '/users'}}">{{t 'users.page'}}</a> + </li> + <li> + <a href="{{link '/groups/index'}}">{{t 'user_groups.page'}}</a> + </li> + <li> + <a href="{{link '/roles/global'}}">{{t 'global_permissions.page'}}</a> + </li> + <li> + <a href="{{link '/roles/projects'}}">{{t 'roles.page'}}</a> + </li> + <li> + <a href="{{link '/admin_dashboards/index'}}">{{t 'default_dashboards.page'}}</a> + </li> + </ul> + </li> + + <li class="dropdown"> + <a class="dropdown-toggle" data-toggle="dropdown" href="#"> + {{t 'sidebar.system'}} <i class="icon-dropdown"></i> + </a> + <ul class="dropdown-menu"> + {{#if settingsProvisioning}} + <li> + <a href="{{link '/provisioning'}}">{{t 'provisioning.page'}}</a> + </li> + {{/if}} + <li> + <a href="{{link '/bulk_deletion'}}">{{t 'bulk_deletion.page'}}</a> + </li> + {{#if settingsUpdateCenter}} + <li> + <a href="{{link '/updatecenter'}}">{{t 'update_center.page'}}</a> + </li> + {{/if}} + <li> + <a href="{{link '/system'}}">{{t 'system_info.page'}}</a> + </li> + <li> + <a href="{{link '/analysis_reports'}}">{{t 'analysis_reports.page'}}</a> + </li> + </ul> + </li> + </ul> +</div> diff --git a/server/sonar-web/src/main/js/common/handlebars-extensions.js b/server/sonar-web/src/main/js/common/handlebars-extensions.js index ddbf0671877..eb3af1e038d 100644 --- a/server/sonar-web/src/main/js/common/handlebars-extensions.js +++ b/server/sonar-web/src/main/js/common/handlebars-extensions.js @@ -11,6 +11,15 @@ return baseUrl + url; }); + Handlebars.registerHelper('isActiveLink', function() { + var args = Array.prototype.slice.call(arguments, 0, -1), + options = arguments[arguments.length - 1], + prefix = args.join(''), + path = window.location.pathname, + match = path.indexOf(baseUrl + prefix) === 0; + return match ? options.fn(this) : options.inverse(this); + }); + Handlebars.registerHelper('capitalize', function(string) { return string.charAt(0).toUpperCase() + string.slice(1).toLowerCase(); }); diff --git a/server/sonar-web/src/main/js/common/selectable-collection-view.js b/server/sonar-web/src/main/js/common/selectable-collection-view.js index 6ddce02f574..41fca0eb326 100644 --- a/server/sonar-web/src/main/js/common/selectable-collection-view.js +++ b/server/sonar-web/src/main/js/common/selectable-collection-view.js @@ -7,6 +7,10 @@ define(function () { this.listenTo(this.collection, 'reset', this.resetSelectedIndex); }, + itemViewOptions: function (model, index) { + return { index: index }; + }, + resetSelectedIndex: function () { this.selectedIndex = 0; }, diff --git a/server/sonar-web/src/main/js/nav/app.js b/server/sonar-web/src/main/js/nav/app.js index 2eee602aab1..ffacb9dab4a 100644 --- a/server/sonar-web/src/main/js/nav/app.js +++ b/server/sonar-web/src/main/js/nav/app.js @@ -1,32 +1,44 @@ define([ 'nav/global-navbar-view', - 'nav/context-navbar-view' -], function (GlobalNavbarView, ContextNavbarView) { + 'nav/context-navbar-view', + 'nav/settings-navbar-view' +], function (GlobalNavbarView, ContextNavbarView, SettingsNavbarView) { var $ = jQuery, - App = new Marionette.Application(); + App = new Marionette.Application(), + model = window.navbarOptions; App.addInitializer(function () { this.navbarView = new GlobalNavbarView({ app: App, el: $('.navbar-global'), - collection: new Backbone.Collection(window.navbarGlobalMenu) + model: model }); this.navbarView.render(); }); - if (window.navbarBreadcrumbs != null) { + if (model.has('contextBreadcrumbs')) { App.addInitializer(function () { this.contextNavbarView = new ContextNavbarView({ app: App, el: $('.navbar-context'), - collection: new Backbone.Collection(window.navbarContextMenu), - breadcrumbs: new Backbone.Collection(window.navbarBreadcrumbs) + model: model }); this.contextNavbarView.render(); }); } + if (model.get('space') === 'settings') { + App.addInitializer(function () { + this.settingsNavbarView = new SettingsNavbarView({ + app: App, + el: $('.navbar-context'), + model: model + }); + this.settingsNavbarView.render(); + }); + } + window.requestMessages().done(function () { App.start(); }); 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 534f08c7734..730fa5bac17 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 @@ -5,9 +5,9 @@ define([ return Marionette.ItemView.extend({ template: Templates['nav-context-navbar'], - serializeData: function () { - return _.extend(Marionette.ItemView.prototype.serializeData.apply(this, arguments), { - breadcrumbs: this.options.breadcrumbs.toJSON() + onRender: function () { + this.$('[data-toggle="tooltip"]').tooltip({ + container: 'body' }); } }); diff --git a/server/sonar-web/src/main/js/nav/global-navbar-view.js b/server/sonar-web/src/main/js/nav/global-navbar-view.js index e87ecc6d3f7..7acb3ab2a9a 100644 --- a/server/sonar-web/src/main/js/nav/global-navbar-view.js +++ b/server/sonar-web/src/main/js/nav/global-navbar-view.js @@ -19,12 +19,6 @@ define([ 'hidden.bs.dropdown .js-search-dropdown': 'onSearchDropdownHidden' }, - initialize: function () { - this.projectName = window.navbarProject; - this.projectKey = window.navbarProjectKey; - this.isProjectFavorite = window.navbarProjectFavorite; - }, - onRender: function () { var that = this; this.$el.addClass('navbar-' + window.navbarSpace); @@ -56,6 +50,7 @@ define([ onSearchDropdownShow: function () { var that = this; this.searchRegion.show(new SearchView({ + model: this.model, hide: function () { that.$('.js-search-dropdown-toggle').dropdown('toggle'); } @@ -72,10 +67,9 @@ define([ userName: window.SS.userName, isUserAdmin: window.SS.isUserAdmin, - projectName: this.projectName, - projectKey: this.projectKey, - projectFavorite: this.isProjectFavorite, - navbarCanFavoriteProject: window.navbarCanFavoriteProject + canManageGlobalDashboards: window.SS.user != null, + canManageIssueFilters: window.SS.user != null, + canManageMeasureFilters: window.SS.user != null }); } }); diff --git a/server/sonar-web/src/main/js/nav/search-view.js b/server/sonar-web/src/main/js/nav/search-view.js index 6efd0ca8f92..2ccc6b62df1 100644 --- a/server/sonar-web/src/main/js/nav/search-view.js +++ b/server/sonar-web/src/main/js/nav/search-view.js @@ -19,6 +19,12 @@ define([ submit: function () { this.$('a')[0].click(); + }, + + serializeData: function () { + return _.extend(Marionette.ItemView.prototype.serializeData.apply(this, arguments), { + index: this.options.index + }); } }), @@ -106,7 +112,7 @@ define([ q: historyItem.icon }; }), - qualifiers = window.navbarQualifiers.map(function (q) { + qualifiers = this.model.get('qualifiers').map(function (q) { return { url: baseUrl + '/all_projects?qualifier=' + encodeURIComponent(q), name: t('qualifiers.all', q) @@ -131,14 +137,14 @@ define([ var title = item.name, subtitle = null; if (domain.q === 'FIL' || domain.q === 'UTS') { - subtitle = title.substr(0, title.lastIndexOf('/') - 1); + subtitle = title.substr(0, title.lastIndexOf('/')); title = title.substr(title.lastIndexOf('/') + 1); } collection.push(_.extend(item, { q: domain.q, title: title, subtitle: subtitle, - extra: index === 0 ? domain.name : ' ', + extra: index === 0 ? domain.name : null, url: baseUrl + '/dashboard/index?id=' + encodeURIComponent(item.key) + dashboardParameters(true) })); }); diff --git a/server/sonar-web/src/main/js/nav/settings-navbar-view.js b/server/sonar-web/src/main/js/nav/settings-navbar-view.js new file mode 100644 index 00000000000..27ca7608a6f --- /dev/null +++ b/server/sonar-web/src/main/js/nav/settings-navbar-view.js @@ -0,0 +1,9 @@ +define([ + 'templates/nav' +], function () { + + return Marionette.ItemView.extend({ + template: Templates['nav-settings-navbar'] + }); + +}); diff --git a/server/sonar-web/src/main/less/components/dropdowns.less b/server/sonar-web/src/main/less/components/dropdowns.less index 756622d3a53..174693013cb 100644 --- a/server/sonar-web/src/main/less/components/dropdowns.less +++ b/server/sonar-web/src/main/less/components/dropdowns.less @@ -102,12 +102,19 @@ // Dropdown section headers .dropdown-header { display: block; - padding: 3px 20px; + padding: 3px 8px 5px; font-size: @smallFontSize; - color: @baseFontColor; + color: @secondFontColor; white-space: nowrap; // as with > li > a } +.dropdown-menu .divider { + height: 1px; + margin: 9px 0; + overflow: hidden; + background-color: #e5e5e5; +} + // Backdrop to catch body clicks on mobile, etc. .dropdown-backdrop { position: fixed; diff --git a/server/sonar-web/src/main/less/components/page.less b/server/sonar-web/src/main/less/components/page.less index 292875a12ab..66b2f43a2f9 100644 --- a/server/sonar-web/src/main/less/components/page.less +++ b/server/sonar-web/src/main/less/components/page.less @@ -15,7 +15,7 @@ .page-title { float: left; - font-size: @bigFontSize; + font-size: @mediumFontSize !important; line-height: @formControlHeight; } diff --git a/server/sonar-web/src/main/less/navbar.less b/server/sonar-web/src/main/less/navbar.less index 22d691c1b3a..b2b3f8220be 100644 --- a/server/sonar-web/src/main/less/navbar.less +++ b/server/sonar-web/src/main/less/navbar.less @@ -3,7 +3,7 @@ @import (reference) "ui"; @navbarGlobalBackground: #262626; -@navbarContextBackground: @lightBlue; +@navbarContextBackground: @barBackgroundColor; @navbarHeight: 30px; @navbarLineHeight: 20px; @@ -42,12 +42,18 @@ .navbar a { .link-no-underline; + .trans(none); } .navbar-header { float: left; } +.navbar-brand { + display: block; + padding: 2px 10px 0; +} + .navbar-nav { float: left; } @@ -61,6 +67,19 @@ line-height: @navbarLineHeight; } +.navbar-nav > li.navbar-more > a { + padding-right: 17px; +} + +.navbar-nav > li.navbar-more + li { + margin-left: -17px; +} + +.navbar-nav > li.navbar-more + li > a { + padding-left: 5px; + padding-right: 5px; +} + .navbar-icon:before { font-size: @iconFontSize; } @@ -76,7 +95,7 @@ .navbar-search { position: relative; - width: 400px; + width: 480px; .box-sizing(border-box); .trans(width); } @@ -125,29 +144,36 @@ color: #fff; } + .navbar-brand:hover, + .navbar-brand:focus { + background-color: darken(@navbarGlobalBackground, 20%); + } + .navbar-nav > li > a:hover, .navbar-nav > li > a:focus, .navbar-nav > .active > a, .navbar-nav > .dropdown.open > a { - background-color: darken(@navbarGlobalBackground, 10%); + background-color: @darkBlue; + } + + .navbar-search-dropdown { + background-color: @blue !important; } } .navbar-context { + height: auto; background-color: @navbarContextBackground; - border-bottom: 1px solid @blue; - .navbar-nav > li > a { - padding-bottom: 1px !important; - border-bottom: 3px solid transparent; - color: @baseFontColor; + .nav-tabs { + width: 100%; } +} - .navbar-nav > li > a:hover, - .navbar-nav > li > a:focus, - .navbar-nav > .active > a, - .navbar-nav > .dropdown.open > a { - border-bottom-color: @blue; - } +.navbar-context-meta { + line-height: @navbarHeight; + padding: 0 10px; + color: @secondFontColor; + font-size: @smallFontSize; } diff --git a/server/sonar-web/src/main/less/style.less b/server/sonar-web/src/main/less/style.less index e1c29a01c47..7c195519f5a 100644 --- a/server/sonar-web/src/main/less/style.less +++ b/server/sonar-web/src/main/less/style.less @@ -2703,3 +2703,11 @@ text.max-results-reached-message { } } + +.sq-logo .sq-logo-letter { + fill: #fff; +} + +.sq-logo .sq-logo-arc { + fill: @blue; +} diff --git a/server/sonar-web/src/main/less/ui.less b/server/sonar-web/src/main/less/ui.less index a89e840e2f6..03a876936af 100644 --- a/server/sonar-web/src/main/less/ui.less +++ b/server/sonar-web/src/main/less/ui.less @@ -422,12 +422,43 @@ input[type=button] { .nav-crumbs { + padding: 5px 0; + a { + color: @baseFontColor; + } + + > li + li:before { + content: "/"; + float: left; + padding: 7px 0; + color: fade(@baseFontColor, 30%); + } + + > li:first-child { + font-size: 21px; + font-weight: 300; + } } -.nav-crumbs > li + li:before { - content: " /"; - display: inline-block; - vertical-align: middle; - color: fade(@baseFontColor, 30%); +.nav-tabs { + border-bottom: 1px solid @barBorderColor; + + > li { + float: left; + margin-bottom: -1px; + } + + > li > a { + margin-right: 2px; + border-bottom: 3px solid transparent; + + &:hover { + border-color: @lightBlue; + } + } + + > li.active > a { + border-color: @lightBlue; + } } diff --git a/server/sonar-web/src/main/less/variables.less b/server/sonar-web/src/main/less/variables.less index bcb64f77280..7602afb1a66 100644 --- a/server/sonar-web/src/main/less/variables.less +++ b/server/sonar-web/src/main/less/variables.less @@ -4,6 +4,7 @@ @smallFontSize: 12px; @baseFontSize: 13px; +@mediumFontSize: 14px; @bigFontSize: 16px; @baseFontColor: #444; @secondFontColor: #777; diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/components/index.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/components/index.html.erb index f6446547adf..9370ea03670 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/components/index.html.erb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/views/components/index.html.erb @@ -1,7 +1,5 @@ <div class="page"> <header class="page-header"> - <h1 class="page-title"><%= h message('components.page') -%></h1> - <% if is_admin? %> <div class="page-actions"> <%= message('customize') -%> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard/_header.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard/_header.html.erb index f96fb618b2c..dc67eee948e 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard/_header.html.erb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard/_header.html.erb @@ -1,24 +1,9 @@ <header class="page-header"> <h1 class="page-title"><%= h @dashboard.name -%></h1> - <% if logged_in? %> - <div class="page-actions operations noprint"> - <div class="button-group"> - <% if back %> - <%= link_to message('dashboard.back_to_dashboard'), dashboard_action(:index), :class => 'button' -%> - <% else %> - <% if @dashboard.editable_by?(current_user) %> - <%= link_to message('dashboard.configure_widgets'), dashboard_action(:configure), :class => 'button' -%> - <% end %> - <% end %> - <%= link_to message('dashboard.manage_dashboards'), {:controller => :dashboards, :action => :index, :resource => (@resource.id if @resource)}, :class => 'button' -%> - </div> - </div> - <% end %> - <% if @snapshot %> - <div class="page-description" id="snapshot_title"> - <%= "Version #{@snapshot.version} - " if @snapshot.version.present? -%><%= l @snapshot.created_at -%> + <div class="page-actions operations noprint"> + <% if @snapshot %> <% if @snapshot.project_snapshot.periods? %> <% period_options = period_select_option_tags(@snapshot, 'small') %> <% if period_options %> @@ -28,6 +13,19 @@ </form> <% end %> <% end %> - </div> - <% end %> + <% end %> + + <% if logged_in? %> + <div class="button-group"> + <% if back %> + <%= link_to message('dashboard.back_to_dashboard'), dashboard_action(:index), :class => 'button' -%> + <% else %> + <% if @dashboard.editable_by?(current_user) %> + <%= link_to message('dashboard.configure_widgets'), dashboard_action(:configure), :class => 'button' -%> + <% end %> + <% end %> + <%= link_to message('dashboard.manage_dashboards'), {:controller => :dashboards, :action => :index, :resource => (@resource.id if @resource)}, :class => 'button' -%> + </div> + <% end %> + </div> </header> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard/no_dashboard.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard/no_dashboard.html.erb index 605a8e1ed96..cc4f431d7bd 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard/no_dashboard.html.erb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard/no_dashboard.html.erb @@ -11,6 +11,6 @@ uuid: '<%= @resource.uuid -%>', key: '<%= @resource.key -%>' }; - document.getElementById('crumbs').remove(); + document.querySelector('.navbar-context').remove(); </script> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/layouts/_layout.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/layouts/_layout.html.erb index 421e99d7e03..d66d2197002 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/layouts/_layout.html.erb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/views/layouts/_layout.html.erb @@ -9,7 +9,7 @@ <div id="container"> <nav class="navbar navbar-global"></nav> - <% if selected_section==Navigation::SECTION_RESOURCE %> + <% if selected_section==Navigation::SECTION_RESOURCE || selected_section==Navigation::SECTION_CONFIGURATION %> <nav class="navbar navbar-context"></nav> <% end %> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/layouts/_navbar_conf.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/layouts/_navbar_conf.html.erb index 98319a4caf5..4df94dfcd71 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/layouts/_navbar_conf.html.erb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/views/layouts/_navbar_conf.html.erb @@ -1,3 +1,19 @@ +<script> + window.navbarOptions = new Backbone.Model(); + + window.navbarOptions.set({ + qualifiers: [ + <% qualifiers = Project.root_qualifiers.sort + qualifiers.each_with_index do |qualifier, index| %> + '<%= qualifier -%>'<% if index < qualifiers.size - 1 %>,<% end %> + <% end %> + ] + }); + window.SS.isUserAdmin = <%= current_user && is_admin? ? 'true' : 'false' -%>; +</script> + + + <% selected_section = controller.class::SECTION if defined?(controller.class::SECTION) if selected_section==Navigation::SECTION_RESOURCE && !@project && !@resource @@ -17,13 +33,3 @@ <% elsif selected_section==Navigation::SECTION_CONFIGURATION %> <%= render :partial => 'layouts/navbar_conf_settings' %> <% end %> - - -<script> - var navbarQualifiers = [ - <% Project.root_qualifiers.sort.each do |qualifier| %> - '<%= qualifier -%>', - <% end %> - ]; - window.SS.isUserAdmin = <%= current_user && is_admin? ? 'true' : 'false' -%>; -</script> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/layouts/_navbar_conf_context.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/layouts/_navbar_conf_context.html.erb index 58d7c40b3d5..5b75a79d790 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/layouts/_navbar_conf_context.html.erb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/views/layouts/_navbar_conf_context.html.erb @@ -8,201 +8,147 @@ <script> - var navbarProject = '<%= @project.root_project().name -%>', - navbarProjectId = '<%= @project.root_project().id -%>', - navbarProjectKey = '<%= @project.root_project().key -%>', - navbarCanFavoriteProject = <%= logged_in? && displayed_resource && !display_only_root ? 'true' : 'false' -%>, - navbarProjectFavorite = <%= logged_in? && current_user.favourite?(resource_id) ? 'true' : 'false' -%>, - navbarContextMenu = [ - { - label: 'layout.dashboards', - active: <%= @dashboard && controller.controller_path=='dashboard' ? "true" : "false" -%>, - menu: [ - <% ActiveDashboard.user_dashboards(current_user, false).each do |active_dashboard| %> - { - url: '/dashboard/index?id=<%= @project.key -%>&did=<%= active_dashboard.dashboard_id -%><%= "&"+period_param if period_param -%>', - labelLocalized: '<%= escape_javascript active_dashboard.dashboard.name(true) -%>', - active: <%= @dashboard && controller.controller_path=='dashboard' && active_dashboard.dashboard_id==@dashboard.id ? "true" : "false" -%> - }, - <% end %> - ] - }, - <% if @snapshot %> - { - url: '/components/index/<%= @project.id -%>', - label: 'components.page', - active: <%= request.request_uri.include?('/components/index') ? "true" : "false" -%> - }, - { - url: '/drilldown/issues/<%= @project.id -%><%= "?"+period_param if period_param -%>', - label: 'issues.page', - active: <%= request.request_uri.include?('/drilldown/issues') ? "true" : "false" -%> - }, - <% if (has_role?(:admin, displayed_resource) || profiles_administrator?) && !displayed_resource.entity? %> - <% is_admin = has_role?(:admin, @project) %> - { - labelLocalized: '<%= message('qualifier.configuration.' + @project.qualifier) -%>', - active: false, - menu: [ - <% if (is_admin && controller.java_facade.getResourceTypeBooleanProperty(@project.qualifier, 'configurable')) %> - { - url: '/project/settings/<%= @project.id -%>', - label: 'project_settings.page', - active: false - }, - <% end %> - <% if (@project.project?) %> - { - url: '/project/profile/<%= @project.id -%>', - label: 'project_quality_profiles.page', - active: false - }, - <% end %> - <% if (@project.project?) %> - { - url: '/project/qualitygate/<%= @project.id -%>', - label: 'project_quality_gate.page', - active: false - }, - <% end %> - <% if is_admin %> - { - url: '/manual_measures/index/<%= @project.id -%>', - label: 'manual_measures.page', - active: false - }, - <% end %> - <% if (is_admin && @project.project?) %> - { - url: '/action_plans/index/<%= @project.id -%>', - label: 'action_plans.page', - active: false - }, - <% end %> - <% if (is_admin && @project.project?) %> - { - url: '/project/links/<%= @project.id -%>', - label: 'project_links.page', - active: false - }, - <% end %> - <% if is_admin && controller.java_facade.getResourceTypeBooleanProperty(@project.qualifier, 'hasRolePolicy') %> - { - url: '/project_roles/index/<%= @project.id -%>', - label: 'permissions.page', - active: false - }, - <% end %> - <% if is_admin && controller.java_facade.getResourceTypeBooleanProperty(@project.qualifier, 'modifiable_history') %> - { - url: '/project/history/<%= @project.id -%>', - label: 'project_history.page', - active: false - }, - <% end %> - <% if is_admin && controller.java_facade.getResourceTypeBooleanProperty(@project.qualifier, 'updatable_key') %> - { - url: '/project/key/<%= @project.id -%>', - label: 'update_key.page', - active: false - }, - <% end %> - <% if is_admin && controller.java_facade.getResourceTypeBooleanProperty(@project.qualifier, 'deletable') %> - { - url: '/project/deletion/<%= @project.id -%>', - label: 'deletion.page', - active: false - }, - <% end %> - <% if is_admin - controller.java_facade.getPages(Navigation::SECTION_RESOURCE_CONFIGURATION.key, @project.scope, @project.qualifier, @project.language, nil).each do |page| - page_url = "#{page.getId()}?resource=#{@project.id}" - %> - { - url: '<%= page_url -%>', - labelLocalized: '<%= escape_javascript message(page.getId() + '.page', :default => page.getTitle()) -%>', - active: false - }, - <% end - end %> - ] - }, - <% end %> - <% end %> - { - label: 'more', - active: false, - menu: [ - <% project_metrics = @project.last_snapshot.metric_keys.to_java(:string) if @project.last_snapshot - controller.java_facade.getPages(Navigation::SECTION_RESOURCE.key, @project.scope, @project.qualifier, @project.language, project_metrics).each do |page| - page_url = (page.isController() ? "#{page.getId()}?id=#{@project.id}" : "/plugins/resource/#{@project.id}?page=#{page.getId()}") - %> - { - url: '<%= page_url -%>', - labelLocalized: '<%= escape_javascript message(page.getId() + '.page', :default => page.getTitle()) -%>', - active: <%= request.request_uri.include?(page_url) ? "true" : "false" -%> - }, - <% end %> - { - url: '/design/index/<%= @project.key -%>', - label: 'design.page', - active: <%= request.request_uri.include?('/design/index') ? "true" : "false" -%> - }, - { - url: '/libraries/index/<%= @project.key -%>', - label: 'libraries.page', - active: <%= request.request_uri.include?('/libraries/index') ? "true" : "false" -%> - }, - <% if controller.java_facade.getResourceTypeBooleanProperty(@project.qualifier, 'comparable') %> - { - url: '/comparison/index?resource=<%= @project.key -%>', - label: 'comparison.page', - active: <%= request.request_uri.include?('/comparison/index') ? "true" : "false" -%> - } - <% end %> - ] - } - ], - navbarBreadcrumbs = [ - <% - resource_link = {:controller => params[:controller], :action => params[:action]} - if display_only_root - resource_link = {:controller => 'dashboard', :action => 'index'} - end + window.navbarOptions.set({ + contextId: '<%= @project.id -%>', + contextKey: '<%= @project.key -%>', + contextUuid: '<%= @project.uuid -%>', + contextComparable: <%= controller.java_facade.getResourceTypeBooleanProperty(@project.qualifier, 'comparable') -%>, + <% if @snapshot && @snapshot.version.present? %> + contextVersion: '<%= @snapshot.version -%>', + <% end %> + <% if @snapshot %> + contextDate: '<%= @snapshot.created_at -%>', + <% end %> + contextDashboards: [ + <% dashboards = ActiveDashboard.user_dashboards(current_user, false) + dashboards.each_with_index do |active_dashboard, index| %> + { + url: '/dashboard/index?id=<%= @project.key -%>&did=<%= active_dashboard.dashboard_id -%><%= "&"+period_param if period_param -%>', + name: '<%= escape_javascript active_dashboard.dashboard.name(true) -%>' + }<% if index < dashboards.size - 1 -%>, <% end %> + <% end %> + ] + }); + + <% if (has_role?(:admin, displayed_resource) || profiles_administrator?) && !displayed_resource.entity? %> + <% is_admin = has_role?(:admin, @project) %> + window.navbarOptions.set({ + contextConfiguration: [ + <% if (is_admin && controller.java_facade.getResourceTypeBooleanProperty(@project.qualifier, 'configurable')) %> + { + url: '/project/settings/<%= @project.id -%>', + name: '<%= escape_javascript message('project_settings.page') -%>' + }, + <% end %> + <% if (@project.project?) %> + { + url: '/project/profile/<%= @project.id -%>', + name: '<%= escape_javascript message('project_quality_profiles.page') -%>' + }, + <% end %> + <% if (@project.project?) %> + { + url: '/project/qualitygate/<%= @project.id -%>', + name: '<%= escape_javascript message('project_quality_gate.page') -%>' + }, + <% end %> + <% if is_admin %> + { + url: '/manual_measures/index/<%= @project.id -%>', + name: '<%= escape_javascript message('manual_measures.page') -%>' + }, + <% end %> + <% if (is_admin && @project.project?) %> + { + url: '/action_plans/index/<%= @project.id -%>', + name: '<%= escape_javascript message('action_plans.page') -%>' + }, + <% end %> + <% if (is_admin && @project.project?) %> + { + url: '/project/links/<%= @project.id -%>', + name: '<%= escape_javascript message('project_links.page') -%>' + }, + <% end %> + <% if is_admin && controller.java_facade.getResourceTypeBooleanProperty(@project.qualifier, 'hasRolePolicy') %> + { + url: '/project_roles/index/<%= @project.id -%>', + name: '<%= escape_javascript message('permissions.page') -%>' + }, + <% end %> + <% if is_admin && controller.java_facade.getResourceTypeBooleanProperty(@project.qualifier, 'modifiable_history') %> + { + url: '/project/history/<%= @project.id -%>', + name: '<%= escape_javascript message('project_history.page') -%>' + }, + <% end %> + <% if is_admin && controller.java_facade.getResourceTypeBooleanProperty(@project.qualifier, 'updatable_key') %> + { + url: '/project/key/<%= @project.id -%>', + name: '<%= escape_javascript message('update_key.page') -%>' + }, + <% end %> + <% if is_admin && controller.java_facade.getResourceTypeBooleanProperty(@project.qualifier, 'deletable') %> + { + url: '/project/deletion/<%= @project.id -%>', + name: '<%= escape_javascript message('deletion.page') -%>' + }, + <% end %> + <% if is_admin + controller.java_facade.getPages(Navigation::SECTION_RESOURCE_CONFIGURATION.key, @project.scope, @project.qualifier, @project.language, nil).each do |page| + page_url = "#{page.getId()}?resource=#{@project.id}" + %> + { + url: '<%= page_url -%>', + name: '<%= escape_javascript message(page.getId() + '.page', :default => page.getTitle()) -%>' + }, + <% end end %> + ] + }); + <% end %> - # ======== Path for resources ======== + window.navbarOptions.set({ + contextBreadcrumbs: [ + <% + resource_link = {:controller => params[:controller], :action => params[:action]} + if display_only_root + resource_link = {:controller => 'dashboard', :action => 'index'} + end - if displayed_resource - if displayed_resource.last_snapshot - resources=[] - s=displayed_resource.last_snapshot - while (s!=nil) do - resources.insert(0, s.project) - s=s.parent - end - else - resources = [displayed_resource] + # ======== Path for resources ======== + + if displayed_resource + if displayed_resource.last_snapshot + resources=[] + s=displayed_resource.last_snapshot + while (s!=nil) do + resources.insert(0, s.project) + s=s.parent end + else + resources = [displayed_resource] + end + %> + <% + resources.each do |resource| + root = "/#{u resource_link[:controller]}/#{u resource_link[:action]}?" + path = '' + query = request.query_parameters + query[:id] = resource.key + query.each do |key, value| + path += '&' unless path.empty? + path += "#{u key}=#{u value}" + end %> - <% - resources.each do |resource| - root = "/#{u resource_link[:controller]}/#{u resource_link[:action]}?" - path = '' - query = request.query_parameters - query[:id] = resource.key - query.each do |key, value| - path += '&' unless path.empty? - path += "#{u key}=#{u value}" - end - %> - { - q: '<%= resource.qualifier -%>', - url: '<%= root + path -%>', - name: '<%= escape_javascript resource.name -%>' - }, - <% - end - end - %> - ]; + { + q: '<%= resource.qualifier -%>', + url: '<%= root + path -%>', + name: '<%= escape_javascript resource.name -%>' + }, + <% + end + end + %> + ] + }); </script> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/layouts/_navbar_conf_global.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/layouts/_navbar_conf_global.html.erb index 9222f665efd..2225b7fa726 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/layouts/_navbar_conf_global.html.erb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/views/layouts/_navbar_conf_global.html.erb @@ -6,70 +6,25 @@ %> <script> - window.navbarGlobalMenu = [ - { - label: 'layout.dashboards', - active: <%= selected_section==Navigation::SECTION_HOME ? 'true' : 'false' -%>, - menu: [ - <% ActiveDashboard.user_dashboards(current_user, true).each do |active_dashboard| %> - { - url: '/dashboard/?did=<%= active_dashboard.dashboard_id -%>', - labelLocalized: '<%= escape_javascript active_dashboard.dashboard.name(true) -%>', - active: <%= @dashboard && controller.controller_path=='dashboard' && active_dashboard.dashboard_id==@dashboard.id ? 'true' : 'false' -%> - }, - <% end %> - ] - }, - { - url: '/measures/search?qualifiers[]=TRK', - label: 'layout.measures', - active: <%= selected_section==Navigation::SECTION_MEASURES ? 'true' : 'false' -%> - }, - { - url: '/issues/index', - label: 'issues.page', - active: <%= selected_section==Navigation::SECTION_ISSUES ? 'true' : 'false' -%> - }, - { - url: '/coding_rules', - label: 'coding_rules.page', - active: <%= selected_section==Navigation::SECTION_CODING_RULES ? 'true' : 'false' -%> - }, - { - url: '/profiles', - label: 'quality_profiles.page', - active: <%= selected_section==Navigation::SECTION_QUALITY_PROFILES ? 'true' : 'false' -%> - }, - { - url: '/quality_gates', - label: 'quality_gates.page', - active: <%= selected_section==Navigation::SECTION_QUALITY_GATES ? 'true' : 'false' -%> - }, - { - label: 'more', - active: false, - menu: [ - { - url: '/comparison/index', - label: 'comparison.page', - active: <%= request.request_uri.include?('/comparison') ? 'true' : 'false' -%> - }, - { - url: '/dependencies/index', - label: 'dependencies.page', - active: <%= request.request_uri.include?('/dependencies') ? 'true' : 'false' -%> - }, - <% controller.java_facade.getPages(Navigation::SECTION_HOME.key, nil, nil, nil, nil).each do |page| - page_url = (page.isController() ? page.getId() : "/plugins/home/#{page.getId()}") - selected=request.request_uri.include?("/plugins/home/#{page_url}") - %> - { - url: '<%= page_url -%>', - labelLocalized: '<%= escape_javascript message(page.getId() + '.page', :default => page.getTitle()) -%>', - active: <%= selected ? 'true' : 'false' -%> - }, - <% end %> - ] - } - ]; + window.navbarOptions.set({ + globalDashboards: [ + <% dashboards = ActiveDashboard.user_dashboards(current_user, true) + dashboards.each_with_index do |dashboard, index| %> + { + url: '/dashboard/?did=<%= dashboard.dashboard_id -%>', + name: '<%= escape_javascript dashboard.dashboard.name(true) -%>' + }<% if index < dashboards.size - 1 -%>, <% end %> + <% end %> + ], + globalPages: [ + <% pages = controller.java_facade.getPages(Navigation::SECTION_HOME.key, nil, nil, nil, nil) + pages.each_with_index do |page, index| + %> + { + url: '<%= page.isController() ? page.getId() : "/plugins/home/#{page.getId()}" -%>', + name: '<%= escape_javascript message(page.getId() + '.page', :default => page.getTitle()) -%>' + }<% if index < pages.size - 1 -%>, <% end %> + <% end %> + ] + }); </script> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/layouts/_navbar_conf_settings.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/layouts/_navbar_conf_settings.html.erb index 86362f0cc58..772c56bafed 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/layouts/_navbar_conf_settings.html.erb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/views/layouts/_navbar_conf_settings.html.erb @@ -6,109 +6,20 @@ %> <script> - var navbarSpace = 'settings', - navbarGlobalMenu = [ - { - url: '/', - labelLocalized: 'Home', - active: false - }, - { - label: 'sidebar.project_settings', - active: false, - menu: [ - { - url: '/settings/index', - label: 'settings.page', - active: <%= request.request_uri.include?('/settings') ? 'true' : 'false' -%> - }, - { - url: '/metrics/index', - label: 'manual_metrics.page', - active: <%= request.request_uri.include?('/metrics') ? 'true' : 'false' -%> - }, - { - url: '/admin_dashboards/index', - label: 'default_dashboards.page', - active: <%= request.request_uri.include?('/admin_dashboards') ? 'true' : 'false' -%> - }, - <% controller.java_facade.getPages(Navigation::SECTION_CONFIGURATION.key, nil, nil, nil, nil).each do |page| - page_url = (page.isController() ? page.getId() : "/plugins/configuration/#{page.getId()}") - %> - { - url: '<%= page_url -%>', - labelLocalized: '<%= escape_javascript message(page.getId() + '.page', :default => page.getTitle()) %>', - active: <%= request.request_uri.include?(page_url) ? 'true' : 'false' -%> - }, - <% end %> - ] - }, - { - label: 'sidebar.security', - active: false, - menu: [ - { - url: '/users', - label: 'users.page', - active: <%= request.request_uri.include?('/users') ? 'true' : 'false' -%> - }, - { - url: '/groups/index', - label: 'user_groups.page', - active: <%= request.request_uri.include?('/groups') ? 'true' : 'false' -%> - }, - { - url: '/roles/global', - label: 'global_permissions.page', - active: <%= request.request_uri.include?('/roles/global') ? 'true' : 'false' -%> - }, - { - url: '/roles/projects', - label: 'roles.page', - active: <%= request.request_uri.include?('/roles/projects') ? 'true' : 'false' -%> - }, - { - url: '/admin_dashboards/index', - label: 'default_dashboards.page', - active: <%= request.request_uri.include?('/admin_dashboards') ? 'true' : 'false' -%> - } - ] - }, - { - label: 'sidebar.system', - active: false, - menu: [ - <% if has_role?("provisioning") %> - { - url: '/provisioning/index', - label: 'provisioning.page', - active: <%= request.request_uri.include?('/provisioning') ? 'true' : 'false' -%> - }, - <% end %> - { - url: '/bulk_deletion/index', - label: 'bulk_deletion.page', - active: <%= request.request_uri.include?('/bulk_deletion') ? 'true' : 'false' -%> - }, - <% update_center_activated = controller.java_facade.getSettings().getBoolean('sonar.updatecenter.activate') - if update_center_activated %> - { - url: '/updatecenter/index', - label: 'update_center.page', - active: <%= request.request_uri.include?('/updatecenter') ? 'true' : 'false' -%> - }, - <% end %> - { - url: '/system/index', - label: 'system_info.page', - active: <%= request.request_uri.include?('/system') ? 'true' : 'false' -%> - }, - { - url: '/analysis_reports/index', - label: 'analysis_reports.page', - active: <%= request.request_uri.include?('/analysis_reports') ? 'true' : 'false' -%> - } - ] - } - ]; + window.navbarOptions.set({ + space: 'settings', + settingsPages: [ + <% pages = controller.java_facade.getPages(Navigation::SECTION_CONFIGURATION.key, nil, nil, nil, nil) + pages.each_with_index do |page, index| + page_url = (page.isController() ? page.getId() : "/plugins/configuration/#{page.getId()}") + %> + { + url: '<%= page_url -%>', + name: '<%= escape_javascript message(page.getId() + '.page', :default => page.getTitle()) %>' + }<% if index < pages.size - 1 -%>, <% end %> + <% end %> + ], + settingsProvisioning: <%= has_role?("provisioning") -%>, + settingsUpdateCenter: <%= controller.java_facade.getSettings().getBoolean('sonar.updatecenter.activate') -%> + }); </script> 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 92e7d89d03d..f46f1678ff1 100644 --- a/sonar-core/src/main/resources/org/sonar/l10n/core.properties +++ b/sonar-core/src/main/resources/org/sonar/l10n/core.properties @@ -505,6 +505,7 @@ provisioning.page.description=Use this page to initialize projects if you would #------------------------------------------------------------------------------ clouds.page=Clouds +overview.page=Overview components.page=Components coverage.page=Coverage default_dashboards.page=Default Dashboards |