"baseUrl": true,
"key": true,
"Backbone": true,
+ "Marionette": true,
"Handlebars": true,
+ "Templates": true,
"t": true,
"tp": true,
"moment": true,
'<%= pkg.sources %>less/select2.less'
'<%= pkg.sources %>less/select2-sonar.less'
'<%= pkg.sources %>less/layout.less'
+ '<%= pkg.sources %>less/layout-new.less'
'<%= pkg.sources %>less/style.less'
'<%= pkg.sources %>less/icons.less'
'<%= pkg.sources %>less/ui.less'
'<%= pkg.sources %>less/select2.less'
'<%= pkg.sources %>less/select2-sonar.less'
'<%= pkg.sources %>less/layout.less'
+ '<%= pkg.sources %>less/layout-new.less'
'<%= pkg.sources %>less/style.less'
'<%= pkg.sources %>less/icons.less'
'<%= pkg.sources %>less/ui.less'
'<%= pkg.assets %>js/third-party/numeral.js'
'<%= pkg.assets %>js/third-party/numeral-languages.js'
'<%= pkg.assets %>js/third-party/bootstrap/tooltip.js'
+ '<%= pkg.assets %>js/third-party/bootstrap/dropdown.js'
'<%= pkg.assets %>js/select2-jquery-ui-fix.js'
'<%= pkg.assets %>js/widgets/base.js'
'<%= pkg.assets %>js/widgets/widget.js'
'<%= pkg.assets %>js/third-party/numeral.js'
'<%= pkg.assets %>js/third-party/numeral-languages.js'
'<%= pkg.assets %>js/third-party/bootstrap/tooltip.js'
+ '<%= pkg.assets %>js/third-party/bootstrap/dropdown.js'
'<%= pkg.assets %>js/select2-jquery-ui-fix.js'
'<%= pkg.assets %>js/widgets/base.js'
'<%= pkg.assets %>js/widgets/widget.js'
name: 'analysis-reports/app'
out: '<%= pkg.assets %>build/js/analysis-reports/app.js'
+ nav: options:
+ name: 'nav/app'
+ out: '<%= pkg.assets %>build/js/nav/app.js'
+
handlebars:
options:
'<%= pkg.assets %>js/templates/analysis-reports.js': [
'<%= pkg.sources %>hbs/analysis-reports/**/*.hbs'
]
+ '<%= pkg.assets %>js/templates/nav.js': [
+ '<%= pkg.sources %>hbs/nav/**/*.hbs'
+ ]
clean:
sortValues: (values) ->
- order = ['BLOCKER', 'MINOR', 'CRITICAL', 'INFO', 'MAJOR']
+ order = ['BLOCKER', 'CRITICAL', 'MAJOR', 'MINOR', 'INFO']
_.sortBy values, (v) -> order.indexOf v.val
sortValues: (values) ->
- order = ['OPEN', 'RESOLVED', 'REOPENED', 'CLOSED', 'CONFIRMED']
+ order = ['OPEN', 'REOPENED', 'CONFIRMED', 'RESOLVED', 'CLOSED']
_.sortBy values, (v) -> order.indexOf v.val
$(window).off 'scroll.issues-layout'
- onRender: ->
- @$('.search-navigator-side').isolatedScroll()
-
-
onScroll: ->
scrollTop = $(window).scrollTop()
$('.search-navigator').toggleClass 'sticky', scrollTop >= @topOffset
-<div class="search-navigator-side">
- <div class="search-navigator-filters"></div>
- <div class="search-navigator-facets"></div>
+<div class="container-side container-side-left">
+ <div class="search-navigator-side">
+ <div class="search-navigator-filters"></div>
+ <div class="search-navigator-facets"></div>
+ </div>
</div>
-<div class="search-navigator-workspace">
- <div class="search-navigator-workspace-header"></div>
- <div class="search-navigator-workspace-list"></div>
- <div class="search-navigator-workspace-details"></div>
+<div class="container-main">
+ <div class="search-navigator-workspace">
+ <div class="search-navigator-workspace-header"></div>
+ <div class="search-navigator-workspace-list"></div>
+ <div class="search-navigator-workspace-details"></div>
+ </div>
</div>
{{dt createdAt}} ({{fromNow createdAt}})
</div>
{{else}}
- <div class="search-navigator-facet-container justify">
+ <div class="search-navigator-facet-container">
<input type="text" class="search-navigator-facet-input" name="createdAfter" placeholder="From">
to
<input type="text" class="search-navigator-facet-input" name="createdBefore" placeholder="To">
-<div class="search-navigator-side">
- <div class="search-navigator-filters"></div>
- <div class="search-navigator-facets"></div>
+<div class="container-side container-side-left">
+ <div class="search-navigator-side">
+ <div class="search-navigator-filters"></div>
+ <div class="search-navigator-facets"></div>
+ </div>
</div>
-<div class="search-navigator-workspace">
- <div class="search-navigator-workspace-header"></div>
- <div class="search-navigator-workspace-list"></div>
- <div class="issues-workspace-component-viewer"></div>
+<div class="container-main">
+ <div class="search-navigator-workspace">
+ <div class="search-navigator-workspace-header"></div>
+ <div class="search-navigator-workspace-list"></div>
+ <div class="issues-workspace-component-viewer"></div>
+ </div>
</div>
--- /dev/null
+<div class="sq-logo">
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="100" height="25">
+ <g opacity="1">
+ <path class="sq-logo-arc sq-logo-arc1" d="m96.96313,21.20284l-1.22246,0c0,-9.83637 -8.12817,-17.87548 -18.16693,-17.87548l0,-1.26294c10.69453,0 19.41368,8.6382 19.41368,19.13842l-0.02429,0z"></path>
+ <path class="sq-logo-arc sq-logo-arc2" d="m97.81319,14.62098c-1.47343,-6.17708 -6.47662,-11.36647 -12.79134,-13.15564l0.28336,-1.00388c6.64664,1.93489 11.94128,7.38335 13.47137,13.96522l-0.96339,0.1943z"></path>
+ <path class="sq-logo-arc sq-logo-arc3" d="m99.19757,8.84059c-1.522,-3.32736 -4.07217,-6.18517 -7.26192,-8.11197l0.40479,-0.72862c3.31117,1.99156 6.03945,5.05177 7.56956,8.50866l-0.71243,0.33193z"></path>
+ <path class="sq-logo-letter" d="m0,20.74138c0.72862,0.39669 1.86203,0.72862 3.12497,0.72862c2.72828,0 4.12075,-1.32771 4.12075,-3.12497c-0.02429,-1.39247 -0.80148,-2.38826 -2.59065,-2.98734c-1.18198,-0.40479 -1.5301,-0.66385 -1.5301,-1.13341c-0.02429,-0.46146 0.39669,-0.72862 1.12531,-0.72862c0.79339,0 1.66773,0.26716 2.06442,0.52623l0.51813,-2.05633c-0.59099,-0.26716 -1.57868,-0.59909 -2.71209,-0.59909c-2.35587,0 -3.85359,1.39247 -3.85359,3.18974c-0.04857,1.13341 0.72862,2.19396 2.72018,2.85781c1.09293,0.39669 1.40057,0.59909 1.40057,1.13341c-0.0081,0.53432 -0.39669,0.79339 -1.26294,0.79339c-0.90673,0 -2.06442,-0.39669 -2.59065,-0.72862l-0.53432,2.12919z"></path>
+ <path class="sq-logo-letter" d="m13.10707,13.56043c1.352,0 1.9187,1.39247 1.9187,2.85781c-0.01619,1.73249 -0.73672,2.85781 -1.92679,2.85781c-1.27104,0 -1.93489,-1.19817 -1.93489,-2.85781c-0.01619,-1.39248 0.53432,-2.85781 1.93489,-2.85781m0.10524,-2.19396c-3.10068,0 -5.15701,1.99156 -5.15701,5.11653c0.01619,3.12497 2.18586,4.987 4.9789,4.987c2.57446,0 5.05177,-1.65964 5.05177,-5.1813c0.01619,-2.85781 -1.9268,-4.92223 -4.84937,-4.92223l-0.02429,0"></path>
+ <path class="sq-logo-letter" d="m19.02508,21.20284l2.98734,0l0,-5.51323c0,-0.26716 -0.00809,-0.53432 0.12144,-0.73672c0.1862,-0.52623 0.66385,-1.12531 1.5301,-1.12531c1.05245,0 1.46534,0.86625 1.46534,2.05633l0.02429,5.31892l2.97925,0l0,-5.65085c0,-2.85781 -1.47343,-4.12075 -3.40832,-4.12075c-1.63535,0 -2.59065,0.93102 -2.98734,1.5301l-0.06477,0l-0.13763,-1.32771l-2.59065,0c0.04048,0.86625 0.06477,1.86203 0.06477,3.0602l0.01619,6.50901z"></path>
+ <path class="sq-logo-letter" d="m34.72279,17.74594c0,0.13763 -0.02429,0.33193 -0.08905,0.46956c-0.17001,0.66385 -0.80148,1.12531 -1.5301,1.12531c-0.65576,0 -1.19818,-0.39669 -1.19818,-1.12531c0.02429,-1.13341 1.26294,-1.5301 2.79304,-1.5301l0.02429,1.06054m2.8821,-2.19396c0,-2.25872 -0.97959,-4.18552 -4.16933,-4.18552c-1.78107,0 -3.12497,0.53432 -3.78882,0.86625l0.5748,1.9268c0.63147,-0.39669 1.68392,-0.72862 2.6797,-0.72862c1.44915,0 1.7325,0.72862 1.7325,1.26294l-0.00809,0.12953c-3.40023,0 -5.64276,1.19818 -5.64276,3.65929c0.0081,1.52201 1.19818,2.98734 3.12497,2.98734c1.11722,0 2.12919,-0.46146 2.72018,-1.19818l0.06477,0l0.17811,0.93101l2.6959,0c-0.12144,-0.52622 -0.14573,-1.39247 -0.14573,-2.32349l-0.01619,-3.32736z"></path>
+ <path class="sq-logo-letter" d="m39.07022,21.20284l2.97925,0l0,-4.84937c0,-0.20239 0.02429,-0.46955 0.02429,-0.66385c0.23478,-0.93101 1.00388,-1.5301 2.06442,-1.5301c0.34812,0 0.59909,0.06477 0.79338,0.06477l0.02429,-2.79304c-0.21049,0 -0.35621,-0.06477 -0.61528,-0.06477c-0.9553,0 -2.12919,0.59909 -2.59874,1.99156l-0.08096,0l-0.12143,-1.7244l-2.55017,0c0.05667,0.79339 0.09715,1.7244 0.09715,3.12497l-0.01619,6.44424z"></path>
+ <path class="sq-logo-letter" d="m64.89576,18.54743c0,0.99578 0.04858,1.9268 0.04858,2.65541l-1.5382,0l-0.09715,-1.59487l-0.04047,0c-0.46146,0.80148 -1.51391,1.86203 -3.24641,1.86203c-1.48962,0 -3.31927,-0.86625 -3.31927,-4.25028l0,-5.72372l1.77298,0l0,5.39179c0,1.85393 0.55051,3.11687 2.14538,3.11687c1.20628,0 1.99966,-0.85815 2.33159,-1.65963c0.11334,-0.26716 0.1943,-0.53432 0.1943,-0.86625l-0.01619,-5.98278l1.76488,0l0,7.05142z"></path>
+ <path class="sq-logo-letter" d="m68.01263,17.41402c0,0.20239 0.05667,0.39669 0.05667,0.59909c0.37241,1.26294 1.39247,2.12919 2.65541,2.12919c1.87012,0 2.99544,-1.5301 2.99544,-3.78882c-0.02428,-1.9268 -0.99577,-3.59453 -2.93066,-3.59453c-1.19009,0 -2.32349,0.80148 -2.65542,2.19396c-0.05668,0.20239 -0.12953,0.40479 -0.12953,0.73672l0.00809,1.7244m-1.82155,3.85359c0.04047,-0.66385 0.08096,-1.59487 0.08096,-2.45302l0,-11.77126l1.74059,0l0,6.12041l0.04047,0c0.62338,-1.06864 1.74059,-1.79726 3.33546,-1.79726c2.38825,0 4.12075,1.99156 4.05598,4.987c0.01619,3.4569 -2.19395,5.1813 -4.31505,5.1813c-1.42486,0 -2.52589,-0.52623 -3.2626,-1.86203l-0.07287,0l-0.08096,1.59487l-1.522,0z"></path>
+ <path class="sq-logo-letter" d="m83.28937,15.42246c0.01619,-1.13341 -0.46146,-2.85781 -2.46112,-2.85781c-1.77297,0 -2.59064,1.65963 -2.72018,2.85781l5.1813,0m-5.1813,1.26294c0.04047,2.39635 1.59486,3.39213 3.31927,3.39213c1.27914,0 2.06442,-0.26716 2.72827,-0.53432l0.27526,1.26294c-0.62337,0.26716 -1.67583,0.59909 -3.19784,0.59909c-3.02782,0 -4.79269,-1.9268 -4.79269,-4.85747c-0.01619,-2.92258 1.7325,-5.24607 4.52554,-5.24607c3.18164,0 4.05598,2.79304 4.05598,4.58221c-0.03238,0.33193 -0.07286,0.59909 -0.07286,0.80148l-6.84093,0z"></path>
+ <path class="sq-logo-letter" d="m52.59827,19.34081c-1.64344,1.13341 -3.86978,0.73672 -5.00319,-0.93102c-1.10103,-1.65963 -0.66385,-3.85359 0.93101,-4.9789c1.66773,-1.13341 3.91836,-0.67195 5.05177,0.93102c1.08483,1.65963 0.66385,3.91836 -0.99578,4.9789m2.23444,-5.84515c-1.58677,-2.33158 -4.76031,-2.92258 -7.15667,-1.32771c-2.3073,1.59487 -2.92258,4.78461 -1.32771,7.10809c1.40867,2.06442 4.05599,2.79305 6.3147,1.86203l1.95918,3.18974l1.57868,-1.06054l-1.98347,-3.2626c1.71631,-1.65963 2.03204,-4.37982 0.63957,-6.509l-0.02429,0"></path>
+ </g>
+ </svg>
+</div>
--- /dev/null
+{{#if labelLocalized}}{{labelLocalized}}{{else}}{{t label}}{{/if}}
--- /dev/null
+<div class="container">
+ <div class="navbar-header">
+ <a class="navbar-brand navbar-logo" href="/">
+ {{#notEq space 'global'}}
+ <i class="navbar-back-arrow icon-arrow-left"></i>
+ {{/notEq}}
+ {{> '_nav-logo'}}
+ </a>
+ {{#eq space 'project'}}
+ <div class="navbar-brand" title="{{projectName}}">
+ {{#if navbarCanFavoriteProject}}
+ <a class="js-favorite navbar-favorite {{#if projectFavorite}}icon-favorite{{else}}icon-not-favorite{{/if}}"
+ title="{{#if projectFavorite}}{{t 'click_to_remove_from_favorites'}}{{else}}{{t 'click_to_add_to_favorites'}}{{/if}}">
+ </a>
+ {{/if}}
+ {{projectName}}
+ </div>
+ {{/eq}}
+ {{#eq space 'settings'}}
+ <div class="navbar-brand" title="{{t 'layout.settings'}}">
+ {{t 'layout.settings'}}
+ </div>
+ {{/eq}}
+ </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>
+ {{else}}
+ <li {{#if active}}class="active"{{/if}}>
+ <a href="{{link url}}">
+ {{> '_nav-navbar-label'}}
+ </a>
+ </li>
+ {{/notEmpty}}
+ {{/each}}
+ </ul>
+
+ <ul class="nav navbar-nav navbar-right">
+ <li class="dropdown js-search-dropdown">
+ <a class="dropdown-toggle 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 user}}
+ <li class="dropdown">
+ <a class="dropdown-toggle" data-toggle="dropdown" href="#">
+ {{userName}} <span class="icon-dropdown"></span>
+ </a>
+ <ul class="dropdown-menu dropdown-menu-right">
+ <li>
+ <a href="{{link '/account/index'}}">{{t 'layout.user_panel.my_profile'}}</a>
+ </li>
+ <li>
+ <a href="{{link '/sessions/logout'}}"
+ onclick="if (sonarRecentHistory) { sonarRecentHistory.clear(); }">{{t 'layout.logout'}}</a>
+ </li>
+ </ul>
+ </li>
+ {{else}}
+ <li>
+ <a class="js-login" href="{{link '/sessions/new'}}">{{t 'layout.login'}}</a>
+ </li>
+ {{/if}}
+ {{#if isUserAdmin}}
+ <li>
+ <a href="{{link '/settings/index'}}"><i class="icon-settings navbar-icon"></i></a>
+ </li>
+ {{/if}}
+ </ul>
+
+</div>
--- /dev/null
+<span class="subtitle">{{t 'no_results'}}</span>
--- /dev/null
+<a href="{{url}}" title="{{name}}">
+ {{#if extra}}
+ <span class="navbar-search-extra subtitle">{{extra}}</span>
+ {{/if}}
+ {{#if q}}{{qualifierIcon q}} {{/if}}{{name}}
+</a>
--- /dev/null
+<i class="navbar-search-icon icon-search"></i>
+
+<input class="navbar-search-input js-search-input" type="search" name="q" placeholder="{{t 'search_verb'}}"
+ autocomplete="off">
+
+<div class="js-search-results"></div>
}});
}
-function dashboardParameters() {
+function dashboardParameters (urlHasSomething) {
var queryString = window.location.search;
- var parameters = '';
+ var parameters = [];
var matchDashboard = queryString.match(/did=\d+/);
if (matchDashboard && $j('#is-project-dashboard').length === 1) {
- parameters += (matchDashboard[0] + '&');
+ parameters.push(matchDashboard[0]);
}
var matchPeriod = queryString.match(/period=\d+/);
// If we have a match for period, check that it is not project-specific
var period = parseInt(/period=(\d+)/.exec(queryString)[1]);
if (period <= 3) {
- parameters += matchPeriod[0] + '&';
+ parameters.push(matchPeriod[0]);
}
}
- if (parameters !== '') {
- parameters = '?' + parameters;
+ var query = parameters.join('&');
+ if (query !== '') {
+ query = (urlHasSomething ? '&' : '?') + query;
}
- return parameters;
+ return query;
}
// Define global shortcuts
key('s', function () {
- jQuery('#searchInput').focus().on('keydown', function (e) {
- if (e.keyCode === 27) {
- jQuery('#searchInput').blur();
- }
- });
+ jQuery('.js-search-dropdown-toggle').dropdown('toggle');
return false;
});
});
return BaseFacet.extend({
template: Templates['coding-rules-severity-facet'],
- severities: ['BLOCKER', 'MINOR', 'CRITICAL', 'INFO', 'MAJOR'],
+ severities: ['BLOCKER', 'CRITICAL', 'MAJOR', 'MINOR', 'INFO'],
sortValues: function (values) {
var order = this.severities;
$(window).off('scroll.search-navigator-layout');
},
- onRender: function () {
- this.$('.search-navigator-side').isolatedScroll();
- },
-
onScroll: function () {
var scrollTop = $(window).scrollTop();
$('.search-navigator').toggleClass('sticky', scrollTop >= this.topOffset);
--- /dev/null
+define(function () {
+
+ return Marionette.CollectionView.extend({
+
+ initialize: function () {
+ this.resetSelectedIndex();
+ this.listenTo(this.collection, 'reset', this.resetSelectedIndex);
+ },
+
+ resetSelectedIndex: function () {
+ this.selectedIndex = 0;
+ },
+
+ onRender: function () {
+ this.selectCurrent();
+ },
+
+ submitCurrent: function () {
+ var view = this.children.findByIndex(this.selectedIndex);
+ if (view != null) {
+ view.submit();
+ }
+ },
+
+ selectCurrent: function () {
+ this.selectItem(this.selectedIndex);
+ },
+
+ selectNext: function () {
+ if (this.selectedIndex < this.collection.length - 1) {
+ this.deselectItem(this.selectedIndex);
+ this.selectedIndex++;
+ this.selectItem(this.selectedIndex);
+ }
+ },
+
+ selectPrev: function () {
+ if (this.selectedIndex > 0) {
+ this.deselectItem(this.selectedIndex);
+ this.selectedIndex--;
+ this.selectItem(this.selectedIndex);
+ }
+ },
+
+ selectItem: function (index) {
+ if (index >= 0 && index < this.collection.length) {
+ var view = this.children.findByIndex(index);
+ if (view != null) {
+ view.select();
+ }
+ }
+ },
+
+ deselectItem: function (index) {
+ var view = this.children.findByIndex(index);
+ if (view != null) {
+ view.deselect();
+ }
+ }
+ });
+
+});
--- /dev/null
+define([
+ 'nav/navbar'
+], function (NavbarView) {
+
+ var $ = jQuery,
+ App = new Marionette.Application();
+
+ App.addInitializer(function () {
+ this.navbarView = new NavbarView({
+ app: App,
+ el: $('.navbar'),
+ collection: new Backbone.Collection(window.navbarItems)
+ });
+ this.navbarView.render();
+ });
+
+ window.requestMessages().done(function () {
+ App.start();
+ });
+
+});
--- /dev/null
+define([
+ 'nav/search-view',
+ 'templates/nav'
+], function (SearchView) {
+
+ var $ = jQuery;
+
+ return Marionette.Layout.extend({
+ tagName: 'nav',
+ template: Templates['nav-navbar'],
+
+ regions: {
+ searchRegion: '.js-search-region'
+ },
+
+ events: {
+ 'click .js-login': 'onLoginClick',
+ 'click .js-favorite': 'onFavoriteClick',
+ 'show.bs.dropdown .js-search-dropdown': 'onSearchDropdownShow',
+ 'hidden.bs.dropdown .js-search-dropdown': 'onSearchDropdownHidden'
+ },
+
+ initialize: function () {
+ $(window).on('scroll.nav-layout', this.onScroll);
+ this.projectName = window.navbarProject;
+ this.isProjectFavorite = window.navbarProjectFavorite;
+ },
+
+ onClose: function () {
+ $(window).off('scroll.nav-layout');
+ },
+
+ onScroll: function () {
+ var scrollTop = $(window).scrollTop(),
+ isInTheMiddle = scrollTop > 0;
+ $('.navbar-sticky').toggleClass('middle', isInTheMiddle);
+ },
+
+ onRender: function () {
+ var that = this;
+ this.$el.addClass('navbar-' + window.navbarSpace);
+ this.$el.addClass('navbar-fade');
+ setTimeout(function () {
+ that.$el.addClass('in');
+ }, 0);
+ },
+
+ onLoginClick: function () {
+ var returnTo = window.location.pathname + window.location.search;
+ window.location = baseUrl + '/sessions/new?return_to=' + encodeURIComponent(returnTo) + window.location.hash;
+ return false;
+ },
+
+ onFavoriteClick: function () {
+ var that = this,
+ p = window.process.addBackgroundProcess(),
+ url = baseUrl + '/favourites/toggle/' + window.navbarProjectId;
+ return $.post(url).done(function () {
+ that.isProjectFavorite = !that.isProjectFavorite;
+ that.render();
+ window.process.finishBackgroundProcess(p);
+ }).fail(function () {
+ window.process.failBackgroundProcess(p);
+ });
+ },
+
+ onSearchDropdownShow: function () {
+ var that = this;
+ this.searchRegion.show(new SearchView({
+ hide: function () {
+ that.$('.js-search-dropdown-toggle').dropdown('toggle');
+ }
+ }));
+ },
+
+ onSearchDropdownHidden: function () {
+ this.searchRegion.reset();
+ },
+
+ serializeData: function () {
+ return _.extend(Marionette.Layout.prototype.serializeData.apply(this, arguments), {
+ user: window.SS.user,
+ userName: window.SS.userName,
+ isUserAdmin: window.SS.isUserAdmin,
+
+ space: window.navbarSpace,
+
+ projectName: this.projectName,
+ projectFavorite: this.isProjectFavorite,
+ navbarCanFavoriteProject: window.navbarCanFavoriteProject
+ });
+ }
+ });
+
+});
--- /dev/null
+define([
+ 'common/selectable-collection-view',
+ 'templates/nav'
+], function (SelectableCollectionView) {
+
+ var $ = jQuery,
+
+ SearchItemView = Marionette.ItemView.extend({
+ tagName: 'li',
+ template: Templates['nav-search-item'],
+
+ select: function () {
+ this.$el.addClass('active');
+ },
+
+ deselect: function () {
+ this.$el.removeClass('active');
+ },
+
+ submit: function () {
+ this.$('a')[0].click();
+ }
+ }),
+
+ SearchEmptyView = Marionette.ItemView.extend({
+ tagName: 'li',
+ template: Templates['nav-search-empty']
+ }),
+
+ SearchResultsView = SelectableCollectionView.extend({
+ className: 'menu',
+ tagName: 'ul',
+ itemView: SearchItemView,
+ emptyView: SearchEmptyView
+ });
+
+ return Marionette.Layout.extend({
+ className: 'navbar-search',
+ tagName: 'form',
+ template: Templates['nav-search'],
+
+ regions: {
+ resultsRegion: '.js-search-results'
+ },
+
+ events: {
+ 'submit': 'onSubmit',
+ 'keydown .js-search-input': 'onKeyDown',
+ 'keyup .js-search-input': 'debouncedOnKeyUp'
+ },
+
+ initialize: function () {
+ this.results = new Backbone.Collection();
+ this.resetResultsToDefault();
+ this.resultsView = new SearchResultsView({ collection: this.results });
+ this.debouncedOnKeyUp = _.debounce(this.onKeyUp, 400);
+ this._bufferedValue = '';
+ },
+
+ onRender: function () {
+ var that = this;
+ this.resultsRegion.show(this.resultsView);
+ setTimeout(function () {
+ that.$('.js-search-input').focus();
+ }, 0);
+ },
+
+ onKeyDown: function (e) {
+ if (e.keyCode === 38) {
+ this.resultsView.selectPrev();
+ return false;
+ }
+ if (e.keyCode === 40) {
+ this.resultsView.selectNext();
+ return false;
+ }
+ if (e.keyCode === 13) {
+ this.resultsView.submitCurrent();
+ return false;
+ }
+ if (e.keyCode === 27) {
+ this.options.hide();
+ return false;
+ }
+ },
+
+ onKeyUp: function () {
+ var value = this.$('.js-search-input').val();
+ if (value === this._bufferedValue) {
+ return;
+ }
+ this._bufferedValue = this.$('.js-search-input').val();
+ this.search(value);
+ },
+
+ onSubmit: function () {
+ return false;
+ },
+
+ resetResultsToDefault: function () {
+ var recentHistory = JSON.parse(localStorage.getItem('sonar_recent_history')),
+ history = recentHistory.map(function (historyItem) {
+ return {
+ url: baseUrl + '/dashboard/index?id=' + encodeURIComponent(historyItem.key) + dashboardParameters(true),
+ name: historyItem.name,
+ q: historyItem.icon
+ };
+ }),
+ qualifiers = window.navbarQualifiers.map(function (q) {
+ return {
+ url: baseUrl + '/all_projects?qualifier=' + encodeURIComponent(q),
+ name: t('qualifiers.all', q)
+ };
+ });
+ this.results.reset(history.concat(qualifiers));
+ },
+
+ open: function () {
+ this.$el.addClass('open');
+ },
+
+ disableOpen: function () {
+ this.$el.removeClass('open');
+ },
+
+ search: function (q) {
+ if (q.length < 2) {
+ this.resetResultsToDefault();
+ this.disableOpen();
+ return;
+ }
+ var that = this,
+ url = baseUrl + '/api/components/suggestions',
+ options = { s: q },
+ p = window.process.addBackgroundProcess();
+ this.open();
+ return $.get(url, options).done(function (r) {
+ var collection = [];
+ r.results.forEach(function (domain) {
+ domain.items.forEach(function (item, index) {
+ collection.push(_.extend(item, {
+ q: domain.q,
+ extra: index === 0 ? domain.name : ' ',
+ url: baseUrl + '/dashboard/index?id=' + encodeURIComponent(item.key) + dashboardParameters(true)
+ }));
+ });
+ });
+ that.results.reset(collection);
+ window.process.finishBackgroundProcess(p);
+ }).fail(function() {
+ window.process.failBackgroundProcess(p);
+ });
+ }
+ });
+
+});
--- /dev/null
+/* ========================================================================
+ * Bootstrap: dropdown.js v3.3.1
+ * http://getbootstrap.com/javascript/#dropdowns
+ * ========================================================================
+ * Copyright 2011-2015 Twitter, Inc.
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
+ * ======================================================================== */
+
+
++function ($) {
+ 'use strict';
+
+ // DROPDOWN CLASS DEFINITION
+ // =========================
+
+ var backdrop = '.dropdown-backdrop'
+ var toggle = '[data-toggle="dropdown"]'
+ var Dropdown = function (element) {
+ $(element).on('click.bs.dropdown', this.toggle)
+ }
+
+ Dropdown.VERSION = '3.3.1'
+
+ Dropdown.prototype.toggle = function (e) {
+ var $this = $(this)
+
+ if ($this.is('.disabled, :disabled')) return
+
+ var $parent = getParent($this)
+ var isActive = $parent.hasClass('open')
+
+ clearMenus()
+
+ if (!isActive) {
+ if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) {
+ // if mobile we use a backdrop because click events don't delegate
+ $('<div class="dropdown-backdrop"/>').insertAfter($(this)).on('click', clearMenus)
+ }
+
+ var relatedTarget = { relatedTarget: this }
+ $parent.trigger(e = $.Event('show.bs.dropdown', relatedTarget))
+
+ if (e.isDefaultPrevented()) return
+
+ $this
+ .trigger('focus')
+ .attr('aria-expanded', 'true')
+
+ $parent
+ .toggleClass('open')
+ .trigger('shown.bs.dropdown', relatedTarget)
+ }
+
+ return false
+ }
+
+ Dropdown.prototype.keydown = function (e) {
+ if (!/(38|40|27|32)/.test(e.which) || /input|textarea/i.test(e.target.tagName)) return
+
+ var $this = $(this)
+
+ e.preventDefault()
+ e.stopPropagation()
+
+ if ($this.is('.disabled, :disabled')) return
+
+ var $parent = getParent($this)
+ var isActive = $parent.hasClass('open')
+
+ if ((!isActive && e.which != 27) || (isActive && e.which == 27)) {
+ if (e.which == 27) $parent.find(toggle).trigger('focus')
+ return $this.trigger('click')
+ }
+
+ var desc = ' li:not(.divider):visible a'
+ var $items = $parent.find('[role="menu"]' + desc + ', [role="listbox"]' + desc)
+
+ if (!$items.length) return
+
+ var index = $items.index(e.target)
+
+ if (e.which == 38 && index > 0) index-- // up
+ if (e.which == 40 && index < $items.length - 1) index++ // down
+ if (!~index) index = 0
+
+ $items.eq(index).trigger('focus')
+ }
+
+ function clearMenus(e) {
+ if (e && e.which === 3) return
+ $(backdrop).remove()
+ $(toggle).each(function () {
+ var $this = $(this)
+ var $parent = getParent($this)
+ var relatedTarget = { relatedTarget: this }
+
+ if (!$parent.hasClass('open')) return
+
+ $parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget))
+
+ if (e.isDefaultPrevented()) return
+
+ $this.attr('aria-expanded', 'false')
+ $parent.removeClass('open').trigger('hidden.bs.dropdown', relatedTarget)
+ })
+ }
+
+ function getParent($this) {
+ var selector = $this.attr('data-target')
+
+ if (!selector) {
+ selector = $this.attr('href')
+ selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
+ }
+
+ var $parent = selector && $(selector)
+
+ return $parent && $parent.length ? $parent : $this.parent()
+ }
+
+
+ // DROPDOWN PLUGIN DEFINITION
+ // ==========================
+
+ function Plugin(option) {
+ return this.each(function () {
+ var $this = $(this)
+ var data = $this.data('bs.dropdown')
+
+ if (!data) $this.data('bs.dropdown', (data = new Dropdown(this)))
+ if (typeof option == 'string') data[option].call($this)
+ })
+ }
+
+ var old = $.fn.dropdown
+
+ $.fn.dropdown = Plugin
+ $.fn.dropdown.Constructor = Dropdown
+
+
+ // DROPDOWN NO CONFLICT
+ // ====================
+
+ $.fn.dropdown.noConflict = function () {
+ $.fn.dropdown = old
+ return this
+ }
+
+
+ // APPLY TO STANDARD DROPDOWN ELEMENTS
+ // ===================================
+
+ $(document)
+ .on('click.bs.dropdown.data-api', clearMenus)
+ .on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
+ .on('click.bs.dropdown.data-api', toggle, Dropdown.prototype.toggle)
+ .on('keydown.bs.dropdown.data-api', toggle, Dropdown.prototype.keydown)
+ .on('keydown.bs.dropdown.data-api', '[role="menu"]', Dropdown.prototype.keydown)
+ .on('keydown.bs.dropdown.data-api', '[role="listbox"]', Dropdown.prototype.keydown)
+
+}(jQuery);
window.requestMessages = function() {
- var currentLocale = (navigator.language || navigator.userLanguage).replace('-', '_');
- var cachedLocale = localStorage.getItem('l10n.locale');
+ var currentLocale = window.pageLang,
+ cachedLocale = localStorage.getItem('l10n.locale');
if (cachedLocale !== currentLocale) {
localStorage.removeItem('l10n.timestamp');
}
- var bundleTimestamp = localStorage.getItem('l10n.timestamp');
- var params = {};
+ var bundleTimestamp = localStorage.getItem('l10n.timestamp'),
+ params = { locale: currentLocale };
if (bundleTimestamp !== null) {
params.ts = bundleTimestamp;
}
@import "components/search-navigator";
@import "components/typography";
@import "components/tooltips";
+@import "components/dropdowns";
+@import "components/menu";
--- /dev/null
+@import (reference) "../mixins";
+@import (reference) "../variables";
+@import (reference) "../ui";
+
+
+.dropdown {
+ position: relative;
+}
+
+.dropdown-toggle:focus {
+ outline: 0;
+}
+
+.dropdown-menu {
+ position: absolute;
+ top: 100%;
+ left: 0;
+ z-index: 1000;
+ display: none; // none by default, but block on "open" of the menu
+ float: left;
+ min-width: 160px;
+ padding: 5px 0;
+ list-style: none;
+ font-size: @smallFontSize;
+ text-align: left; // Ensures proper alignment if parent has it changed (e.g., modal footer)
+ background-color: #fff;
+ border: 1px solid @barBorderColor;
+ box-shadow: 0 6px 12px rgba(0, 0, 0, .175);
+ background-clip: padding-box;
+
+ &.pull-right {
+ right: 0;
+ left: auto;
+ }
+
+ // Links within the dropdown menu
+ > li > a {
+ display: block;
+ padding: 3px 20px;
+ line-height: 1.5;
+ clear: both;
+ font-weight: normal;
+ color: @baseFontColor;
+ white-space: nowrap; // prevent links from randomly breaking onto new lines
+ }
+}
+
+// Hover/Focus state
+.dropdown-menu > li > a {
+ &:hover,
+ &:focus {
+ text-decoration: none;
+ color: @baseFontColor;
+ background-color: @lightBlue;
+ }
+}
+
+// Active state
+.dropdown-menu > .active > a {
+ &,
+ &:hover,
+ &:focus {
+ color: @baseFontColor;
+ text-decoration: none;
+ outline: 0;
+ background-color: @lightBlue;
+ }
+}
+
+// Open state for the dropdown
+.open {
+ // Show the menu
+ > .dropdown-menu {
+ display: block;
+ }
+
+ // Remove the outline when :focus is triggered
+ > a {
+ outline: 0;
+ }
+}
+
+// Menu positioning
+//
+// Add extra class to `.dropdown-menu` to flip the alignment of the dropdown
+// menu with the parent.
+.dropdown-menu-right {
+ left: auto; // Reset the default from `.dropdown-menu`
+ right: 0;
+}
+// With v3, we enabled auto-flipping if you have a dropdown within a right
+// aligned nav component. To enable the undoing of that, we provide an override
+// to restore the default dropdown menu alignment.
+//
+// This is only for left-aligning a dropdown menu within a `.navbar-right` or
+// `.pull-right` nav component.
+.dropdown-menu-left {
+ left: 0;
+ right: auto;
+}
+
+// Dropdown section headers
+.dropdown-header {
+ display: block;
+ padding: 3px 20px;
+ font-size: @smallFontSize;
+ color: @baseFontColor;
+ white-space: nowrap; // as with > li > a
+}
+
+// Backdrop to catch body clicks on mobile, etc.
+.dropdown-backdrop {
+ position: fixed;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ top: 0;
+ z-index: (1000 - 10);
+}
--- /dev/null
+@import (reference) "../mixins";
+@import (reference) "../variables";
+@import (reference) "../ui";
+
+.menu {
+ min-width: 160px;
+ padding: 5px 0;
+ list-style: none;
+ font-size: @smallFontSize;
+ text-align: left;
+ background-color: #fff;
+ background-clip: padding-box;
+
+ > li > a,
+ > li > span {
+ display: block;
+ padding: 3px 20px;
+ line-height: 1.5;
+ clear: both;
+ font-weight: normal;
+ .text-ellipsis;
+ }
+
+ > li > a {
+ color: @baseFontColor;
+ }
+
+ .divider {
+ height: 1px;
+ margin: 9px 0;
+ overflow: hidden;
+ background-color: @barBorderColor;
+ }
+}
+
+
+.menu > li > a {
+ &:hover, &:focus {
+ text-decoration: none;
+ color: @baseFontColor;
+ background-color: @lightBlue;
+ }
+}
+
+
+.menu > .active > a {
+ &, &:hover, &:focus {
+ color: @baseFontColor;
+ text-decoration: none;
+ outline: 0;
+ background-color: @lightBlue;
+ }
+}
@import (reference) "../mixins";
@import (reference) "../ui";
-@sideWidth: 300px;
+@sideWidth: 180px;
.search-navigator {
+ .clearfix;
- &.sticky {
-
- .search-navigator-workspace-header {
- position: fixed;
- z-index: 4;
- top: 0;
- left: @sideWidth;
- right: 0;
- }
-
- .search-navigator-workspace-list,
- .search-navigator-workspace-details {
- padding-top: 22px + 5px + 5px + 1px + 10px;
- }
-
- .search-navigator-side {
- position: fixed;
- z-index: 4;
- top: 0;
- bottom: 0;
- overflow-y: auto;
- }
-
- }
+// &.sticky {
+//
+// .search-navigator-workspace-header {
+// position: fixed;
+// z-index: 4;
+// top: 0;
+// left: @sideWidth;
+// right: 0;
+// }
+//
+// .search-navigator-workspace-list,
+// .search-navigator-workspace-details {
+// padding-top: 22px + 5px + 5px + 1px + 10px;
+// }
+//
+// .search-navigator-side {
+// position: fixed;
+// z-index: 4;
+// top: 0;
+// bottom: 0;
+// overflow-y: auto;
+// }
+//
+// }
}
.search-navigator-side {
- position: fixed;
- z-index: 100;
- width: @sideWidth;
- top: 30px; left: 0; bottom: 0;
.box-sizing(border-box);
background-color: @barBorderColor;
overflow-x: hidden;
}
.search-navigator-facet-half {
- width: 45%;
-
- &:nth-child(odd) {
- margin-right: 10%;
- }
}
.search-navigator-facet-header {
}
.search-navigator-facet-input {
- width: @sideWidth * 0.4;
+ width: 100%;
}
.search-navigator-filters {
}
.search-navigator-workspace {
- padding-left: @sideWidth;
+
}
.search-navigator-workspace-header {
margin-bottom: 10px;
padding: 5px 0;
line-height: 22px;
- border-bottom: 1px solid @barBorderColor;
- background-color: @barBackgroundColor;
font-size: @smallFontSize;
.button-group,
top: 0;
right: 0;
padding: 5px 10px;
- background-color: @barBackgroundColor;
font-size: 0;
white-space: nowrap;
position: absolute;
top: 0; bottom: 0; right: 100%;
width: 10px;
- background-image: linear-gradient(to right, fade(@barBackgroundColor, 0%), @barBackgroundColor 75%);
+ background-image: linear-gradient(to right, fade(#fff, 0%), #fff 75%);
}
}
}
.search-navigator-workspace-list {
- padding: 0 5px;
- .issue {
- max-width: none;
- }
}
.search-navigator-workspace-details {
content: "\f002";
font-size: @iconFontSize;
}
+.icon-user:before {
+ content: "\e60a";
+}
/*
.issues {
- &.sticky {
-
- .issues-workspace-list,
- .issues-workspace-component-viewer {
- padding-top: 22px + 5px + 5px + 1px + 10px;
- }
-
- }
+// &.sticky {
+//
+// .issues-workspace-list,
+// .issues-workspace-component-viewer {
+// padding-top: 22px + 5px + 5px + 1px + 10px;
+// }
+//
+// }
}
.issues-workspace-list-component {
--- /dev/null
+@import (reference) "mixins";
+@import (reference) "variables";
+@import (reference) "ui";
+
+@pageWidth: 1020px;
+@containerWidth: 980px;
+@sideWidth: 200px;
+@sideMargin: 10px;
+
+html {
+ overflow-y: scroll;
+}
+
+body {
+ min-width: @pageWidth;
+}
+
+.container {
+ width: @containerWidth;
+ margin: 0 auto;
+ .box-sizing(border-box);
+}
+
+.container-one-third {
+ width: @containerWidth / 3;
+}
+
+.container-two-thirds {
+ width: @containerWidth / 3 * 2;
+}
+
+.container-one-half {
+ width: @containerWidth / 2;
+}
+
+.container-side {
+ width: @sideWidth;
+ .box-sizing(border-box);
+}
+
+.container-side-left {
+ float: left;
+ padding-right: @sideMargin;
+}
+
+.container-side-right {
+ float: right;
+ padding-left: @sideMargin;
+}
+
+.container-main {
+ float: left;
+ width: @containerWidth - @sideWidth;
+}
@import (reference) "variables";
@import (reference) "ui";
-@media print {
- /* ------------------- PRINT ------------------- */
- html, body {
- font-size: 8pt;
- }
-
- a, a:link, a:visited {
- text-decoration: none;
- border-bottom: 0;
- }
-
- .noprint {
- display: none !important;
- }
-
- .print {
- display: inline;
- position: static;
- left: 0;
- }
-
- #hd, #sidebar, #crumbs {
- display: none;
- }
-
- .with_sidebar, .wo_sidebar {
- padding: 0 !important;
- margin: 0;
- }
-
- #content {
- margin-left: 0 !important;
- }
-
- .widget thead, .widget tfoot {
- // Fix for phantomjs bug about wrapping tables
- display: table-row-group;
- }
-}
-
-@media screen {
- .print {
- display: none;
- }
-}
-
-body, a {
- color: #444;
-}
-
-/* LAYOUT */
-#container {
- height: auto !important;
- min-width: 940px;
- min-height: 500px;
-}
-
#hd {
- color: #FFF;
- background: #262626;
- padding: 0 10px;
- height: 30px;
- line-height: 30px;
- font-size: 93%;
- margin: 0;
position: relative;
-}
-
-#hd #nav-left > ul > li {
- height: 30px;
+ background: @darkColor;
+ height: 40px;
+ line-height: 40px;
+ color: @lightColor;
}
#hd a {
color: #fff;
.link-no-underline;
-
- &.selected, &:hover, &:focus { color: @blue; }
}
#nav-left {
#nav-left > ul > li {
float: left;
- padding: 0 20px 0 0;
+}
+
+#nav-left > ul > li > a {
+ display: block;
+ height: 40px;
+ padding: 0 10px;
+ .box-sizing(border-box);
+}
+
+#nav-left > ul > li > a:hover,
+#nav-left > ul > li > a:focus,
+#nav-left > ul > li > a.selected {
+ background-color: #000;
+}
+
+#nav-left > ul > li > a.selected {
+ color: @blue !important;
}
#nav-left > ul > li > a,
#nav > ul > li > a {
- font-size: @smallFontSize;
+ font-size: @baseFontSize;
font-weight: 300;
letter-spacing: 0.05em;
}
#body {
position: relative;
+ padding-top: 10px;
}
.with_sidebar {
}
#sidebar {
- position: absolute;
- top: 0; left: 10px;
- width: 150px;
-
- &.sticky {
- position: fixed;
- }
+ margin-bottom: 10px;
}
ul.sidebar {
}
ul.sidebar li {
+ display: inline-block;
list-style-type: none;
padding: 3px 10px;
}
}
.page {
- padding: 10px;
+ padding: 10px 0;
}
.page-split-left {
min-width: 200px;
.nolayout {
padding: 10px;
}
+
+@media print {
+ /* ------------------- PRINT ------------------- */
+ html, body {
+ font-size: 8pt;
+ }
+
+ a, a:link, a:visited {
+ text-decoration: none;
+ border-bottom: 0;
+ }
+
+ .noprint {
+ display: none !important;
+ }
+
+ .print {
+ display: inline;
+ position: static;
+ left: 0;
+ }
+
+ #hd, #sidebar, #crumbs {
+ display: none;
+ }
+
+ .with_sidebar, .wo_sidebar {
+ padding: 0 !important;
+ margin: 0;
+ }
+
+ #content {
+ margin-left: 0 !important;
+ }
+
+ .widget thead, .widget tfoot {
+ // Fix for phantomjs bug about wrapping tables
+ display: table-row-group;
+ }
+}
+
+@media screen {
+ .print {
+ display: none;
+ }
+}
--- /dev/null
+@import (reference) "mixins";
+@import (reference) "variables";
+@import (reference) "ui";
+
+@navbarBackground: #262626;
+@navbarProjectBackground: #565656;
+@navbarSettingsBackground: #78674d;
+
+@navbarHeight: 36px;
+@navbarLineHeight: 20px;
+@navbarTopPadding: (@navbarHeight - @navbarLineHeight) / 2;
+
+.navbar-sticky {
+ padding-top: @navbarHeight !important;
+
+ .navbar {
+ position: fixed;
+ z-index: 10;
+ top: 0;
+ left: 0;
+ right: 0;
+ margin-bottom: 0;
+ .trans(background-color, 0.5s ease);
+ }
+}
+
+.navbar, [class^="navbar-"], [class*=" navbar-"] {
+ .box-sizing(border-box);
+}
+
+.navbar {
+ .clearfix;
+ border-bottom: 3px solid @blue;
+}
+
+.navbar-fade {
+ .navbar-nav {
+ opacity: 0;
+ .trans(opacity);
+ }
+
+ .navbar-favorite {
+ margin-right: -23px;
+ .trans(margin);
+ }
+
+ &.in {
+ .navbar-nav {
+ opacity: 1;
+ }
+
+ .navbar-favorite {
+ margin-right: 0;
+ }
+ }
+}
+
+.navbar a {
+ .link-no-underline;
+}
+
+.navbar-header {
+ float: left;
+}
+
+.navbar-brand {
+ position: relative;
+ float: left;
+ height: @navbarHeight;
+ padding: @navbarTopPadding 10px;
+ font-size: @bigFontSize;
+ line-height: @navbarLineHeight;
+ color: @lightColor;
+
+ max-width: 240px;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;;
+}
+
+.navbar-logo {
+ @topPadding: (@navbarHeight - 25) / 2;
+ padding-top: @topPadding !important;
+ padding-bottom: @topPadding !important;
+}
+
+.navbar-back-arrow {
+ position: absolute;
+ top: 13px;
+ left: 0;
+
+ &:before {
+ font-size: 18px;
+ }
+}
+
+.navbar-nav {
+ float: left;
+}
+
+.navbar-nav > li {
+ float: left;
+}
+
+.navbar-nav > li > a {
+ padding: @navbarTopPadding 10px;
+ line-height: @navbarLineHeight;
+ color: @lightColor;
+ font-size: 12px;
+ font-weight: 300;
+ letter-spacing: 0.05em;
+
+ &:hover, &:focus {
+ color: @lightColor;
+ }
+}
+
+.navbar-nav > .active > a,
+.navbar-nav > .dropdown.open > a {
+ color: @lightColor;
+}
+
+
+.navbar-icon:before {
+ font-size: @iconFontSize;
+}
+
+.navbar-favorite {
+ position: relative;
+ top: -2px;
+}
+
+.navbar-right {
+ float: right;
+}
+
+.navbar-search {
+ position: relative;
+ width: 240px;
+ .box-sizing(border-box);
+ .trans(width);
+
+ &.open {
+ width: 40vw;
+ }
+}
+
+.navbar-search-input {
+ width: 100%;
+ padding: 0 20px 0 40px !important;
+ border: none !important;
+}
+
+.navbar-search-icon {
+ position: absolute;
+ top: 4px;
+ left: 20px;
+ color: @secondFontColor;
+
+ &:before {
+ font-size: @iconSmallFontSize;
+ }
+}
+
+.navbar-search-extra {
+ display: inline-block;
+ width: 90px;
+ margin-right: 10px;
+ text-align: right;
+}
+
+
+.navbar-global {
+ background-color: @navbarBackground;
+
+ .navbar-sticky.middle & {
+ background-color: fade(@navbarBackground, 90%);
+ }
+
+ .navbar-nav > li > a:hover,
+ .navbar-nav > li > a:focus,
+ .navbar-nav > .active > a,
+ .navbar-nav > .dropdown.open > a {
+ background-color: darken(@navbarBackground, 10%);
+ }
+}
+
+
+.navbar-project {
+ background-color: @navbarProjectBackground;
+
+ .navbar-sticky.middle & {
+ background-color: fade(@navbarProjectBackground, 90%);
+ }
+
+ .navbar-nav > li > a:hover,
+ .navbar-nav > li > a:focus,
+ .navbar-nav > .active > a,
+ .navbar-nav > .dropdown.open > a {
+ background-color: darken(@navbarProjectBackground, 10%);
+ }
+}
+
+
+.navbar-settings {
+ background-color: @navbarSettingsBackground;
+
+ .navbar-sticky.middle & {
+ background-color: fade(@navbarSettingsBackground, 90%);
+ }
+
+ .navbar-nav > li > a:hover,
+ .navbar-nav > li > a:focus,
+ .navbar-nav > .active > a,
+ .navbar-nav > .dropdown.open > a {
+ background-color: darken(@navbarSettingsBackground, 10%);
+ }
+}
cursor: pointer;
}
-.dropdown {
- cursor: pointer;
- display: inline-block;
- text-decoration: none !important;
- /* zoom and *display = ie7 hack for display:inline-block */
- zoom: 1;
- *display: inline;
-}
-
-.dropdown-menu {
- background-clip: padding-box;
- background-color: #FFFFFF;
- border: 1px solid #DDD;
- box-shadow: 10px 10px 20px rgba(0, 0, 0, 0.5);
- float: left;
- margin: 0;
- max-width: 220px;
- min-width: 160px;
- padding: 0;
- position: absolute;
- z-index: 1000;
-}
-
-.dropdown-menu h2 {
- padding: 0 8px;
- font-size: 100%;
- font-weight: bold;
-}
-
-.dropdown-menu li {
- list-style-type: none !important;
- line-height: 24px;
- height: 24px;
- padding: 0 8px;
- cursor: pointer !important;
- float: none !important;
-}
-
-.dropdown-menu li:hover {
- background-color: @lightBlue !important;
-}
-
-.dropdown-menu a {
- text-decoration: none !important;
- border-bottom: none !important;
- color: @baseFontColor !important;
-}
-
.form-key-cell {
padding: 2px 8px 4px 10px;
text-align: right;
.sonar-d3 .plot .arc:hover,
.sonar-d3 .plot .arc.hover {
- opacity: 1;
+ fill: #4f9ed3;
}
.sonar-d3 .plot .line {
top: 5px; right: 5px;
line-height: @iconSmallFontSize;
color: #fff;
- opacity: 0.5;
+ fill: #fff;
.link-no-underline;
- &:hover { opacity: 1; }
+ &:hover { fill: #4f9ed3; }
}
.sonar-d3 .treemap-link i,
}
}
+
+
+.sq-logo {
+ .sq-logo-arc {
+ fill: @blue;
+ }
+
+ .sq-logo-letter {
+ fill: #fff;
+ }
+
+ &:not(.sq-logo-small):hover {
+ .sq-logo-arc1 {
+ .animation(sq-logo-arc1-animation 0.75s infinite);
+ }
+ .sq-logo-arc2 {
+ .animation(sq-logo-arc2-animation 0.75s infinite);
+ }
+ .sq-logo-arc3 {
+ .animation(sq-logo-arc3-animation 0.75s infinite);
+ }
+ }
+}
+
+.sq-logo-small {
+ .sq-logo-arc {
+ fill: #fff;
+ }
+}
+
+@-webkit-keyframes sq-logo-arc1-animation {
+ 0% { fill: #4f9ed3; }
+ 33% { fill: #b5c8d3; }
+ 67% { fill: #4f9ed3; }
+ 100% { fill: #4f9ed3; }
+}
+@-webkit-keyframes sq-logo-arc2-animation {
+ 0% { fill: #4f9ed3; }
+ 33% { fill: #4f9ed3; }
+ 67% { fill: #b5c8d3; }
+ 100% { fill: #4f9ed3; }
+}
+@-webkit-keyframes sq-logo-arc3-animation {
+ 0% { fill: #4f9ed3; }
+ 33% { fill: #4f9ed3; }
+ 67% { fill: #4f9ed3; }
+ 100% { fill: #b5c8d3; }
+}
+@keyframes sq-logo-arc1-animation {
+ 0% { fill: #4f9ed3; }
+ 33% { fill: #b5c8d3; }
+ 67% { fill: #4f9ed3; }
+ 100% { fill: #4f9ed3; }
+}
+@keyframes sq-logo-arc2-animation {
+ 0% { fill: #4f9ed3; }
+ 33% { fill: #4f9ed3; }
+ 67% { fill: #b5c8d3; }
+ 100% { fill: #4f9ed3; }
+}
+@keyframes sq-logo-arc3-animation {
+ 0% { fill: #4f9ed3; }
+ 33% { fill: #4f9ed3; }
+ 67% { fill: #4f9ed3; }
+ 100% { fill: #b5c8d3; }
+}
input[type=text],
input[type=password],
input[type=email],
+input[type=search],
textarea {
border: 1px solid @darkGrey;
.box-sizing(border-box);
input[type=text],
input[type=password],
-input[type=email] {
- height: 22px;
+input[type=email],
+input[type=search] {
+ height: @formControlHeight;
padding: 0 3px;
}
+input[type=search] {
+ -webkit-appearance: none;
+}
+
textarea {
padding: 3px;
}
input[type=button] {
display: inline-block;
vertical-align: baseline;
- height: 22px;
+ height: @formControlHeight;
margin: 0 1px;
padding: 0 10px;
}
}
-.button { line-height: 22px; }
+.button { line-height: @formControlHeight; }
.button-red {
&:hover, &:focus {
max-width: 900px;
margin-left: -150px;
padding: 0 10px;
- line-height: 22px;
+ line-height: @formControlHeight;
background-color: #f0e8ac;
border-radius: 0 0 3px 3px;
text-align: center;
font-weight: 500;
text-align: center;
}
+
+
+.nav {
+ margin: 0;
+ padding: 0;
+ list-style: none;
+}
+
+.nav > li {
+ position: relative;
+ display: block;
+}
+
+.nav > li > a {
+ position: relative;
+ display: block;
+ padding: 10px 15px;
+}
@darkBlue: darken(@blue, 20%);
+@darkColor: #262626;
+@lightColor: #fff;
+
@highlighted: @blue;
@highlightedBackground: @lightBlue;
@contextBackground: lighten(@purple, 40%);
@issueBorderColor: desaturate(darken(@issueBackgroundColor, 40%), 30%);
+
+/*
+ * Sizes
+ */
+
+@formControlHeight: 22px;
+
+
+
/*
* Icons
*/
qualifier_results['items']=resource_indexes.map do |resource_index|
resource=resources_by_id[resource_index.resource_id]
{
- 'id' => resource.id,
+ 'key' => resource.key,
'name' => resource.name(true)
}
end
class ComparisonController < ApplicationController
- SECTION=Navigation::SECTION_HOME
+ SECTION=Navigation::SECTION_TOOLS
def index
snapshots = []
#
class DependenciesController < ApplicationController
- SECTION=Navigation::SECTION_HOME
+ SECTION=Navigation::SECTION_TOOLS
SEARCH_MINIMUM_SIZE=3
QUALIFIERS=['TRK', 'BRC', 'LIB']
SECTION_QUALITY_PROFILES = Navigation.new('quality_profiles', false)
SECTION_QUALITY_GATES = Navigation.new('quality_gates', false)
SECTION_CODING_RULES = Navigation.new('coding_rules', false)
+ SECTION_TOOLS = Navigation.new('tools', false)
end
<% if @breadcrumbs %>
<div id="crumbs">
- <ul id="crumbs-ops">
- <% if displayed_resource && !display_only_root %>
- <li>
- <%= link_to_favourite(displayed_resource) -%>
- </li>
- <% if has_role?(:admin, displayed_resource) && !displayed_resource.entity? %>
- <%= render 'layouts/menu_resource_settings' -%>
+ <div class="container">
+ <ul id="bc">
+ <%
+ @breadcrumbs.each do |breadcrumb|
+ %>
+ <li>
+ <% if breadcrumb.is_a?(String) %>
+ <span><%= h breadcrumb -%></span>
+ <%
+ elsif breadcrumb.is_a?(Hash)
+ name = breadcrumb[:name]
+ url = breadcrumb[:url]
+ icon = breadcrumb[:icon]
+ %>
+ <% if icon %>
+ <img src="<%= ApplicationController.root_context -%>/images/<%= icon -%>" width="16" height="16">
+ <% end %>
+ <%= link_to_if url, h(name), url -%>
+ <% elsif breadcrumb.respond_to?(:html) %>
+ <%= breadcrumb.html -%>
+ <% end %>
+ </li>
<% end %>
- <% end %>
- </ul>
- <ul id="bc">
- <%
- @breadcrumbs.each do |breadcrumb|
- %>
- <li>
- <% if breadcrumb.is_a?(String) %>
- <span><%= h breadcrumb -%></span>
- <%
- elsif breadcrumb.is_a?(Hash)
- name = breadcrumb[:name]
- url = breadcrumb[:url]
- icon = breadcrumb[:icon]
- %>
- <% if icon %><img src="<%= ApplicationController.root_context -%>/images/<%= icon -%>" width="16" height="16"><% end %>
- <%= link_to_if url, h(name), url -%>
- <% elsif breadcrumb.respond_to?(:html) %>
- <%= breadcrumb.html -%>
- <% end %>
- </li>
- <% end %>
- </ul>
+ </ul>
+ </div>
</div>
<% elsif displayed_resource %>
+ <%
+ resource_link = {:controller => params[:controller], :action => params[:action]}
+ if display_only_root
+ resource_link = {:controller => 'dashboard', :action => 'index'}
+ end
- <div id="crumbs">
- <ul id="crumbs-ops">
- <% if displayed_resource && !display_only_root %>
- <li>
- <%= link_to_favourite(displayed_resource) -%>
- </li>
- <% if (has_role?(:admin, displayed_resource) || profiles_administrator?) && !displayed_resource.entity? %>
- <%= render 'layouts/menu_resource_settings' -%>
- <% end %>
- <% end %>
- </ul>
- <ul id="bc">
- <%
- resource_link = {:controller => params[:controller], :action => params[:action]}
- if display_only_root
- resource_link = {:controller => 'dashboard', :action => 'index'}
- end
+ # ======== Path for resources ========
- # ======== 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
+ %>
- 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|
- %>
- <li>
- <%= qualifier_icon(resource) -%>
-
- <%=
- root = "#{ApplicationController.root_context}/#{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
- "<a href='#{root + path}'>#{h(resource.name)}</a>"
- -%>
- </li>
- <%
- end
- end
+ <% if resources.length > 1 %>
+ <div id="crumbs">
+ <div class="container">
+ <ul id="bc">
+ <%
+ resources.each do |resource|
+ %>
+ <li>
+ <%= qualifier_icon(resource) -%>
+
+ <%=
+ root = "#{ApplicationController.root_context}/#{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
+ "<a href='#{root + path}'>#{h(resource.name)}</a>"
+ -%>
+ </li>
+ <%
+ end
+ end
# ======== Path for issue ========
if @issue
%>
- <li>
- <%= link_to message('issue') + ' #' + @issue.key.to_s -%>
- </li>
- <%
- end
- %>
+ <li>
+ <%= link_to message('issue') + ' #' + @issue.key.to_s -%>
+ </li>
+ <%
+ end
+ %>
</ul>
- </div>
+ </div>
+ </div>
+ <% end %>
<% end %>
@project=@resource unless @project || selected_section==Navigation::SECTION_HOME
period_param = "period=#{u(params[:period])}" if params[:period]
%>
-<div id="container">
- <%= yield :header -%>
- <div id="hd">
- <div id="nav-left">
- <ul>
- <li>
- <a href="<%= ApplicationController.root_context -%>/" class="<%= 'selected' if selected_section==Navigation::SECTION_HOME || selected_section==Navigation::SECTION_RESOURCE -%>"><%= message('layout.dashboards') -%></a>
- </li>
- <%= render 'layouts/menu_projects' -%>
- <li>
- <a href="<%= ApplicationController.root_context -%>/measures/search?qualifiers[]=TRK" class="<%= 'selected' if selected_section==Navigation::SECTION_MEASURES -%>"><%= message('layout.measures') -%></a>
- </li>
- <li>
- <a href="<%= ApplicationController.root_context -%>/issues/index" class="<%= 'selected' if selected_section==Navigation::SECTION_ISSUES -%>"><%= message('issues.page') -%></a>
- </li>
- <li>
- <a href="<%= ApplicationController.root_context -%>/coding_rules" class="<%= 'selected' if selected_section==Navigation::SECTION_CODING_RULES -%>"><%= message('coding_rules.page') -%></a>
- </li>
- <li>
- <a href="<%= ApplicationController.root_context -%>/profiles" class="<%= 'selected' if selected_section==Navigation::SECTION_QUALITY_PROFILES -%>"><%= message('quality_profiles.page') -%></a>
- </li>
- <li>
- <a href="<%= ApplicationController.root_context -%>/quality_gates" class="<%= 'selected' if selected_section==Navigation::SECTION_QUALITY_GATES -%>"><%= message('quality_gates.page') -%></a>
- </li>
- </ul>
- </div>
- <div id="nav">
- <ul>
- <li>
- <input type="text" size="15" name="search" id="searchInput" value="<%= message('search_verb') -%>">
- <img src="<%= ApplicationController.root_context -%>/images/loading-small.gif" id="searchingResources" style="display:none">
- </li>
- <% if logged_in? %>
- <%= render 'layouts/menu_user' -%>
- <% else %>
- <li><a id="login-link" href="<%= ApplicationController.root_context -%>/sessions/new?return_to=<%= u (request.request_uri) -%>"><%= message('layout.login') -%></a></li>
+<div id="container" class="navbar-sticky">
+ <%
+ navbar_class = 'navbar-global'
+ navbar_class = 'navbar-project' if selected_section==Navigation::SECTION_RESOURCE
+ navbar_class = 'navbar-settings' if selected_section==Navigation::SECTION_CONFIGURATION
+ %>
+ <nav class="navbar <%= navbar_class -%>">
+ <div class="container">
+ <div class="navbar-header">
+ <a class="navbar-brand navbar-logo" href="<%= ApplicationController.root_context -%>/">
+ <%= render 'layouts/logo' -%>
+ </a>
+ <% if selected_section==Navigation::SECTION_RESOURCE %>
+ <div class="navbar-brand"><%= @project.root_project().name -%></div>
<% end %>
- <% if is_admin? %>
- <li><a href="<%= ApplicationController.root_context -%>/settings/index" class="<%= 'selected' if selected_section==Navigation::SECTION_CONFIGURATION -%>"><%= message('layout.settings') -%></a></li>
- <% end %>
- </ul>
+ </div>
</div>
- <div id="searchResourcesResults" class="autocomplete" style="display:none"
- data-results="<%= message('search.results') -%>"
- data-no-results="<%= message('no_results') -%>"></div>
- </div>
- <%= render 'layouts/breadcrumb' if @breadcrumbs || selected_section==Navigation::SECTION_RESOURCE -%>
- <div id="body">
- <% if selected_section && selected_section.show_sidebar && !@hide_sidebar %>
- <div id="sidebar">
- <ul class="sidebar blue-sidebar">
- <% if selected_section==Navigation::SECTION_HOME %>
- <% ActiveDashboard.user_dashboards(current_user, true).each do |active_dashboard| %>
- <li class="<%= 'active' if @dashboard && controller.controller_path=='dashboard' && active_dashboard.dashboard_id==@dashboard.id -%>">
- <a href="<%= ApplicationController.root_context -%>/dashboard/?did=<%= active_dashboard.dashboard_id -%>"><%= h active_dashboard.dashboard.name(true) -%></a>
- </li>
- <% end %>
-
- <% 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}")
- %>
- <li class="<%= 'active' if selected -%>">
- <a href="<%= ApplicationController.root_context -%><%= page_url -%>"><%= h message(page.getId() + '.page', :default => page.getTitle()) -%></a></li>
- <% end %>
-
- <li class="spacer"></li>
- <li class="sidebar-title"><%= message('sidebar.tools') -%></li>
-
- <li class="<%= 'active' if controller.controller_path=='dependencies' -%>">
- <a href="<%= ApplicationController.root_context -%>/dependencies/index"><%= message('dependencies.page') -%></a></li>
- <li class="<%= 'active' if request.request_uri.include?('/comparison/index') -%>">
- <a href="<%= ApplicationController.root_context -%>/comparison/index"><%= message('comparison.page') -%></a>
- </li>
-
- <% elsif selected_section==Navigation::SECTION_RESOURCE %>
- <% ActiveDashboard.user_dashboards(current_user, false).each do |active_dashboard| %>
- <li class="<%= 'active' if @dashboard && controller.controller_path=='dashboard' && active_dashboard.dashboard_id==@dashboard.id -%>">
- <a href="<%= ApplicationController.root_context -%>/dashboard/index/<%= @project.id -%>?did=<%= active_dashboard.dashboard_id -%><%= "&"+period_param if period_param -%>"><%= h active_dashboard.dashboard.name(true) -%></a>
- </li>
- <% end %>
-
- <% if @snapshot %>
- <li class="spacer"></li>
- <li class="sidebar-title"><%= message('sidebar.tools') -%></li>
- <li class="<%= 'active' if request.request_uri.include?('/components/index') -%>">
- <a href="<%= ApplicationController.root_context -%>/components/index/<%= @project.id -%>"><%= message('components.page') -%></a>
- </li>
- <li class="<%= 'active' if request.request_uri.include?('/drilldown/issues') -%>">
- <a href="<%= ApplicationController.root_context -%>/drilldown/issues/<%= @project.id -%><%= "?"+period_param if period_param -%>"><%= message('issues_drilldown.page') -%></a>
- </li>
- <% 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()}")
- %>
- <li class="<%= 'active' if request.request_uri.include?(page_url) -%>">
- <a href="<%= ApplicationController.root_context -%><%= page_url -%>"><%= h message(page.getId() + '.page', :default => page.getTitle()) -%></a>
- </li>
- <% end %>
- <li class="<%= 'active' if request.request_uri.include?('/design/index') -%>">
- <a href="<%= ApplicationController.root_context -%>/design/index/<%= @project.key -%>"><%= message('design.page') -%></a>
- </li>
- <li class="<%= 'active' if request.request_uri.include?('/libraries/index') -%>">
- <a href="<%= ApplicationController.root_context -%>/libraries/index/<%= @project.key -%>"><%= message('libraries.page') -%></a>
- </li>
- <% if controller.java_facade.getResourceTypeBooleanProperty(@project.qualifier, 'comparable') %>
- <li class="<%= 'active' if request.request_uri.include?('/comparison/index') -%>">
- <a href="<%= ApplicationController.root_context -%>/comparison/index?resource=<%= @project.key -%>"><%= message('comparison.page') -%></a>
- </li>
- <% end %>
- <% end %>
-
- <% elsif selected_section==Navigation::SECTION_CONFIGURATION %>
+ </nav>
- <% if is_admin? %>
-
- <li class="sidebar-title"><%= message('sidebar.project_settings') -%></li>
- <li class="<%= 'active' if request.request_uri.include?('/settings') -%>">
- <a href="<%= ApplicationController.root_context -%>/settings/index"><%= message('settings.page') -%></a></li>
- <li class="<%= 'active' if controller.controller_path=='metrics' -%>">
- <a href="<%= ApplicationController.root_context -%>/metrics/index"><%= message('manual_metrics.page') -%></a></li>
- <li class="<%= 'active' if controller.controller_path=='admin_dashboards' -%>">
- <a href="<%= ApplicationController.root_context -%>/admin_dashboards/index"><%= message('default_dashboards.page') -%></a></li>
- <% 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()}")
- %>
- <li class="<%= 'active' if request.request_uri.include?(page_url) -%>">
- <a href="<%= ApplicationController.root_context -%><%= page_url -%>"><%= h message(page.getId() + '.page', :default => page.getTitle()) %></a>
- </li>
- <% end %>
- <li class="spacer"></li>
- <li class="sidebar-title"><%= message('sidebar.security') -%></li>
- <li class="<%= 'active' if request.request_uri.include?('/users') -%>"><a href="<%= ApplicationController.root_context -%>/users"><%= message('users.page') -%></a>
- </li>
- <li class="<%= 'active' if request.request_uri.include?('/groups') -%>">
- <a href="<%= ApplicationController.root_context -%>/groups/index"><%= message('user_groups.page') -%></a></li>
- <li class="<%= 'active' if request.request_uri.include?('/roles/global') -%>">
- <a href="<%= ApplicationController.root_context -%>/roles/global"><%= message('global_permissions.page') -%></a></li>
- <li class="<%= 'active' if request.request_uri.include?('/roles/projects') || request.request_uri.include?('/permission_templates') -%>">
- <a href="<%= ApplicationController.root_context -%>/roles/projects"><%= message('roles.page') -%></a></li>
-
- <li class="spacer"></li>
- <li class="sidebar-title"><%= message('sidebar.system') -%></li>
- <% if has_role?("provisioning") %>
- <li class="<%= 'active' if controller.controller_path=='provisioning' -%>">
- <a href="<%= ApplicationController.root_context -%>/provisioning"><%= message('provisioning.page') -%></a>
- </li>
- <% end %>
- <li class="<%= 'active' if controller.controller_path=='bulk_deletion' -%>">
- <a href="<%= ApplicationController.root_context -%>/bulk_deletion"><%= message('bulk_deletion.page') -%></a>
- </li>
- <% update_center_activated = controller.java_facade.getSettings().getBoolean('sonar.updatecenter.activate')
- if update_center_activated %>
- <li class="<%= 'active' if controller.controller_path=='updatecenter' -%>">
- <a href="<%= ApplicationController.root_context -%>/updatecenter"><%= message('update_center.page') -%></a></li>
- <% end %>
- <li class="<%= 'active' if controller.controller_path=='system' -%>">
- <a href="<%= ApplicationController.root_context -%>/system"><%= message('system_info.page') -%></a></li>
- <li class="<%= 'active' if controller.controller_path=='analysis_reports' -%>">
- <a href="<%= ApplicationController.root_context -%>/analysis_reports"><%= message('analysis_reports.page') -%></a></li>
-
- <% end #of admin part %>
-
- <% end %>
+ <%= yield :header -%>
- <%= yield :sidebar %>
+ <%= render 'layouts/breadcrumb' if @breadcrumbs || selected_section==Navigation::SECTION_RESOURCE -%>
- <li id="logo">
- <center><a href="http://www.sonarqube.org/" target="SonarSource"><%= image_tag('logo.png', :alt => message('layout.sonar.slogan'), :width => 100, :height => 24) -%></a></center>
- </li>
- </ul>
- </div>
- <% end %>
- <%
- html_id_class = ''
- html_id_class = "id='content' class='with_sidebar'" if selected_section && selected_section.show_sidebar
- html_id_class = "id='content'" if @hide_sidebar || (selected_section && !selected_section.show_sidebar)
- %>
- <div <%= html_id_class -%>>
- <% if @project %>
- <div class="print"><h2><%= h @project.name() %></h2></div>
- <% end %>
- <div class="error" id="error" style="display:none">
- <span id="errormsg"></span> [<a href="#" onclick="javascript:$j('#error').hide();return false;"><%= message('hide').downcase -%></a>]
- </div>
- <div class="notice" id="info" style="display:none">
- <span id="infomsg"></span> [<a href="#" onclick="javascript:$j('#info').hide();return false;"><%= message('hide').downcase -%></a>]
- </div>
- <div class="warning" id="warning" style="display:none">
- <span id="warningmsg"></span> [<a href="#" onclick="javascript:$j('#warning').hide();return false;"><%= message('hide').downcase -%></a>]
+ <div id="body">
+ <div class="container">
+ <div id="content">
+ <% if @project %>
+ <div class="print"><h2><%= h @project.name() %></h2></div>
+ <% end %>
+ <div class="error" id="error" style="display:none">
+ <span id="errormsg"></span> [<a href="#" onclick="javascript:$j('#error').hide();return false;"><%= message('hide').downcase -%></a>]
+ </div>
+ <div class="notice" id="info" style="display:none">
+ <span id="infomsg"></span> [<a href="#" onclick="javascript:$j('#info').hide();return false;"><%= message('hide').downcase -%></a>]
+ </div>
+ <div class="warning" id="warning" style="display:none">
+ <span id="warningmsg"></span> [<a href="#" onclick="javascript:$j('#warning').hide();return false;"><%= message('hide').downcase -%></a>]
+ </div>
+ <%= yield %>
</div>
- <%= yield %>
</div>
</div>
</div>
<br><br><span class="error">The embedded database will not scale, it will not support upgrading to newer versions of SonarQube, and there is no support for migrating your data out of it into a different database engine.</span>
<% end %>
</div>
- <!--[if lte IE 8 ]><br/><span class="ie-warn">IE 8 is not supported. Some widgets may not be properly displayed. Please switch to a <a target="_blank" href="http://redirect.sonarsource.com/doc/requirements.html">supported version or another supported browser</a>.</span><!--<![endif]-->
+ <!--[if lte IE 8 ]><br/><span class="ie-warn">IE 8 is not supported. Some widgets may not be properly displayed. Please switch to a <a
+ target="_blank" href="http://redirect.sonarsource.com/doc/requirements.html">supported version or another supported browser</a>.</span><!--<![endif]-->
</div>
</div>
<% end %>
--- /dev/null
+<div class="sq-logo">
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="100" height="25">
+ <g opacity="1">
+ <path class="sq-logo-arc sq-logo-arc1" d="m96.96313,21.20284l-1.22246,0c0,-9.83637 -8.12817,-17.87548 -18.16693,-17.87548l0,-1.26294c10.69453,0 19.41368,8.6382 19.41368,19.13842l-0.02429,0z"/>
+ <path class="sq-logo-arc sq-logo-arc2" d="m97.81319,14.62098c-1.47343,-6.17708 -6.47662,-11.36647 -12.79134,-13.15564l0.28336,-1.00388c6.64664,1.93489 11.94128,7.38335 13.47137,13.96522l-0.96339,0.1943z"/>
+ <path class="sq-logo-arc sq-logo-arc3" d="m99.19757,8.84059c-1.522,-3.32736 -4.07217,-6.18517 -7.26192,-8.11197l0.40479,-0.72862c3.31117,1.99156 6.03945,5.05177 7.56956,8.50866l-0.71243,0.33193z"/>
+ <path class="sq-logo-letter" d="m0,20.74138c0.72862,0.39669 1.86203,0.72862 3.12497,0.72862c2.72828,0 4.12075,-1.32771 4.12075,-3.12497c-0.02429,-1.39247 -0.80148,-2.38826 -2.59065,-2.98734c-1.18198,-0.40479 -1.5301,-0.66385 -1.5301,-1.13341c-0.02429,-0.46146 0.39669,-0.72862 1.12531,-0.72862c0.79339,0 1.66773,0.26716 2.06442,0.52623l0.51813,-2.05633c-0.59099,-0.26716 -1.57868,-0.59909 -2.71209,-0.59909c-2.35587,0 -3.85359,1.39247 -3.85359,3.18974c-0.04857,1.13341 0.72862,2.19396 2.72018,2.85781c1.09293,0.39669 1.40057,0.59909 1.40057,1.13341c-0.0081,0.53432 -0.39669,0.79339 -1.26294,0.79339c-0.90673,0 -2.06442,-0.39669 -2.59065,-0.72862l-0.53432,2.12919z"/>
+ <path class="sq-logo-letter" d="m13.10707,13.56043c1.352,0 1.9187,1.39247 1.9187,2.85781c-0.01619,1.73249 -0.73672,2.85781 -1.92679,2.85781c-1.27104,0 -1.93489,-1.19817 -1.93489,-2.85781c-0.01619,-1.39248 0.53432,-2.85781 1.93489,-2.85781m0.10524,-2.19396c-3.10068,0 -5.15701,1.99156 -5.15701,5.11653c0.01619,3.12497 2.18586,4.987 4.9789,4.987c2.57446,0 5.05177,-1.65964 5.05177,-5.1813c0.01619,-2.85781 -1.9268,-4.92223 -4.84937,-4.92223l-0.02429,0"/>
+ <path class="sq-logo-letter" d="m19.02508,21.20284l2.98734,0l0,-5.51323c0,-0.26716 -0.00809,-0.53432 0.12144,-0.73672c0.1862,-0.52623 0.66385,-1.12531 1.5301,-1.12531c1.05245,0 1.46534,0.86625 1.46534,2.05633l0.02429,5.31892l2.97925,0l0,-5.65085c0,-2.85781 -1.47343,-4.12075 -3.40832,-4.12075c-1.63535,0 -2.59065,0.93102 -2.98734,1.5301l-0.06477,0l-0.13763,-1.32771l-2.59065,0c0.04048,0.86625 0.06477,1.86203 0.06477,3.0602l0.01619,6.50901z"/>
+ <path class="sq-logo-letter" d="m34.72279,17.74594c0,0.13763 -0.02429,0.33193 -0.08905,0.46956c-0.17001,0.66385 -0.80148,1.12531 -1.5301,1.12531c-0.65576,0 -1.19818,-0.39669 -1.19818,-1.12531c0.02429,-1.13341 1.26294,-1.5301 2.79304,-1.5301l0.02429,1.06054m2.8821,-2.19396c0,-2.25872 -0.97959,-4.18552 -4.16933,-4.18552c-1.78107,0 -3.12497,0.53432 -3.78882,0.86625l0.5748,1.9268c0.63147,-0.39669 1.68392,-0.72862 2.6797,-0.72862c1.44915,0 1.7325,0.72862 1.7325,1.26294l-0.00809,0.12953c-3.40023,0 -5.64276,1.19818 -5.64276,3.65929c0.0081,1.52201 1.19818,2.98734 3.12497,2.98734c1.11722,0 2.12919,-0.46146 2.72018,-1.19818l0.06477,0l0.17811,0.93101l2.6959,0c-0.12144,-0.52622 -0.14573,-1.39247 -0.14573,-2.32349l-0.01619,-3.32736z"/>
+ <path class="sq-logo-letter" d="m39.07022,21.20284l2.97925,0l0,-4.84937c0,-0.20239 0.02429,-0.46955 0.02429,-0.66385c0.23478,-0.93101 1.00388,-1.5301 2.06442,-1.5301c0.34812,0 0.59909,0.06477 0.79338,0.06477l0.02429,-2.79304c-0.21049,0 -0.35621,-0.06477 -0.61528,-0.06477c-0.9553,0 -2.12919,0.59909 -2.59874,1.99156l-0.08096,0l-0.12143,-1.7244l-2.55017,0c0.05667,0.79339 0.09715,1.7244 0.09715,3.12497l-0.01619,6.44424z"/>
+ <path class="sq-logo-letter" d="m64.89576,18.54743c0,0.99578 0.04858,1.9268 0.04858,2.65541l-1.5382,0l-0.09715,-1.59487l-0.04047,0c-0.46146,0.80148 -1.51391,1.86203 -3.24641,1.86203c-1.48962,0 -3.31927,-0.86625 -3.31927,-4.25028l0,-5.72372l1.77298,0l0,5.39179c0,1.85393 0.55051,3.11687 2.14538,3.11687c1.20628,0 1.99966,-0.85815 2.33159,-1.65963c0.11334,-0.26716 0.1943,-0.53432 0.1943,-0.86625l-0.01619,-5.98278l1.76488,0l0,7.05142z"/>
+ <path class="sq-logo-letter" d="m68.01263,17.41402c0,0.20239 0.05667,0.39669 0.05667,0.59909c0.37241,1.26294 1.39247,2.12919 2.65541,2.12919c1.87012,0 2.99544,-1.5301 2.99544,-3.78882c-0.02428,-1.9268 -0.99577,-3.59453 -2.93066,-3.59453c-1.19009,0 -2.32349,0.80148 -2.65542,2.19396c-0.05668,0.20239 -0.12953,0.40479 -0.12953,0.73672l0.00809,1.7244m-1.82155,3.85359c0.04047,-0.66385 0.08096,-1.59487 0.08096,-2.45302l0,-11.77126l1.74059,0l0,6.12041l0.04047,0c0.62338,-1.06864 1.74059,-1.79726 3.33546,-1.79726c2.38825,0 4.12075,1.99156 4.05598,4.987c0.01619,3.4569 -2.19395,5.1813 -4.31505,5.1813c-1.42486,0 -2.52589,-0.52623 -3.2626,-1.86203l-0.07287,0l-0.08096,1.59487l-1.522,0z"/>
+ <path class="sq-logo-letter" d="m83.28937,15.42246c0.01619,-1.13341 -0.46146,-2.85781 -2.46112,-2.85781c-1.77297,0 -2.59064,1.65963 -2.72018,2.85781l5.1813,0m-5.1813,1.26294c0.04047,2.39635 1.59486,3.39213 3.31927,3.39213c1.27914,0 2.06442,-0.26716 2.72827,-0.53432l0.27526,1.26294c-0.62337,0.26716 -1.67583,0.59909 -3.19784,0.59909c-3.02782,0 -4.79269,-1.9268 -4.79269,-4.85747c-0.01619,-2.92258 1.7325,-5.24607 4.52554,-5.24607c3.18164,0 4.05598,2.79304 4.05598,4.58221c-0.03238,0.33193 -0.07286,0.59909 -0.07286,0.80148l-6.84093,0z"/>
+ <path class="sq-logo-letter" d="m52.59827,19.34081c-1.64344,1.13341 -3.86978,0.73672 -5.00319,-0.93102c-1.10103,-1.65963 -0.66385,-3.85359 0.93101,-4.9789c1.66773,-1.13341 3.91836,-0.67195 5.05177,0.93102c1.08483,1.65963 0.66385,3.91836 -0.99578,4.9789m2.23444,-5.84515c-1.58677,-2.33158 -4.76031,-2.92258 -7.15667,-1.32771c-2.3073,1.59487 -2.92258,4.78461 -1.32771,7.10809c1.40867,2.06442 4.05599,2.79305 6.3147,1.86203l1.95918,3.18974l1.57868,-1.06054l-1.98347,-3.2626c1.71631,-1.65963 2.03204,-4.37982 0.63957,-6.509l-0.02429,0"/>
+ </g>
+ </svg>
+</div>
+++ /dev/null
-<script>
- if (supportsHTML5Storage()) {
- var sonarRecentHistory = new Sonar.RecentHistory();
- }
-</script>
-
-<li>
- <a href="#" class="with-icon" onclick="if (sonarRecentHistory) { sonarRecentHistory.populateRecentHistoryPanel(); }; showDropdownMenu('projects-menu'); return false;">
- <span><%= message('layout.projects') -%></span>
- <i class="icon-dropdown"></i>
- </a>
-
- <div id="projects-menu" class="dropdown-menu" style="max-width: none; display: none;">
- <div id="recent-history" style="border-bottom: 1px solid #ccc; padding-bottom: 10px;">
- <h2><%= message('layout.recent_projects') -%></h2>
- <ul id="recent-history-list">
- </ul>
- </div>
-
- <div>
- <ul>
- <% Project.root_qualifiers.sort.each do |qualifier| %>
- <li><a href="<%= ApplicationController.root_context -%>/all_projects?qualifier=<%= qualifier -%>"><%= message('qualifiers.all.' + qualifier) -%></a></li>
- <% end %>
- </ul>
- </div>
- </div>
-
-</li>
-
-<script>
- if (sonarRecentHistory == null) {
- $j('#recent-history').detach();
- }
-
- <%
- if @resource && Project.root_qualifiers.include?(@resource.qualifier)
- %>
- else {
- sonarRecentHistory.add('<%= escape_javascript(h(@resource.key)) -%>',
- '<%= escape_javascript(h(@resource.name)) -%>',
- '<%= escape_javascript @resource.qualifier.downcase -%>');
- }
- <% end %>
-
-</script>
--- /dev/null
+<%= render 'layouts/navbar_conf' -%>
+<%= render 'layouts/recent_history' -%>
+<script>
+ require(['nav/app']);
+</script>
--- /dev/null
+<%
+ selected_section = controller.class::SECTION if defined?(controller.class::SECTION)
+ if selected_section==Navigation::SECTION_RESOURCE && !@project && !@resource
+ selected_section = Navigation::SECTION_HOME
+ end
+ @project=@resource unless @project || selected_section==Navigation::SECTION_HOME
+ period_param = "period=#{u(params[:period])}" if params[:period]
+ displayed_resource = @resource || @project
+ display_only_root = @issue
+ resource_id=displayed_resource ? (displayed_resource.is_a?(Fixnum) ? displayed_resource : displayed_resource.permanent_id) : nil
+%>
+
+<% if selected_section==Navigation::SECTION_RESOURCE %>
+ <%= render :partial => 'layouts/navbar_conf_project' %>
+<% elsif selected_section==Navigation::SECTION_CONFIGURATION %>
+ <%= render :partial => 'layouts/navbar_conf_settings' %>
+<% else %>
+ <%= render :partial => 'layouts/navbar_conf_global' %>
+<% end %>
+
+
+<script>
+ var navbarQualifiers = [
+ <% Project.root_qualifiers.sort.each do |qualifier| %>
+ '<%= qualifier -%>',
+ <% end %>
+ ];
+ window.SS.isUserAdmin = <%= current_user && is_admin? ? 'true' : 'false' -%>;
+</script>
--- /dev/null
+<%
+ selected_section = controller.class::SECTION if defined?(controller.class::SECTION)
+ if selected_section==Navigation::SECTION_RESOURCE && !@project && !@resource
+ selected_section = Navigation::SECTION_HOME
+ end
+%>
+
+<script>
+ var navbarSpace = 'global',
+ navbarItems = [
+ {
+ label: 'layout.dashboards',
+ active: <%= selected_section==Navigation::SECTION_HOME || selected_section==Navigation::SECTION_RESOURCE ? 'true' : 'false' -%>,
+ menu: [
+ <% ActiveDashboard.user_dashboards(current_user, true).each do |active_dashboard| %>
+ {
+ url: '/dashboard/?did=<%= active_dashboard.dashboard_id -%>',
+ labelLocalized: '<%= h 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: '<%= h message(page.getId() + '.page', :default => page.getTitle()) -%>',
+ active: <%= selected ? 'true' : 'false' -%>
+ },
+ <% end %>
+ ]
+ }
+ ];
+</script>
--- /dev/null
+<%
+ @project=@resource unless @project || selected_section==Navigation::SECTION_HOME
+ period_param = "period=#{u(params[:period])}" if params[:period]
+ displayed_resource = @resource || @project
+ display_only_root = @issue
+ resource_id=displayed_resource ? (displayed_resource.is_a?(Fixnum) ? displayed_resource : displayed_resource.permanent_id) : nil
+%>
+
+
+<script>
+ var navbarSpace = 'project',
+ navbarProject = '<%= @project.root_project().name -%>',
+ navbarProjectId = '<%= @project.root_project().id -%>',
+ navbarCanFavoriteProject = <%= logged_in? && displayed_resource && !display_only_root ? 'true' : 'false' -%>,
+ navbarProjectFavorite = <%= logged_in? && current_user.favourite?(resource_id) ? 'true' : 'false' -%>,
+ navbarItems = [
+ {
+ 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: '<%= h 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: 'Settings',
+ 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: '<%= h 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: '<%= h 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 %>
+ ]
+ }
+ ];
+</script>
--- /dev/null
+<%
+ selected_section = controller.class::SECTION if defined?(controller.class::SECTION)
+ if selected_section==Navigation::SECTION_RESOURCE && !@project && !@resource
+ selected_section = Navigation::SECTION_HOME
+ end
+%>
+
+<script>
+ var navbarSpace = 'settings',
+ navbarItems = [
+ {
+ 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: '<%= h 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/index',
+ 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' -%>
+ }
+ ]
+ }
+ ];
+</script>
--- /dev/null
+<script>
+ var sonarRecentHistory = new Sonar.RecentHistory();
+ <% if @resource && Project.root_qualifiers.include?(@resource.qualifier) %>
+ sonarRecentHistory.add(
+ '<%= escape_javascript(h(@resource.key)) -%>',
+ '<%= escape_javascript(h(@resource.name)) -%>',
+ '<%= escape_javascript @resource.qualifier.downcase -%>');
+ <% end %>
+</script>
--- /dev/null
+<div class="sq-logo sq-logo-small">
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="29" height="27">
+ <g opacity="1" transform="translate(-96, 0)">
+ <path class="sq-logo-arc sq-logo-arc1" d="M119.77 26.19L118.26 26.19C118.26 14.04 108.22 4.11 95.82 4.11L95.82 2.55C109.03 2.55 119.8 13.22 119.8 26.19L119.77 26.19Z"/>
+ <path class="sq-logo-arc sq-logo-arc2" d="M120.82 18.06C119 10.43 112.82 4.02 105.02 1.81L105.37 0.57C113.58 2.96 120.12 9.69 122.01 17.82L120.82 18.06Z"/>
+ <path class="sq-logo-arc sq-logo-arc3" d="M122.53 10.92C120.65 6.81 117.5 3.28 113.56 0.9L114.06 0C118.15 2.46 121.52 6.24 123.41 10.51L122.53 10.92Z"/>
+ </g>
+ </svg>
+</div>
end
%>
<%= render :partial => 'layouts/head' unless params[:hd]=='false' %>
+<%= render :partial => 'layouts/navbar' %>
<% if params[:layout]=='false' %>
<%= render :partial => 'layouts/nolayout' %>
<% else %>
<%= render :partial => 'layouts/layout' %>
<% end %>
-<%= render :partial => 'layouts/footer' unless params[:hd]=='false' %>
\ No newline at end of file
+<%= render :partial => 'layouts/footer' unless params[:hd]=='false' %>
layout.dashboards=Dashboards
layout.configuration=Project Configuration
layout.projects=Projects
+layout.tools=Tools
layout.recent_projects=Recent Projects
layout.user_panel.my_profile=My profile