]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-3972 Refactor the access to Sonar settings
authorFabrice Bellingard <fabrice.bellingard@sonarsource.com>
Mon, 10 Dec 2012 09:46:05 +0000 (10:46 +0100)
committerFabrice Bellingard <fabrice.bellingard@sonarsource.com>
Mon, 10 Dec 2012 09:46:05 +0000 (10:46 +0100)
plugins/sonar-core-plugin/src/main/resources/org/sonar/l10n/core.properties
sonar-server/src/main/webapp/WEB-INF/app/controllers/alerts_controller.rb
sonar-server/src/main/webapp/WEB-INF/app/controllers/profiles_controller.rb
sonar-server/src/main/webapp/WEB-INF/app/controllers/rules_configuration_controller.rb
sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_layout.html.erb
sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_menu_administration.html.erb [new file with mode: 0644]
sonar-server/src/main/webapp/stylesheets/layout.css

index 05d9ec54185962c587c22caefa070293eddf3e48..89ac6e6ba43d440cf8427a10037720a6d194b346 100644 (file)
@@ -283,7 +283,7 @@ layout.home=Home
 layout.login=Log in
 layout.logout=Log out
 layout.measures=Measures
-layout.administration=Administration
+layout.settings=Settings
 layout.print=Print
 layout.permalink=Permalink
 layout.sonar.slogan=Embrace Quality
index f28ddf424a840424bd16cd3d84dd1cdccc3dfd3a..524cd8d14870842366e6501db8370acc07dcafb6 100644 (file)
@@ -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
 
   #
   #
index ee1ce27ace39e73b306b7e960f969ccdb9bb4352..ba08fb9de4281e5046087c2251ed150e93e1976b 100644 (file)
@@ -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'}}
 
index c5dad2531dbddcd9b0dc030d682c79c61dc06861..3a21131b6e4621048d2ebd4a70994a96d559643c 100644 (file)
@@ -21,7 +21,7 @@ require 'cgi'
 
 class RulesConfigurationController < ApplicationController
 
-  SECTION=Navigation::SECTION_HOME
+  SECTION=Navigation::SECTION_CONFIGURATION
   
   STATUS_ACTIVE = "ACTIVE"
   STATUS_INACTIVE = "INACTIVE"
index 60a82a02e6e376abe16a77c7082eb7b97c8f001c..c399350b06fc9651cde46411fbddd57b03472ecc 100644 (file)
         <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') -%>">
               </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>
               <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 (file)
index 0000000..b42d763
--- /dev/null
@@ -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
index e65d973ceeed5bb63cbe6ecfab1514c982370b48..4db279d1c02710ab801f95112f5efa34e346e1cb 100644 (file)
@@ -92,7 +92,7 @@ body, a {
 
 #nav > ul> li {
   float: right;
-  padding: 0 0 0 10px;
+  padding: 0 0 0 15px;
 }
 
 #searchResourcesResults {