]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-3972 Move project admin entries to a popup-menu on the top-right
authorFabrice Bellingard <fabrice.bellingard@sonarsource.com>
Mon, 3 Dec 2012 17:22:46 +0000 (18:22 +0100)
committerFabrice Bellingard <fabrice.bellingard@sonarsource.com>
Tue, 4 Dec 2012 14:35:02 +0000 (15:35 +0100)
plugins/sonar-core-plugin/src/main/resources/org/sonar/l10n/core.properties
sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_breadcrumb.html.erb
sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_layout.html.erb
sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_menu_resource_settings.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 2a3a3479df79ed340d3425b8e566c0e642903573..eb7bc0a590e886850a754068076a5d9d6e1c7beb 100644 (file)
@@ -298,6 +298,7 @@ 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.reviews=Reviews
+layout.configuration=Configuration
 layout.user_panel.my_profile=My profile
 layout.user_panel.recent_history.title=Recent history
 layout.user_panel.me=Me
index bd1ffc42a10685d9340754cc8d50e3c3893134c7..b80b9dfb1e65f29939e6364a8306fcd5e7742eab 100644 (file)
@@ -1,10 +1,17 @@
+<% 
+   displayed_resource = @resource || @project
+%>
+
 <% if @breadcrumbs %>
 
   <div id="crumbs">
     <ul id="crumbs-ops">
-      <% if @resource %>
+      <% if displayed_resource %>
+        <% if has_role?(:admin, displayed_resource) %>
+          <%= render 'layouts/menu_resource_settings' -%>
+        <% end %>
         <li>
-          <%= link_to_favourite(@resource) -%>
+          <%= link_to_favourite(displayed_resource) -%>
         </li>
       <% end %>
       <% if @permalink %>
     </ul>
   </div>
   
-<% elsif @resource || @project
-     displayed_resource = @resource || @project
-%>
+<% elsif displayed_resource %>
 
   <div id="crumbs">
     <ul id="crumbs-ops">
-      <% if @resource %>
+      <% if displayed_resource %>
+        <% if has_role?(:admin, displayed_resource) %>
+          <%= render 'layouts/menu_resource_settings' -%>
+        <% end %>
         <li>
-          <%= link_to_favourite(@resource) -%>
+          <%= link_to_favourite(displayed_resource) -%>
         </li>
       <% end %>
       <% if !@review %>
index f773bc5031e0803cc262a175b78d52771604ff6d..544c93d9312068faacac46f239841d2e74c849e6 100644 (file)
@@ -79,7 +79,7 @@
               </li>
             <% end %>
             <li class="<%= 'active' if request.request_uri.include?('/dashboards/index') -%>">
-              <a href="<%= ApplicationController.root_context -%>/dashboards/index?resource=<%= @resource.id -%>"><%= message('dashboard.manage_dashboards') -%></a></li>            
+              <a href="<%= ApplicationController.root_context -%>/dashboards/index?resource=<%= @project.id -%>"><%= message('dashboard.manage_dashboards') -%></a></li>            
             
             <li class="spacer"></li>
             <li class="sidebar-title"><%= message('sidebar.tools') -%></li>
               </li>
             <% end %>
 
-            <% if has_role?(:admin, @project) %>
-              <li class="spacer"></li>
-              <li class="sidebar-title"><%= message('sidebar.project_settings') -%></li>
-              <% if (@project.project?) %>
-                <li class="<%= 'active' 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="<%= 'active' 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="<%= 'active' 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="<%= 'active' 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="<%= 'active' 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="<%= 'active' 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="<%= 'active' 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="<%= 'active' 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="<%= 'active' 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="sidebar-title"><%= message('sidebar.project_settings') -%></li>
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_menu_resource_settings.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_menu_resource_settings.html.erb
new file mode 100644 (file)
index 0000000..9771d31
--- /dev/null
@@ -0,0 +1,41 @@
+<li>
+  <a href="#" onclick="$j('#project-settings-menu').toggle(); return false;" class="link-more dropdown"><%= message('layout.configuration') -%></a>
+  
+  <div id="project-settings-menu" class="dropdown-menu" style="display: none" onmouseout="$j(this).hide();" onmouseover="$j(this).show();">
+    <ul>
+      <% if (@project.project?) %>
+        <li><a href="<%= ApplicationController.root_context -%>/project/profile/<%= @project.id -%>"><%= message('project_quality_profiles.page') -%></a></li>
+      <% end %>
+      <li><a href="<%= ApplicationController.root_context -%>/manual_measures/index/<%= @project.id -%>"><%= message('manual_measures.page') -%></a></li>
+      <% if (@project.project?) %>
+        <li><a href="<%= ApplicationController.root_context -%>/action_plans/index/<%= @project.id -%>"><%= message('action_plans.page') -%></a></li>
+      <% end %>
+      <% if (@project.project? || @project.module?) %>
+         <li><a href="<%= ApplicationController.root_context -%>/project/settings/<%= @project.id -%>"><%= message('project_settings.page') -%></a></li>
+      <% end %>
+      <% if (@project.project?) %>
+         <li><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><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><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><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><a href="<%= ApplicationController.root_context -%>/project/deletion/<%= @project.id -%>"><%= message('resource_deletion.page', :params => message('qualifier.' + @project.qualifier)) -%></a></li>
+      <% end %>
+
+    </ul>
+  </div>
+  
+</li>
\ No newline at end of file
index 43ea4a115b7f60dc939f79bbf2dcdbdbfdba2a80..3b0ed058a334fc23f5b5c91ba2ff70272718c467 100644 (file)
@@ -2,7 +2,6 @@
   if (supports_html5_storage()) {
     var sonarRecentHistory = new Sonar.RecentHistory();
   }
-  var shouldUpdateRecentHistory = true;
 </script>
 
 <li>
index 880ea3eb43ee9c13d5ee56fa51576e53163c29c6..9b7c5cc0463722836c4cf2ea48d84e88f0cdda36 100644 (file)
@@ -156,6 +156,11 @@ body, a {
   color: #000;
 }
 
+#project-settings-menu {
+  float: right;
+  right: 70px;
+}
+
 #user-panel {
   position: absolute;
   float: right;
index ea219327ec7a4b04d580388be13d04803bff45b2..2c01ef21d7f3f131ca48029d4f1a6ddb16c59e1c 100644 (file)
@@ -2106,6 +2106,7 @@ table.nowrap td, td.nowrap, th.nowrap {
 .dropdown {
   cursor: pointer;
   display: inline-block;
+  text-decoration: none !important;
 }
 
 .dropdown-menu {
@@ -2131,6 +2132,7 @@ table.nowrap td, td.nowrap, th.nowrap {
   padding: 0 8px;
   cursor: pointer !important;
   color: red !important;
+  float: none !important;
 }
 
 .dropdown-menu li:hover {