]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-3972 Add a "Tools" menu entry in the top header
authorFabrice Bellingard <fabrice.bellingard@sonarsource.com>
Fri, 23 Nov 2012 14:54:21 +0000 (15:54 +0100)
committerFabrice Bellingard <fabrice.bellingard@sonarsource.com>
Fri, 23 Nov 2012 14:54:21 +0000 (15:54 +0100)
Still needs to be done:
- apply the correct section to "quality profiles" and "libraries" to
  avoid having the left menu
- remove the "My Filters" link on the user panel when the filters menu
  is available elsewhere

plugins/sonar-core-plugin/src/main/resources/org/sonar/l10n/core.properties
sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_layout.html.erb
sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_tools.html.erb [new file with mode: 0644]
sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_user_panel.html.erb
sonar-server/src/main/webapp/stylesheets/layout.css
sonar-server/src/main/webapp/stylesheets/style.css

index f23df0c35cbda5b93f295875b3d0dbf045a3406e..7f341d4b451291040519da26093be18a865e6a41 100644 (file)
@@ -294,6 +294,8 @@ layout.plugins=Plugins
 layout.evaluation=Embedded database should be used for evaluation purpose only
 layout.ie6_warn=Your web browser is outdated. This website may not display correctly.
 layout.dashboards=Dashboards
+layout.tools=Tools
+layout.tools.quality_profiles=Quality Profiles
 layout.user_panel.my_profile=My profile
 layout.user_panel.recent_history.title=Recent history
 layout.user_panel.recent_history.clear=Clear
index 2967ca71cd89ac62227cb9dcaa500e925fa2eaad..b7b681984984e6484c5246188dfa4531360088ee 100644 (file)
@@ -14,6 +14,7 @@
       <li>
         <a href="<%= ApplicationController.root_context -%>/"><%= message('layout.dashboards') -%></a>
       </li>
+      <%= render 'layouts/tools' -%>
     </ul>
   </div>
   <div id="nav">
@@ -29,7 +30,6 @@
         <li><a href="<%= ApplicationController.root_context -%>/sessions/new?return_to=<%= u (request.request_uri) -%>"><%= message('layout.login') -%></a></li>
       <% end %>
       <%= render 'layouts/user_panel' -%>
-      <li><a href="<%= ApplicationController.root_context -%>/profiles"><%= message('layout.configuration') -%></a></li>
     </ul>
   </div>
   <div id="searchResourcesResults" class="autocomplete" style="display:none"></div>
           <a href="<%= ApplicationController.root_context -%>/reviews/index"><%= message('reviews.page') -%></a>
           </li>
 
-          <li class="<%= 'selected' if controller.controller_path=='dependencies' -%>">
-            <a href="<%= ApplicationController.root_context -%>/dependencies/index"><%= message('dependencies.page') -%></a>
-          </li>
-
           <% 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}")
             <% end %>
           <% end %>
 
-        <% elsif selected_section==Navigation::SECTION_CONFIGURATION %>
-
-          <li class="<%= 'selected' if request.request_uri.include?('/profiles') || request.request_uri.include?('/rules_configuration') -%>">
-            <a href="<%= ApplicationController.root_context -%>/profiles"><%= message('quality_profiles.page') -%></a></li>
-          <% if current_user %>
-            <li class="<%= 'selected' if controller.controller_path=='account' -%>">
-              <a href="<%= ApplicationController.root_context -%>/account/index"><%= message('my_profile.page') -%></a></li>
-            <li class="<%= 'selected' if controller.controller_path=='filters' -%>">
-              <a href="<%= ApplicationController.root_context -%>/filters/manage"><%= message('default_filters.page') -%></a></li>
-          <% end %>
-          <% if is_admin? %>
+        <% 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 -%>/roles/projects"><%= message('roles.page') -%></a></li>
 
             <li class="h2"><%= message('sidebar.system') -%></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=='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>
-            <li class="<%= 'selected' if controller.controller_path=='system' -%>">
-              <a href="<%= ApplicationController.root_context -%>/system"><%= message('system_info.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 %>
-          <% end %>
 
         <% end %>
       </ul>
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_tools.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_tools.html.erb
new file mode 100644 (file)
index 0000000..86dc82f
--- /dev/null
@@ -0,0 +1,15 @@
+<li>
+  <a href="#" class="link-more dropdown" onclick="$j('#tools-menu').toggle(); return false;"><%= message('layout.tools') -%></a>
+  
+  <div id="tools-menu" class="dropdown-menu" style="display: none" onmouseout="$j(this).hide();" onmouseover="$j(this).show();">
+    <ul>
+      <li><a href="<%= ApplicationController.root_context -%>/profiles"><%= message('layout.tools.quality_profiles') -%></a></li>
+      <li><a href="<%= ApplicationController.root_context -%>/dependencies/index"><%= message('dependencies.page') -%></a></li>
+      
+      <% if current_user && is_admin? %>
+        <li><a href="<%= ApplicationController.root_context -%>/settings/index"><%= message('layout.configuration') -%></a></li>
+      <% end %>
+    </ul>
+  </div>
+  
+</li>
\ No newline at end of file
index 869224cf5a8577246c20ca85ccbe990fc7d1800f..da5f96da4def8b0d20b4587cea0bc240706358b2 100644 (file)
@@ -19,6 +19,8 @@
         <br/>
         <a href="<%= ApplicationController.root_context -%>/account/index" class="link-action"><%= message('layout.user_panel.my_profile') -%></a>
         &nbsp;–&nbsp;
+        <a href="<%= ApplicationController.root_context -%>/filters/manage" class="link-action"><%= message('default_filters.page') -%></a>
+        &nbsp;–&nbsp;
         <a href="<%= ApplicationController.root_context -%>/sessions/logout" class="link-action" onclick="if (sonarRecentHistory) { sonarRecentHistory.clear(); };"><%= message('layout.logout') -%></a>
       <% else %>
         <b><%= message('layout.user_panel.anonymous_user') -%></b>
index 3d6bcc5253840f5db16e64e95fa41d3160981929..551d37ad0faae008ac1dae3471d7075feeb1ae3d 100644 (file)
@@ -148,6 +148,10 @@ body, a {
   padding: 0 5px 0 0;
 }
 
+#hd .dropdown-menu a {
+  color: #000;
+}
+
 #user-panel {
   position: absolute;
   float: right;
index dc7d85ca0a49f89d539c3bbc6a8e81ea423f6ac6..1260a2805153c57f1a93096e83493c3f9db1ed09 100644 (file)
@@ -2144,10 +2144,7 @@ table.nowrap td, td.nowrap, th.nowrap {
   border-color: #DDD;
   border-style: solid;
   border-width: 1px;
-  -moz-box-shadow: 0 5px 10px rgab(0, 0, 0, 0.2);
-  -webkit-box-shadow: 0 5px 10px rgab(0, 0, 0, 0.2);
-  -o-box-shadow: 0 5px 10px rgab(0, 0, 0, 0.2);
-  box-shadow: 0 5px 10px rgab(0, 0, 0, 0.2);
+  box-shadow: 10px 10px 20px rgba(0, 0, 0, 0.5);
   float: left;
   margin: 0;
   max-width: 220px;