]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-6041 update nav
authorStas Vilchik <vilchiks@gmail.com>
Fri, 23 Jan 2015 12:12:49 +0000 (13:12 +0100)
committerStas Vilchik <vilchiks@gmail.com>
Mon, 26 Jan 2015 08:25:32 +0000 (09:25 +0100)
26 files changed:
server/sonar-web/src/main/hbs/nav/nav-context-navbar.hbs
server/sonar-web/src/main/hbs/nav/nav-global-navbar.hbs
server/sonar-web/src/main/hbs/nav/nav-search-item.hbs
server/sonar-web/src/main/hbs/nav/nav-settings-navbar.hbs [new file with mode: 0644]
server/sonar-web/src/main/js/common/handlebars-extensions.js
server/sonar-web/src/main/js/common/selectable-collection-view.js
server/sonar-web/src/main/js/nav/app.js
server/sonar-web/src/main/js/nav/context-navbar-view.js
server/sonar-web/src/main/js/nav/global-navbar-view.js
server/sonar-web/src/main/js/nav/search-view.js
server/sonar-web/src/main/js/nav/settings-navbar-view.js [new file with mode: 0644]
server/sonar-web/src/main/less/components/dropdowns.less
server/sonar-web/src/main/less/components/page.less
server/sonar-web/src/main/less/navbar.less
server/sonar-web/src/main/less/style.less
server/sonar-web/src/main/less/ui.less
server/sonar-web/src/main/less/variables.less
server/sonar-web/src/main/webapp/WEB-INF/app/views/components/index.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard/_header.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard/no_dashboard.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/layouts/_layout.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/layouts/_navbar_conf.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/layouts/_navbar_conf_context.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/layouts/_navbar_conf_global.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/layouts/_navbar_conf_settings.html.erb
sonar-core/src/main/resources/org/sonar/l10n/core.properties

index 8c3053130e589e0f7e09ef40de81cf8543a7dfa6..769f70fefc7345b983449d717692032d58cc7ec7 100644 (file)
@@ -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}}&nbsp;{{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'}}&nbsp;<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'}}&nbsp;<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>
index 5b000361c484e3889ab0de542913df97e4270c0c..9556ef5bed5b0335b3de692b4551df4dc45f0b60 100644 (file)
@@ -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'}}&nbsp;<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'}}&nbsp;<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'}}&nbsp;<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">
       </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>&nbsp;<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>
index 1de73f23eab93f86d0a60f9a978f0f24998f1e7d..7aa6c557080d494fdd7fb92b6f89dae00f72d223 100644 (file)
@@ -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">&nbsp;</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 (file)
index 0000000..a3a8021
--- /dev/null
@@ -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'}}&nbsp;<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'}}&nbsp;<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'}}&nbsp;<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>
index ddbf06718775a79e3b75dff129c51cef7fb09e72..eb3af1e038d6fd1dee246afe1db20ac09730cc10 100644 (file)
     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();
   });
index 6ddce02f574dde64852b08b1b67db2c55f79f13e..41fca0eb326b9f7505d300e39ea7a471840473f1 100644 (file)
@@ -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;
     },
index 2eee602aab13a74c7fbb1757f564cdee37c5a63e..ffacb9dab4a606650b9abbd0a3e6af87ce737705 100644 (file)
@@ -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();
   });
index 534f08c77348c9a62d4ea5fd1fbd68e7552b6e34..730fa5bac173cce2a256bf941a88720925f42a30 100644 (file)
@@ -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'
       });
     }
   });
index e87ecc6d3f746cec88cf33e03cf64da0d01649fd..7acb3ab2a9af82ce02998232279992a4f7c639d9 100644 (file)
@@ -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
       });
     }
   });
index 6efd0ca8f92aa1d69af48724821c3c2c84cfda48..2ccc6b62df13f589624b1ac515d923dbb8802edc 100644 (file)
@@ -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 (file)
index 0000000..27ca760
--- /dev/null
@@ -0,0 +1,9 @@
+define([
+  'templates/nav'
+], function () {
+
+  return Marionette.ItemView.extend({
+    template: Templates['nav-settings-navbar']
+  });
+
+});
index 756622d3a53bb0c2181037fd44c5c6ee12b3e34e..174693013cbdd496a580c0e1142633ae52350e88 100644 (file)
 // 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;
index 292875a12ab8299901a1dd41fe994c792200872d..66b2f43a2f9d4edc79368dc46ed21871d14fdb3e 100644 (file)
@@ -15,7 +15,7 @@
 
 .page-title {
   float: left;
-  font-size: @bigFontSize;
+  font-size: @mediumFontSize !important;
   line-height: @formControlHeight;
 }
 
index 22d691c1b3a7f7827eecb61452a35f1aca203cac..b2b3f8220be3e7cb262fcd5016770c569402dfb2 100644 (file)
@@ -3,7 +3,7 @@
 @import (reference) "ui";
 
 @navbarGlobalBackground: #262626;
-@navbarContextBackground: @lightBlue;
+@navbarContextBackground: @barBackgroundColor;
 
 @navbarHeight: 30px;
 @navbarLineHeight: 20px;
 
 .navbar a {
   .link-no-underline;
+  .trans(none);
 }
 
 .navbar-header {
   float: left;
 }
 
+.navbar-brand {
+  display: block;
+  padding: 2px 10px 0;
+}
+
 .navbar-nav {
   float: left;
 }
   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);
 }
     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;
 }
index e1c29a01c475e93b6bd43779e0da60e7e395f653..7c195519f5ab7554f686573a61a336e161372814 100644 (file)
@@ -2703,3 +2703,11 @@ text.max-results-reached-message {
   }
 }
 
+
+.sq-logo .sq-logo-letter {
+  fill: #fff;
+}
+
+.sq-logo .sq-logo-arc {
+  fill: @blue;
+}
index a89e840e2f6b793de5ff3df0fb80dd2e4db0bf89..03a876936afa990da72641a977ab56c9a4e2d1c2 100644 (file)
@@ -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;
+  }
 }
index bcb64f772803cc1a2db127ecf5378918a33d7874..7602afb1a669c293c8cd87aa4e1fa94c992845a5 100644 (file)
@@ -4,6 +4,7 @@
 
 @smallFontSize: 12px;
 @baseFontSize: 13px;
+@mediumFontSize: 14px;
 @bigFontSize: 16px;
 @baseFontColor: #444;
 @secondFontColor: #777;
index f6446547adf74933473c7c3c1a50bdadce98ef1c..9370ea036709262a04b9055eb1bb447568f283cf 100644 (file)
@@ -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') -%>
index f96fb618b2c36096bec3baffe5f7ae9b3cb4765e..dc67eee948e77f3671b2824ba4ca847af7fd50be 100644 (file)
@@ -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 %>
           </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>
index 605a8e1ed965330c09894ec1372070ff9242cc32..cc4f431d7bdcdf1757d8ff1785909b8cf04d3cce 100644 (file)
@@ -11,6 +11,6 @@
     uuid: '<%= @resource.uuid -%>',
     key: '<%= @resource.key -%>'
   };
-  document.getElementById('crumbs').remove();
+  document.querySelector('.navbar-context').remove();
 </script>
 
index 421e99d7e03f6d0af44eb7effabd1ebce3738120..d66d2197002ad1ea1340f3f9664f1bbb84f81f21 100644 (file)
@@ -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 %>
 
index 98319a4caf5951d45f9858e7e08382c1ffdbeceb..4df94dfcd71898b9cad82cca247bddbbd16b1f4b 100644 (file)
@@ -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
 <% 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>
index 58d7c40b3d50c0c3c8f5317915b9a64d2e41e52c..5b75a79d79045208c64160ff99fe8b8a7ef31645 100644 (file)
 
 
 <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>
index 9222f665efd31fb76e2174ac28b81cc688b84b96..2225b7fa72695b713f5fe1c0af40cba9b859ddc3 100644 (file)
@@ -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>
index 86362f0cc581297f7580423d39cfcaa238fb5f76..772c56bafedaedd4007bb889ef73669e60ba0993 100644 (file)
 %>
 
 <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>
index 92e7d89d03d77452eac41204c33ac126ad80579b..f46f1678ff1f1283dc07a08d883ea71a7e1aafb2 100644 (file)
@@ -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