], function () {
var $ = jQuery,
- OVERVIEW_URLS = [
- '/design', '/libraries', '/dashboards'
+ MORE_URLS = [
+ '/design', '/libraries', '/dashboards', '/plugins/resource'
],
SETTINGS_URLS = [
'/project/settings', '/project/profile', '/project/qualitygate', '/manual_measures/index',
serializeData: function () {
var href = window.location.href,
search = window.location.search,
- isMoreActive = _.some(OVERVIEW_URLS, function (url) {
+ isMoreActive = _.some(MORE_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')),
name: '<%= escape_javascript active_dashboard.dashboard.name(true) -%>'
}<% if index < dashboards.size - 1 -%>, <% end %>
<% end %>
+ ],
+ contextExtensions: [
+ <% project_metrics = @project.last_snapshot.metric_keys.to_java(:string) if @project.last_snapshot
+ pages = controller.java_facade.getPages(Navigation::SECTION_RESOURCE.key, @project.scope, @project.qualifier, @project.language, project_metrics)
+ pages.each_with_index do |page, index|
+ page_url = (page.isController() ? "#{page.getId()}?id=#{@project.id}" : "/plugins/resource/#{@project.id}?page=#{page.getId()}")
+ %>
+ {
+ url: '<%= page_url -%>',
+ label: '<%= escape_javascript message(page.getId() + '.page', :default => page.getTitle()) -%>'
+ }<% if index < pages.size - 1 -%>, <% end %>
+ <% end %>
]
});