]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-3972 Refactor menus
authorFabrice Bellingard <fabrice.bellingard@sonarsource.com>
Mon, 3 Dec 2012 15:20:27 +0000 (16:20 +0100)
committerFabrice Bellingard <fabrice.bellingard@sonarsource.com>
Tue, 4 Dec 2012 14:35:01 +0000 (15:35 +0100)
- Remove the "Tools" menu and put them on the left side bar
- Remove the user panel when not logged
- Extract "Reviews" and put it on the top bar (will become "Issues")

plugins/sonar-core-plugin/src/main/resources/org/sonar/l10n/core.properties
sonar-server/src/main/webapp/WEB-INF/app/controllers/comparison_controller.rb
sonar-server/src/main/webapp/WEB-INF/app/controllers/dependencies_controller.rb
sonar-server/src/main/webapp/WEB-INF/app/controllers/reviews_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/_tools.html.erb [deleted file]

index 3b774ffe406498d72d888eef02dcd9d67158792e..2a3a3479df79ed340d3425b8e566c0e642903573 100644 (file)
@@ -286,7 +286,7 @@ layout.home=Home
 layout.login=Log in
 layout.logout=Log out
 layout.measures=Measures
-layout.configuration=Configuration
+layout.administration=Administration
 layout.print=Print
 layout.permalink=Permalink
 layout.sonar.slogan=Embrace Quality
@@ -297,19 +297,16 @@ 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.reviews=Reviews
 layout.user_panel.my_profile=My profile
 layout.user_panel.recent_history.title=Recent history
 layout.user_panel.me=Me
 layout.user_panel.anonymous_user=Anonymous
 
-sidebar.tools=Tools
-sidebar.tools.comparison=Comparison
-sidebar.tools.dependency=Dependency
-sidebar.tools.reviews=Reviews
 sidebar.project_settings=Configuration
 sidebar.security=Security
 sidebar.system=System
+sidebar.tools=Tools
 
 
 #------------------------------------------------------------------------------
index b7b13db7131c6ca8d2f15e28e79d9d2e847d3e31..4d0ebd0ac2b50432846c781725b90558f30ad3a1 100644 (file)
@@ -61,7 +61,7 @@ class ComparisonController < ApplicationController
     unless @snapshots.empty?
       @permalink = url_for :controller => 'comparison', :action => 'index', :sids => @snapshots.map {|s| s.id.to_s}.join(','), :metrics => @metrics.map {|m| m.key}.join(',')
     end
-    add_breadcrumbs message('sidebar.tools'), {:name => message('sidebar.tools.comparison'), :url => {:controller => 'comparison', :action => 'index'}}
+    add_breadcrumbs message('sidebar.tools'), {:name => message('comparison.page'), :url => {:controller => 'comparison', :action => 'index'}}
   end
   
   def versions
index 8b7eba87315e1d682c10a2440746a6fbdeb722d8..74b131dc148d5d3ef1e31c72f8760282e31bbc57 100644 (file)
@@ -93,7 +93,7 @@ class DependenciesController < ApplicationController
 
     end
     
-    add_breadcrumbs message('sidebar.tools'), {:name => message('sidebar.tools.dependency'), :url => {:controller => 'dependencies', :action => 'index'}}
+    add_breadcrumbs message('sidebar.tools'), {:name => message('dependencies.page'), :url => {:controller => 'dependencies', :action => 'index'}}
   end
 
   private
index 1aa5479594ec22a14d2524e71f4647ac5d72678b..a4b1c4cabf1a12caa5945465a74be3f7707d76c1 100644 (file)
@@ -30,8 +30,6 @@ class ReviewsController < ApplicationController
   def index
     init_params()
     search_reviews()
-
-    add_breadcrumbs message('sidebar.tools'), {:name => message('sidebar.tools.reviews'), :url => {:controller => 'reviews', :action => 'index'}}
   end
 
   # Used for the "OLD" permalink "http://localhost:9000/reviews/view/1"
index 71e2ab2fc76fd0a8ba95837859393240e587063e..7829ef5476e12603d90c388015d8cb9e46a66cba 100644 (file)
@@ -18,9 +18,8 @@
           <a href="<%= ApplicationController.root_context -%>/measures"><%= message('layout.measures') -%></a>
         </li>
         <li>
-          <a href="<%= ApplicationController.root_context -%>/profiles"><%= message('quality_profiles.page') -%></a>
+          <a href="<%= ApplicationController.root_context -%>/reviews/index"><%= message('reviews.page') -%></a>
         </li>
-        <%= render 'layouts/tools' -%>
       </ul>
     </div>
     <div id="nav">
           <img src="<%= ApplicationController.root_context -%>/images/loading-small.gif" id="searchingResources" style="display:none">
         </li>
         <li>
-          <a href="<%= ApplicationController.root_context -%>/settings/index"><img src="<%= ApplicationController.root_context -%>/images/actions.png" alt="<%= message('layout.configuration') -%>" title="<%= message('layout.configuration') -%>"/></a>
+          <a href="<%= ApplicationController.root_context -%>/settings/index"><img src="<%= ApplicationController.root_context -%>/images/actions.png" alt="<%= message('layout.administration') -%>" title="<%= message('layout.administration') -%>"/></a>
         </li>
-        <% unless logged_in? %>
+        <% if logged_in? %>
+          <%= render 'layouts/user_panel' -%>
+        <% else %>
           <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>
               <li class="<%= 'active' if selected -%>">
                 <a href="<%= ApplicationController.root_context -%><%= page_url -%>"><%= message(page.getId() + '.page', :default => page.getTitle()) -%></a></li>
             <% end %>
+            
+            <li class="spacer"></li>
+            <li class="sidebar-title"><%= message('sidebar.tools') -%></li>
+            
+            <li class="<%= 'active' if request.request_uri.include?('/profiles') -%>">
+              <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') -%>">
+              <a href="<%= ApplicationController.root_context -%>/comparison/index"><%= message('comparison.page') -%></a></li>
 
           <% elsif selected_section==Navigation::SECTION_RESOURCE %>
             <% ActiveDashboard.user_dashboards(current_user, false).each do |active_dashboard| %>
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
deleted file mode 100644 (file)
index d0f369f..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-<li onmouseover="$j('#tools-menu').show();" onmouseout="$j('#tools-menu').hide();">
-  <span class="link-more dropdown"><%= message('layout.tools') -%></span>
-  
-  <div id="tools-menu" class="dropdown-menu" style="display: none">
-    <ul>
-      <li><a href="<%= ApplicationController.root_context -%>/dependencies/index"><%= message('sidebar.tools.dependency') -%></a></li>
-      <li><a href="<%= ApplicationController.root_context -%>/comparison/index"><%= message('sidebar.tools.comparison') -%></a></li>
-      <li><a href="<%= ApplicationController.root_context -%>/reviews/index"><%= message('sidebar.tools.reviews') -%></a></li>
-    </ul>
-  </div>
-</li>
\ No newline at end of file