<%
- selected_section = controller.class::SECTION
+ selected_section = controller.class::SECTION if defined?(controller.class::SECTION)
+
if selected_section==Navigation::SECTION_RESOURCE && !@project && !@resource
selected_section = Navigation::SECTION_HOME
end
<div id="sb">
<div id="sidebar">
<ul>
- <% if selected_section==Navigation::SECTION_HOME %>
- <% ActiveDashboard.user_dashboards(current_user, true).each do |active_dashboard| %>
- <li class="<%= 'selected' if @dashboard && controller.controller_path=='dashboard' && active_dashboard.dashboard_id==@dashboard.id -%>">
- <a href="<%= ApplicationController.root_context -%>/dashboard/?did=<%= active_dashboard.dashboard_id -%>"><%= active_dashboard.dashboard.name(true) -%></a>
- </li>
- <% end %>
+ <li>
+ <a href="<%= ApplicationController.root_context -%>/"><%= message('layout.dashboards') -%></a>
+ </li>
+ <li>
+ <a href="<%= ApplicationController.root_context -%>/measures"><%= message('layout.measures') -%></a>
+ </li>
+ <%= render 'layouts/tools' -%>
+ </ul>
+ </div>
+ <div id="nav">
+ <ul>
+ <li>
+ <input type="text" size="15" name="search" id="searchInput" onFocus="autocompleteResources()" value="<%= message('search_verb') -%>"/>
+ <img src="<%= ApplicationController.root_context -%>/images/loading-small.gif" id="searchingResources" style="display:none">
+ </li>
+ <li>
+ <a href="javascript:window.print()"><img src="<%= ApplicationController.root_context -%>/images/print.gif" alt="<%= message('layout.print') -%>" title="<%= message('layout.print') -%>"/></a>
+ </li>
+ <% unless logged_in? %>
+ <li><a href="<%= ApplicationController.root_context -%>/sessions/new?return_to=<%= u (request.request_uri) -%>"><%= message('layout.login') -%></a></li>
+ <% end %>
+ <%= render 'layouts/user_panel' -%>
+ </ul>
+ </div>
+ <div id="searchResourcesResults" class="autocomplete" style="display:none"></div>
+ </div>
+ <%= render 'layouts/breadcrumb' if selected_section==Navigation::SECTION_RESOURCE -%>
- <% controller.java_facade.getPages(Navigation::SECTION_HOME, 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="<%= 'selected' if selected -%>">
- <a href="<%= ApplicationController.root_context -%><%= page_url -%>"><%= message(page.getId() + '.page', :default => page.getTitle()) -%></a></li>
- <% end %>
+ <div id="body">
+ <% if selected_section %>
+ <div id="sb">
+ <div id="sidebar">
+ <ul>
+ <% if selected_section==Navigation::SECTION_HOME %>
+ <% ActiveDashboard.user_dashboards(current_user, true).each do |active_dashboard| %>
+ <li class="<%= 'selected' if @dashboard && controller.controller_path=='dashboard' && active_dashboard.dashboard_id==@dashboard.id -%>">
+ <a href="<%= ApplicationController.root_context -%>/dashboard/?did=<%= active_dashboard.dashboard_id -%>"><%= active_dashboard.dashboard.name(true) -%></a>
+ </li>
+ <% end %>
<% elsif selected_section==Navigation::SECTION_RESOURCE %>
<% ActiveDashboard.user_dashboards(current_user, false).each do |active_dashboard| %>
<li class="<%= 'selected' if request.request_uri.include?('/project/deletion') -%>">
<a href="<%= ApplicationController.root_context -%>/project/deletion/<%= @project.id -%>"><%= message('resource_deletion.page', :params => message('qualifier.' + @project.qualifier)) -%></a>
</li>
- <% end %>
- <% end %>
+ <li class="<%= 'selected' if request.request_uri.include?('/cloud/index') -%>">
+ <a href="<%= ApplicationController.root_context -%>/cloud/index/<%= @project.id -%>"><%= message('clouds.page') -%></a></li>
+ <% controller.java_facade.getPages(Navigation::SECTION_RESOURCE, @project.scope, @project.qualifier, @project.language, @project.last_snapshot.metric_keys.to_java(:string)).each do |page|
+ page_url = (page.isController() ? "#{page.getId()}?id=#{@project.id}" : "/plugins/resource/#{@project.id}?page=#{page.getId()}")
+ %>
+ <li class="<%= 'selected' if request.request_uri.include?(page_url) -%>">
+ <a href="<%= ApplicationController.root_context -%><%= page_url -%>"><%= message(page.getId() + '.page', :default => page.getTitle()) %></a>
+ </li>
+ <% end %>
+ <% if has_role?(:admin, @project) %>
+ <li class="h2"><%= message('sidebar.project_settings') -%></li>
+ <% if (@project.project?) %>
+ <li class="<%= 'selected' if request.request_uri.include?('/project/profile') -%>">
+ <a href="<%= ApplicationController.root_context -%>/project/profile/<%= @project.id -%>"><%= message('project_quality_profiles.page') -%></a></li>
+ <% end %>
+ <li class="<%= 'selected' if request.request_uri.include?('/manual_measures') -%>">
+ <a href="<%= ApplicationController.root_context -%>/manual_measures/index/<%= @project.id -%>"><%= message('manual_measures.page') -%></a></li>
+ <% if (@project.project?) %>
+ <li class="<%= 'selected' if request.request_uri.include?('/action_plans') -%>">
+ <a href="<%= ApplicationController.root_context -%>/action_plans/index/<%= @project.id -%>"><%= message('action_plans.page') -%></a></li>
+ <% end %>
+ <% if (@project.project? || @project.module?) %>
+ <li class="<%= 'selected' if request.request_uri.include?('/project/settings') -%>">
+ <a href="<%= ApplicationController.root_context -%>/project/settings/<%= @project.id -%>"><%= message('project_settings.page') -%></a>
+ </li>
+ <% end %>
+ <% if (@project.project?) %>
+ <li class="<%= 'selected' if request.request_uri.include?('/project/links') -%>">
+ <a href="<%= ApplicationController.root_context -%>/project/links/<%= @project.id -%>"><%= message('project_links.page') -%></a></li>
+ <% end %>
+ <%
+ # NOTE: we keep "@project.view? || @project.subview?" in the test for backward compatibility with the Views plugin
+ if (controller.java_facade.getResourceTypeBooleanProperty(@project.qualifier, 'hasRolePolicy') || @project.view? || @project.subview?)
+ %>
+ <li class="<%= 'selected' if request.request_uri.include?('/project_roles') -%>">
+ <a href="<%= ApplicationController.root_context -%>/project_roles/index?resource=<%= @project.id -%>"><%= message('roles.page') -%></a></li>
+ <% end %>
+ <%
+ # NOTE: we keep "@project.view? || @project.subview?" in the test for backward compatibility with the Views plugin
+ if (controller.java_facade.getResourceTypeBooleanProperty(@project.qualifier, 'modifiable_history') || @project.view? || @project.subview?)
+ %>
+ <li class="<%= 'selected' if request.request_uri.include?('/project/history') -%>">
+ <a href="<%= ApplicationController.root_context -%>/project/history/<%= @project.id -%>"><%= message('project_history.page') -%></a></li>
+ <% end %>
+ <% if controller.java_facade.getResourceTypeBooleanProperty(@project.qualifier, 'updatable_key') %>
+ <li class="<%= 'selected' if request.request_uri.include?('/project/key') -%>">
+ <a href="<%= ApplicationController.root_context -%>/project/key/<%= @project.id -%>"><%= message('update_key.page') -%></a></li>
+ <% end %>
+ <% if controller.java_facade.getResourceTypeBooleanProperty(@project.qualifier, 'deletable') %>
+ <li class="<%= 'selected' if request.request_uri.include?('/project/deletion') -%>">
+ <a href="<%= ApplicationController.root_context -%>/project/deletion/<%= @project.id -%>"><%= message('resource_deletion.page', :params => message('qualifier.' + @project.qualifier)) -%></a>
+ </li>
+ <% end %>
+ <% end %>
- <% elsif selected_section==Navigation::SECTION_CONFIGURATION && is_admin? %>
-
- <li class="h2" style="padding-top: 0px;"><%= message('sidebar.project_settings') -%></li>
- <li class="<%= 'selected' if request.request_uri.include?('/settings') -%>">
- <a href="<%= ApplicationController.root_context -%>/settings/index"><%= message('settings.page') -%></a></li>
- <li class="<%= 'selected' if controller.controller_path=='metrics' -%>">
- <a href="<%= ApplicationController.root_context -%>/metrics/index"><%= message('manual_metrics.page') -%></a></li>
- <li class="<%= 'selected' if controller.controller_path=='manual_rules' -%>">
- <a href="<%= ApplicationController.root_context -%>/manual_rules/index"><%= message('manual_rules.page') -%></a></li>
- <li class="<%= 'selected' 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, nil, nil, nil, nil).each do |page|
- page_url = (page.isController() ? page.getId() : "/plugins/configuration/#{page.getId()}")
- %>
- <li class="<%= 'selected' if request.request_uri.include?(page_url) -%>">
- <a href="<%= ApplicationController.root_context -%><%= page_url -%>"><%= message(page.getId() + '.page', :default => page.getTitle()) %></a>
+ <% elsif selected_section==Navigation::SECTION_CONFIGURATION && is_admin? %>
+
+ <li class="h2" style="padding-top: 0;"><%= message('sidebar.project_settings') -%></li>
+ <li class="<%= 'selected' if request.request_uri.include?('/settings') -%>">
+ <a href="<%= ApplicationController.root_context -%>/settings/index"><%= message('settings.page') -%></a></li>
+ <li class="<%= 'selected' if controller.controller_path=='metrics' -%>">
+ <a href="<%= ApplicationController.root_context -%>/metrics/index"><%= message('manual_metrics.page') -%></a></li>
+ <li class="<%= 'selected' if controller.controller_path=='manual_rules' -%>">
+ <a href="<%= ApplicationController.root_context -%>/manual_rules/index"><%= message('manual_rules.page') -%></a></li>
+ <li class="<%= 'selected' 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, nil, nil, nil, nil).each do |page|
+ page_url = (page.isController() ? page.getId() : "/plugins/configuration/#{page.getId()}")
+ %>
+ <li class="<%= 'selected' if request.request_uri.include?(page_url) -%>">
+ <a href="<%= ApplicationController.root_context -%><%= page_url -%>"><%= message(page.getId() + '.page', :default => page.getTitle()) %></a>
+ </li>
+ <% end %>
+
+ <li class="h2"><%= message('sidebar.security') -%></li>
+ <li class="<%= 'selected' if request.request_uri.include?('/users') -%>"><a href="<%= ApplicationController.root_context -%>/users"><%= message('users.page') -%></a>
</li>
- <% end %>
+ <li class="<%= 'selected' if request.request_uri.include?('/groups') -%>">
+ <a href="<%= ApplicationController.root_context -%>/groups/index"><%= message('user_groups.page') -%></a></li>
+ <li class="<%= 'selected' if request.request_uri.include?('/roles/global') -%>">
+ <a href="<%= ApplicationController.root_context -%>/roles/global"><%= message('system_administrators.page') -%></a></li>
+ <li class="<%= 'selected' if request.request_uri.include?('/roles/projects') -%>">
+ <a href="<%= ApplicationController.root_context -%>/roles/projects"><%= message('roles.page') -%></a></li>
- <li class="h2"><%= message('sidebar.security') -%></li>
- <li class="<%= 'selected' if request.request_uri.include?('/users') -%>"><a href="<%= ApplicationController.root_context -%>/users"><%= message('users.page') -%></a>
- </li>
- <li class="<%= 'selected' if request.request_uri.include?('/groups') -%>">
- <a href="<%= ApplicationController.root_context -%>/groups/index"><%= message('user_groups.page') -%></a></li>
- <li class="<%= 'selected' if request.request_uri.include?('/roles/global') -%>">
- <a href="<%= ApplicationController.root_context -%>/roles/global"><%= message('system_administrators.page') -%></a></li>
- <li class="<%= 'selected' if request.request_uri.include?('/roles/projects') -%>">
- <a href="<%= ApplicationController.root_context -%>/roles/projects"><%= message('roles.page') -%></a></li>
+ <li class="h2"><%= message('sidebar.system') -%></li>
+ <li class="<%= 'selected' if controller.controller_path=='backup' -%>"><a href="<%= ApplicationController.root_context -%>/backup"><%= message('backup.page') -%></a>
+ </li>
+ <li class="<%= 'selected' 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="<%= 'selected' if controller.controller_path=='updatecenter' -%>">
+ <a href="<%= ApplicationController.root_context -%>/updatecenter"><%= message('update_center.page') -%></a></li>
+ <li class="<%= 'selected' if controller.controller_path=='system' -%>">
+ <a href="<%= ApplicationController.root_context -%>/system"><%= message('system_info.page') -%></a></li>
+ <% end %>
- <li class="h2"><%= message('sidebar.system') -%></li>
- <li class="<%= 'selected' if controller.controller_path=='backup' -%>"><a href="<%= ApplicationController.root_context -%>/backup"><%= message('backup.page') -%></a>
- </li>
- <li class="<%= 'selected' 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="<%= 'selected' if controller.controller_path=='updatecenter' -%>">
- <a href="<%= ApplicationController.root_context -%>/updatecenter"><%= message('update_center.page') -%></a></li>
- <li class="<%= 'selected' if controller.controller_path=='system' -%>">
- <a href="<%= ApplicationController.root_context -%>/system"><%= message('system_info.page') -%></a></li>
<% end %>
+ </ul>
+ <%= yield :sidebar %>
+ <div id="logo">
+ <center><a href="http://www.sonarsource.org/" target="SonarSource"><%= image_tag('sonar.png', :alt => message('layout.sonar.slogan'), :class => 'png') -%></a></center>
+ </div>
+ </div>
+ <% if @sidebar %>
+ <div id="sidebarconf"><%= render :partial => @sidebar %></div>
+ <% else %>
+ <div id="sidebarconf" class="hidden"></div>
<% end %>
- </ul>
- <%= yield :sidebar %>
- <div id="logo">
- <center><a href="http://www.sonarsource.org/" target="SonarSource"><%= image_tag('sonar.png', :alt => message('layout.sonar.slogan'), :class => 'png') -%></a></center>
</div>
- </div>
-
- <% if @sidebar %>
- <div id="sidebarconf"><%= render :partial => @sidebar %></div>
- <% else %>
- <div id="sidebarconf" class="hidden"></div>
<% end %>
- </div>
- <div id="content" class="with_sidebar">
- <% if @project %>
- <div class="print"><h2><%= @project.name(true) %></h2></div>
- <% end %>
- <div class="error" id="error" style="display:none">
- <span id="errormsg"></span> [<a href="#" onclick="javascript:$('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:$('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:$('warning').hide();return false;"><%= message('hide').downcase -%></a>]
+ <div id="content" class="<%= selected_section ? 'with_sidebar' : 'wo_sidebar' -%>">
+ <% if @project %>
+ <div class="print"><h2><%= @project.name(true) %></h2></div>
+ <% end %>
+ <div class="error" id="error" style="display:none">
+ <span id="errormsg"></span> [<a href="#" onclick="javascript:$('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:$('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:$('warning').hide();return false;"><%= message('hide').downcase -%></a>]
+ </div>
+ <%= yield %>
</div>
- <%= yield %>
</div>
</div>
-</div>
<% unless params[:hd]=='false' %>
<%= yield :footer %>
<% content_for :style do %>
<style type="text/css">
- #filter-form {
- float: left;
- width: 240px;
+ #filter-form [type="text"].large-input {
+ width: 180px;
+
}
- #filter-form select {
- width: 200px;
- padding: 1px;
+ #filter-form select.large-input {
+ width: 100%;
+ box-sizing: border-box;
+ -webkit-box-sizing: border-box;
+ -moz-box-sizing: border-box;
}
#filter-form select option {
padding: 1px 10px 1px 4px;
}
-
- #filter-result {
- padding-left: 250px;
- }
</style>
<% end %>
-<div id="measure-filter">
- <div id="filter-form">
+<div id="measure-filters">
+ <div id="filter-form" class="page-split-left">
<form method="GET" action="<%= ApplicationController.root_context -%>/measures/search">
<% if @filter.id %>
<input type="hidden" name="id" value="<%= @filter.id -%>">
<% end %>
- <table>
+ <table class="width100">
<tbody>
<tr>
- <td>
+ <td class="width100">
Base:<br>
- <input type="text" name="base" value="<%= @filter.criteria['base'] -%>">
+ <input type="text" name="base" value="<%= @filter.criteria['base'] -%>" class="large-input">
</td>
</tr>
<tr>
- <td>
+ <td class="width100">
On components:<br>
<%= check_box_tag 'onBaseComponents', 'true', @filter.criteria['onBaseComponents'] -%>
</td>
</tr>
<tr>
- <td>
+ <td class="width100">
Qualifiers:<br>
<%
- qualifiers = Api::Utils.java_facade.getResourceTypesForFilter().map do |resource_type|
- [message("qualifiers.#{resource_type.getQualifier()}"), resource_type.getQualifier()]
- end
+ qualifiers = Api::Utils.java_facade.getResourceTypesForFilter().map do |resource_type|
+ [message("qualifiers.#{resource_type.getQualifier()}"), resource_type.getQualifier()]
+ end
%>
- <%= select_tag 'qualifiers[]', options_for_select([[message('any'), '']].concat(qualifiers), @filter.criteria['qualifiers']||''), :size => 5, :multiple => true -%>
+ <%= select_tag 'qualifiers[]', options_for_select([[message('any'), '']].concat(qualifiers), @filter.criteria['qualifiers']||''), :size => 5, :multiple => true, :class => 'large-input' -%>
</td>
</tr>
<tr>
<td>
Language:<br>
<% languages = [[message('any'), '']].concat(Api::Utils.languages.map { |lang| [lang.name, lang.key] }) %>
- <%= select_tag 'languages[]', options_for_select(languages, @filter.criteria['languages']||''), :size => 5, :multiple => true -%>
+ <%= select_tag 'languages[]', options_for_select(languages, @filter.criteria['languages']||''), :size => 5, :multiple => true, :class => 'large-input' -%>
</td>
</tr>
<tr>
- <td>
+ <td class="width100">
Name:<br>
- <input type="text" name="nameRegexp" value="<%= h @filter.criteria['nameRegexp'] -%>"></td>
+ <input type="text" name="nameRegexp" value="<%= h @filter.criteria['nameRegexp'] -%>" class="large-input"></td>
</tr>
<tr>
- <td>
+ <td class="width100">
Key:<br>
- <input type="text" name="keyRegexp" value="<%= h @filter.criteria['keyRegexp'] -%>"></td>
+ <input type="text" name="keyRegexp" value="<%= h @filter.criteria['keyRegexp'] -%>" class="large-input"></td>
</tr>
<tr>
<td>
Favourites only:<br>
- <%= check_box_tag 'onFavourites', 'true', @filter.criteria['onFavourites']=='true' %>
+ <%= check_box_tag 'onFavourites', 'true', @filter.criteria['onFavourites']=='true' -%>
</td>
</tr>
<tr>
</tr>
<tr>
<td>
+ <br/>
<input type="submit" name="search" value="Search">
<a href="<%= ApplicationController.root_context -%>/measures">New search</a>
</td>
</table>
</form>
- <br/>
-
<% if logged_in? %>
+ <br/>
<ul id="my-filters">
<% current_user.favourited_measure_filters.each do |my_filter| %>
<li>
</div>
<% if @filter.results %>
- <div id="filter-result">
+ <div id="filter-result" class="page-split-right width100">
<% if @filter.name %>
- <h2><%= h @filter.name -%></h2>
- <% if @filter.description %>
- <p><%= h @filter.description -%></p>
- <% end %>
+ <p>
+ <span class="h3"><%= h @filter.name -%></span>
+ <% if @filter.description.present? %>
+ - <span><%= h @filter.description -%></span>
+ <% end %>
+ </p>
+
<% end %>
Display as: