<li {{#isActiveLink '/component_issues'}}class="active"{{/isActiveLink}}>
<a href="{{link '/component_issues/index?id=' contextKeyEncoded }}">{{t 'issues.page'}}</a>
</li>
+ {{#if contextConfiguration}}
+ <li class="dropdown {{#if isSettingsActive}}active{{/if}}">
+ <a class="dropdown-toggle navbar-admin-link" data-toggle="dropdown" href="#">{{t 'layout.settings'}} <i class="icon-dropdown"></i></a>
+ <ul class="dropdown-menu">
+ {{#each contextConfiguration}}
+ <li>
+ <a href="{{link url}}">{{name}}</a>
+ </li>
+ {{/each}}
+ </ul>
+ </li>
+ {{/if}}
<li class="dropdown {{#if isMoreActive}}active{{/if}}">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">{{t 'more'}} <i class="icon-dropdown"></i></a>
<ul class="dropdown-menu">
<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>
'templates/nav'
], function () {
- var $ = jQuery;
+ var $ = jQuery,
+ OVERVIEW_URLS = [
+ '/design', '/libraries', '/dashboards'
+ ],
+ SETTINGS_URLS = [
+ '/project/settings', '/project/profile', '/project/qualitygate', '/manual_measures/index',
+ '/action_plans/index', '/project/links', '/project_roles/index', '/project/history', '/project/key',
+ '/project/deletion'
+ ];
return Marionette.ItemView.extend({
template: Templates['nav-context-navbar'],
serializeData: function () {
var href = window.location.href,
search = window.location.search,
- isOverviewActive = href.indexOf('/dashboard/') !== -1 && search.indexOf('did=') === -1,
- isMoreActive = !isOverviewActive && href.indexOf('/components') === -1 &&
- href.indexOf('/component_issues') === -1;
+ isMoreActive = _.some(OVERVIEW_URLS, function (url) {
+ return href.indexOf(url) !== -1;
+ }) || (href.indexOf('/dashboard') !== -1 && search.indexOf('did=') !== -1),
+ isSettingsActive = _.some(SETTINGS_URLS, function (url) {
+ return href.indexOf(url) !== -1;
+ }),
+ isOverviewActive = !isMoreActive && href.indexOf('/dashboard') !== -1 && search.indexOf('did=') === -1;
return _.extend(Marionette.Layout.prototype.serializeData.apply(this, arguments), {
canManageContextDashboards: !!window.SS.user,
contextKeyEncoded: encodeURIComponent(this.model.get('contextKey')),
isOverviewActive: isOverviewActive,
+ isSettingsActive: isSettingsActive,
isMoreActive: isMoreActive
});
}
roles.page=Project Permissions
roles.page.description=Grant and revoke project-level permissions to Browse (view a project's metrics), See Source Code, and Administer individual projects. Permissions can be granted to groups or individual users.
roles.page.description2=Grant and revoke project-level permissions. Permissions can be granted to groups or individual users.
-project_settings.page=Settings
+project_settings.page=General Settings
project_settings.page.description=Edit project settings.
project_links.page=Links
project_links.page.description=Edit some links associated with this project.