]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-3972 Add "Projects" top-menu entry
authorFabrice Bellingard <fabrice.bellingard@sonarsource.com>
Tue, 4 Dec 2012 10:49:09 +0000 (11:49 +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/_layout.html.erb
sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_menu_projects.html.erb [new file with mode: 0644]
sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_menu_resource_settings.html.erb
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 eb7bc0a590e886850a754068076a5d9d6e1c7beb..1183ce06a7ecd0172147566be6b01835e0a67b81 100644 (file)
@@ -299,10 +299,9 @@ layout.ie6_warn=Your web browser is outdated. This website may not display corre
 layout.dashboards=Dashboards
 layout.reviews=Reviews
 layout.configuration=Configuration
+layout.projects=Projects
+layout.recent_activity=Recent Activity
 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.project_settings=Configuration
 sidebar.security=Security
@@ -352,7 +351,7 @@ resource_deletion.page={0} Deletion
 update_key.page=Update Key
 project_quality_profiles.page=Quality Profiles
 bulk_deletion.page=Bulk Deletion
-comparison.page=Comparison
+comparison.page=Compare
 
 
 # GWT pages
index 544c93d9312068faacac46f239841d2e74c849e6..d0026cd504b11ca068d44f0dd084d2cca562a0ac 100644 (file)
@@ -14,6 +14,7 @@
         <li>
           <a href="<%= ApplicationController.root_context -%>/"><%= message('layout.dashboards') -%></a>
         </li>
+        <%= render 'layouts/menu_projects' -%>
         <li>
           <a href="<%= ApplicationController.root_context -%>/measures"><%= message('layout.measures') -%></a>
         </li>
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_menu_projects.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_menu_projects.html.erb
new file mode 100644 (file)
index 0000000..b83744e
--- /dev/null
@@ -0,0 +1,42 @@
+<script>
+  if (supports_html5_storage()) {
+    var sonarRecentHistory = new Sonar.RecentHistory();
+  }
+</script>
+
+  <style>
+    #recent-history-list imgs {
+      float: left;
+    }
+  </style>
+
+<li>
+  <a href="#" onclick="if (sonarRecentHistory) { sonarRecentHistory.populateRecentHistoryPanel(); }; $j('#projects-menu').toggle(); return false;" class="link-more"><%= message('layout.projects') -%></a>
+  
+  <div id="projects-menu" class="dropdown-menu" style="max-width: none; display: none;" onmouseout="$j(this).hide();" onmouseover="$j(this).show();">
+    <div id="recent-history">
+      <h2><%= message('layout.recent_activity') -%></h2>
+      <ul id="recent-history-list">
+      </ul>
+    </div>
+    
+    <div>
+      <ul>
+        <li><a href="<%= ApplicationController.root_context -%>/">Projects</a></li>
+        <li><a href="<%= ApplicationController.root_context -%>/">Views</a></li>
+        <li><a href="<%= ApplicationController.root_context -%>/">Developers</a></li>
+      </ul>
+    </div>
+  </div>
+  
+</li>
+
+<script>
+  if (sonarRecentHistory == null) {
+    $j('#recent-history').detach();
+  } else {
+    sonarRecentHistory.add('<%= @resource ? @resource.key : "" -%>', 
+                           '<%= @resource ? @resource.name(true) : "" -%>', 
+                           '<%= @resource ? Api::Utils.java_facade.getResourceType(@resource.qualifier).getIconPath() : "" -%>');
+  }
+</script>
\ No newline at end of file
index 9771d312d7c7d0356d751d382b9fe537e6fb1ba4..f2b145f85d76d92bc74fb5b3a013770c2f6af851 100644 (file)
@@ -1,5 +1,5 @@
 <li>
-  <a href="#" onclick="$j('#project-settings-menu').toggle(); return false;" class="link-more dropdown"><%= message('layout.configuration') -%></a>
+  <a href="#" onclick="$j('#project-settings-menu').toggle(); return false;" class="link-more"><%= message('layout.configuration') -%></a>
   
   <div id="project-settings-menu" class="dropdown-menu" style="display: none" onmouseout="$j(this).hide();" onmouseover="$j(this).show();">
     <ul>
index 3b0ed058a334fc23f5b5c91ba2ff70272718c467..8973f49fd8e4a03423b7c23b871afb0f8a4b9a41 100644 (file)
@@ -1,15 +1,8 @@
-<script>
-  if (supports_html5_storage()) {
-    var sonarRecentHistory = new Sonar.RecentHistory();
-  }
-</script>
-
 <li>
-  <a href="#" onclick="if (sonarRecentHistory) { sonarRecentHistory.populateRecentHistoryPanel(); }; $j('#user-panel').toggle(); return false;" class="link-more"><%= current_user ? current_user.name(true) : message('layout.user_panel.me') -%></a>
+  <a href="#" onclick="$j('#user-panel').toggle(); return false;" class="link-more"><%= current_user.name(true) -%></a>
   
   <div id="user-panel" style="display: none" onmouseout="$j(this).hide();" onmouseover="$j(this).show();">
     <div id="user-details">
-      <% if current_user %>
         <b><%= current_user.name(true) -%></b>
         <% if current_user.email && !current_user.email.blank? %>
           <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 -%>/sessions/logout" class="link-action" onclick="if (sonarRecentHistory) { sonarRecentHistory.clear(); }"><%= message('layout.logout') -%></a>
-      <% else %>
-        <b><%= message('layout.user_panel.anonymous_user') -%></b>
-      <% end %>
     </div>
-    
-    <div id="recent-history" style="display: none">
-      <b><%= message('layout.user_panel.recent_history.title') -%></b>
-      <ul id="recent-history-list">
-      </ul>            
-    </div>
-  </div>
   
 </li>
-
-<script>
-  if (sonarRecentHistory == null) {
-    $j('#recent-history').detach();
-  } else {
-    sonarRecentHistory.add('<%= @resource ? @resource.key : "" -%>', 
-                           '<%= @resource ? @resource.name(true) : "" -%>', 
-                           '<%= @resource ? Api::Utils.java_facade.getResourceType(@resource.qualifier).getIconPath() : "" -%>');
-  }
-</script>
\ No newline at end of file
index 9b7c5cc0463722836c4cf2ea48d84e88f0cdda36..9b44d779b26fb961618f06ecd40100a075d7e79c 100644 (file)
@@ -148,6 +148,14 @@ body, a {
   padding: 0 0 0 10px;
 }
 
+#crumbs-ops li a {
+  text-decoration: none;
+}
+
+#crumbs-ops li a:hover, #crumbs-ops li a:focus {
+  text-decoration: underline;
+}
+
 #content {
   padding: 10px;
 }
@@ -184,25 +192,7 @@ body, a {
 }
 
 #recent-history {
-  border-top: 1px solid #ccc;
-}
-
-#recent-history li {
-  list-style-type: none !important;
-  padding: 2px 8px 2px 0 !important;
-  cursor: pointer !important;
-}
-
-#recent-history li:hover {
-  background-color: #4b9fd5 !important;
-}
-
-#recent-history li:hover a {
-  color: #fff !important;
-}
-
-#recent-history a {
-  text-decoration: none !important;
+  border-bottom: 1px solid #ccc;
 }
 
 #nonav {
index 2c01ef21d7f3f131ca48029d4f1a6ddb16c59e1c..ad40264b3dc5e8c22b32676f563703dd8e26a08a 100644 (file)
@@ -2125,6 +2125,11 @@ table.nowrap td, td.nowrap, th.nowrap {
   z-index: 1000;
 }
 
+.dropdown-menu h2 {
+  padding: 0 8px;
+  font-size: 100%;
+}
+
 .dropdown-menu li {
   list-style-type: none !important;
   line-height: 24px;
@@ -2146,7 +2151,6 @@ table.nowrap td, td.nowrap, th.nowrap {
 
 .dropdown-menu a {
   text-decoration: none !important;
-  display: block !important;
 }
 
 .form-key-cell {