diff options
author | Fabrice Bellingard <fabrice.bellingard@sonarsource.com> | 2012-12-10 10:46:05 +0100 |
---|---|---|
committer | Fabrice Bellingard <fabrice.bellingard@sonarsource.com> | 2012-12-10 10:46:05 +0100 |
commit | 1d645c191794a6b1b02344512b7e0b2f53a1bdfd (patch) | |
tree | 7f1ee3bb661b234951dac329cb77028113f87670 /sonar-server | |
parent | 382dc54a92d93e19f425f83298dd55c83f27ee20 (diff) | |
download | sonarqube-1d645c191794a6b1b02344512b7e0b2f53a1bdfd.tar.gz sonarqube-1d645c191794a6b1b02344512b7e0b2f53a1bdfd.zip |
SONAR-3972 Refactor the access to Sonar settings
Diffstat (limited to 'sonar-server')
6 files changed, 30 insertions, 12 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/alerts_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/alerts_controller.rb index f28ddf424a8..524cd8d1487 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/alerts_controller.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/alerts_controller.rb @@ -22,7 +22,7 @@ class AlertsController < ApplicationController verify :method => :post, :only => ['create', 'update', 'delete'], :redirect_to => { :action => 'index' } before_filter :admin_required, :except => [ 'index' ] - SECTION=Navigation::SECTION_HOME + SECTION=Navigation::SECTION_CONFIGURATION # # diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/profiles_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/profiles_controller.rb index ee1ce27ace3..ba08fb9de42 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/profiles_controller.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/profiles_controller.rb @@ -22,7 +22,7 @@ class ProfilesController < ApplicationController # the backup action is allow to non-admin users : see http://jira.codehaus.org/browse/SONAR-2039 before_filter :admin_required, :only => ['create', 'delete', 'set_as_default', 'copy', 'restore', 'change_parent', 'set_projects', 'rename_form', 'rename'] - SECTION=Navigation::SECTION_HOME + SECTION=Navigation::SECTION_CONFIGURATION ROOT_BREADCRUMB = {:name => Api::Utils.message('quality_profiles.page'), :url => {:controller => 'profiles', :action => 'index'}} diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/rules_configuration_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/rules_configuration_controller.rb index c5dad2531db..3a21131b6e4 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/rules_configuration_controller.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/rules_configuration_controller.rb @@ -21,7 +21,7 @@ require 'cgi' class RulesConfigurationController < ApplicationController - SECTION=Navigation::SECTION_HOME + SECTION=Navigation::SECTION_CONFIGURATION STATUS_ACTIVE = "ACTIVE" STATUS_INACTIVE = "INACTIVE" diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_layout.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_layout.html.erb index 60a82a02e6e..c399350b06f 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_layout.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_layout.html.erb @@ -21,11 +21,6 @@ <li> <a href="<%= ApplicationController.root_context -%>/reviews/index"><%= message('reviews.page') -%></a> </li> - <% if is_admin? %> - <li> - <a href="<%= ApplicationController.root_context -%>/settings/index"><%= message('layout.administration') -%></a> - </li> - <% end %> </ul> </div> <div id="nav"> @@ -34,6 +29,7 @@ <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> + <%= render 'layouts/menu_administration' -%> <% if logged_in? %> <%= render 'layouts/menu_user' -%> <% else %> @@ -66,8 +62,6 @@ <li class="spacer"></li> <li class="sidebar-title"><%= message('sidebar.tools') -%></li> - <li class="<%= 'active' if request.request_uri.include?('/profiles') || request.request_uri.include?('/alerts') || request.request_uri.include?('/rules_configuration') -%>"> - <a href="<%= ApplicationController.root_context -%>/profiles"><%= message('quality_profiles.page') -%></a></li> <li class="<%= 'active' if request.request_uri.include?('/dependencies/index') -%>"> <a href="<%= ApplicationController.root_context -%>/dependencies/index"><%= message('dependencies.page') -%></a></li> <li class="<%= 'active' if request.request_uri.include?('/comparison/index') -%>"> @@ -99,8 +93,14 @@ </li> <% end %> - <% elsif selected_section==Navigation::SECTION_CONFIGURATION && is_admin? %> + <% elsif selected_section==Navigation::SECTION_CONFIGURATION %> + + <li class="<%= 'active' if request.request_uri.include?('/profiles') || request.request_uri.include?('/alerts') || request.request_uri.include?('/rules_configuration') -%>"> + <a href="<%= ApplicationController.root_context -%>/profiles"><%= message('quality_profiles.page') -%></a></li> + <% if is_admin? %> + + <li class="spacer"></li> <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> @@ -142,6 +142,8 @@ <li class="<%= 'active' if controller.controller_path=='system' -%>"> <a href="<%= ApplicationController.root_context -%>/system"><%= message('system_info.page') -%></a></li> <% end %> + + <% end #of admin part %> <% end %> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_menu_administration.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_menu_administration.html.erb new file mode 100644 index 00000000000..b42d763c046 --- /dev/null +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_menu_administration.html.erb @@ -0,0 +1,16 @@ +<li> + <a href="#" onclick="showDropdownMenu('admin-panel'); return false;" class="link-more"><%= message('layout.settings') -%></a> + + <div id="admin-panel" class="dropdown-menu" style="display: none"> + <ul> + <li><a href="<%= ApplicationController.root_context -%>/profiles"><%= message('quality_profiles.page') -%></a></li> + + <% if is_admin? %> + <li><a href="<%= ApplicationController.root_context -%>/settings/index"><%= message('sidebar.project_settings') -%></a></li> + <li><a href="<%= ApplicationController.root_context -%>/users"><%= message('sidebar.security') -%></a></li> + <li><a href="<%= ApplicationController.root_context -%>/backup"><%= message('sidebar.system') -%></a></li> + <% end %> + </ul> + </div> + +</li>
\ No newline at end of file diff --git a/sonar-server/src/main/webapp/stylesheets/layout.css b/sonar-server/src/main/webapp/stylesheets/layout.css index e65d973ceee..4db279d1c02 100644 --- a/sonar-server/src/main/webapp/stylesheets/layout.css +++ b/sonar-server/src/main/webapp/stylesheets/layout.css @@ -92,7 +92,7 @@ body, a { #nav > ul> li { float: right; - padding: 0 0 0 10px; + padding: 0 0 0 15px; } #searchResourcesResults { |