]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-3802 new breadcrumb
authorSimon Brandhof <simon.brandhof@gmail.com>
Mon, 17 Sep 2012 16:58:12 +0000 (18:58 +0200)
committerSimon Brandhof <simon.brandhof@gmail.com>
Mon, 17 Sep 2012 16:58:12 +0000 (18:58 +0200)
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/images/bc-blue-gray.png [new file with mode: 0644]
sonar-server/src/main/webapp/images/bc-gray-blue.png [new file with mode: 0644]
sonar-server/src/main/webapp/images/bc-gray.png [new file with mode: 0644]
sonar-server/src/main/webapp/stylesheets/layout.css
sonar-server/src/main/webapp/stylesheets/style.css

index 526601cef6dd779ce8d06e05d87f972e704727be..d59487b635dc7e16198a7cb101a557e4ff64623e 100644 (file)
@@ -1,48 +1,60 @@
-<%
-resource_link = {}
-only_resource = true
-if @review
-  resource_link = {:controller => 'dashboard', :action => 'index'}
-  only_resource = false
-end
+<% if @resource || @project %>
+  <div id="bc">
+    <ul>
+      <%
+         resource_link = {}
+         if @review
+           resource_link = {:controller => 'dashboard', :action => 'index'}
+         end
 
-# ======== Path for resources ========
-displayed_resource = @resource || @project
-if displayed_resource && displayed_resource.last_snapshot
-  resources=[]
-  s=displayed_resource.last_snapshot
-  while (s!=nil) do
-    resources<<s.project
-    s=s.parent
-  end
+         # ======== Path for resources ========
+         displayed_resource = @resource || @project
+         if displayed_resource && displayed_resource.last_snapshot
+           resources=[]
+           s=displayed_resource.last_snapshot
+           while (s!=nil) do
+             resources<<s.project
+             s=s.parent
+           end
 
-  resources.reverse.each do |resource|
-%>
-  <li>
-    <%= qualifier_icon(resource) -%> 
-    &nbsp;
-    <%= link_to( h(resource.name), 
-                 {:overwrite_params => { :id => resource.key }.merge(resource_link)}
+           items_count = resources.size
+           items_count+=1 if @review
+           resources.reverse.each_with_index do |resource, index|
+             if items_count==1
+               css_class='first-selected'
+             else
+               css_class=
+                 case index
+                   when 0 then
+                     'first'
+                   when (items_count-1) then
+                     'selected'
+                   else
+                     ''
+                 end
+             end
+      %>
+          <li class="<%= css_class -%>">
+            <%= qualifier_icon(resource) -%>
+            &nbsp;
+            <%= link_to(h(resource.name),
+                        {:overwrite_params => {:id => resource.key}.merge(resource_link)}
                 ) -%>
-    
-    <% if resource==displayed_resource && only_resource %>
-    &nbsp;
-    <%= link_to( image_tag('permalink.gif'), 
-                 {:overwrite_params => { :id => resource.key }.merge(resource_link)}, 
-                 {:title => message('layout.permalink')}
-                ) -%>
-    <% end %>
-  </li>
-<%
-  end
-end
+          </li>
+        <%
+           end
+           end
 
-# ======== Path for review ========
-if @review
-%>
-  <li>
-    ยป <%= link_to message('review') + ' #' + @review.id.to_s -%>
-  </li>
-<%
-end
-%>
\ No newline at end of file
+           # ======== Path for review ========
+           if @review
+        %>
+        <li class="selected">
+          <%= link_to message('review') + ' #' + @review.id.to_s -%>
+        </li>
+      <%
+         end
+      %>
+      <li class="last">&nbsp;</li>
+    </ul>
+  </div>
+<% end %>
\ No newline at end of file
index 122c37c4cdcbce6123a6eaa19dc4a879113e34e2..87c876f3c4d6b5698c6a966fe4a329b140d02efd 100644 (file)
@@ -22,7 +22,6 @@
           <a href="<%= ApplicationController.root_context -%>/dashboard/?did=<%= main_global_dashboard.dashboard_id -%>"><%= h main_global_dashboard.dashboard.name(true) -%></a>
         <% end %>
       </li>
-      <%= render :partial => 'layouts/breadcrumb' -%>
     </ul>
   </div>
   <div id="hd-right">
@@ -46,6 +45,7 @@
     </ul>
   </div>
 </div>
+<%= render 'layouts/breadcrumb' -%>
 <div id="body">
   <div id="searchResourcesResults" class="autocomplete" style="display:none"></div>
   <div id="sb">
diff --git a/sonar-server/src/main/webapp/images/bc-blue-gray.png b/sonar-server/src/main/webapp/images/bc-blue-gray.png
new file mode 100644 (file)
index 0000000..c3df137
Binary files /dev/null and b/sonar-server/src/main/webapp/images/bc-blue-gray.png differ
diff --git a/sonar-server/src/main/webapp/images/bc-gray-blue.png b/sonar-server/src/main/webapp/images/bc-gray-blue.png
new file mode 100644 (file)
index 0000000..e9af698
Binary files /dev/null and b/sonar-server/src/main/webapp/images/bc-gray-blue.png differ
diff --git a/sonar-server/src/main/webapp/images/bc-gray.png b/sonar-server/src/main/webapp/images/bc-gray.png
new file mode 100644 (file)
index 0000000..c5bee91
Binary files /dev/null and b/sonar-server/src/main/webapp/images/bc-gray.png differ
index b36c6bca91b7f30f34a171bb348c08634b926aa7..5265659cd0d94caf80fbe07019e86f0699c87866 100644 (file)
@@ -68,7 +68,6 @@ body, a {
   text-decoration: underline;
 }
 
-
 #crumbs {
   float: left;
   vertical-align: middle;
@@ -94,6 +93,62 @@ body, a {
   padding: 0 0 0 10px;
 }
 
+#bc {
+  color: #444;
+  background: #EFEFEF;
+  height: 22px;
+  line-height: 22px;
+  font-size: 93%;
+  margin: 0 10px;
+  border-bottom: 1px solid #CCC;
+  border-right: 2px solid #CCC;
+}
+
+#bc > ul > li {
+  float: left;
+  margin: 0;
+  background: #EFEFEF url("../images/bc-gray.png") no-repeat left;
+  border-bottom: 1px solid #CCC;
+  padding: 0 10px 0 20px;
+}
+
+#bc > ul > li.first {
+  background: #EFEFEF;
+  border-left: 2px solid #CCC;
+  padding: 0 10px 0 5px;
+}
+
+#bc > ul > li.first-selected {
+  background: #4B9FD5;
+  border-left: 2px solid #4B9FD5;
+  border-bottom: 1px solid #4B9FD5;
+  padding: 0 10px 0 5px;
+}
+
+#bc > ul > li.selected {
+  background: #4B9FD5 url("../images/bc-gray-blue.png") no-repeat left;
+}
+
+#bc > ul > li.last {
+  background: #EFEFEF url("../images/bc-blue-gray.png") no-repeat left;
+  border-bottom: #CCC;
+}
+
+#bc > ul > li img {
+  vertical-align: text-bottom;
+  margin-right: -5px;
+}
+
+#bc > ul > li.selected a, #bc > ul > li.first-selected a {
+  color: #FFF;
+}
+#bc > ul > li a {
+  text-decoration: none;
+}
+#bc > ul > li a:hover, #bc > ul > li a:focus {
+  text-decoration: underline;
+}
+
 #nonav {
   text-align: left;
   margin: 50px 180px 0;
@@ -135,7 +190,7 @@ body, a {
   text-align: left;
   line-height: 1.1em;
   border: 2px solid #4b9fd5;
-  border-top: 0;
+  border-top-width: 1px;
   padding: 10px 0;
 }
 
@@ -166,7 +221,6 @@ body, a {
 }
 
 #sidebar .selected a, #sidebar .selected a:hover, #sidebar.selected a:visited {
-  font-weight: bold;
   color: #FEFEFE;
 }
 
@@ -186,7 +240,7 @@ body, a {
 
 #sidebarconf {
   background-color: #EFEFEF;
-  border: 2px solid #DDD;
+  border: 2px solid #CCC;
   color: #666;
   line-height: 1.1em;
   margin-top: 10px;
index c10072a4b1c7fcb670d010926106198e9e6b2f2a..74584a1093b076e7909cddfe6171144ce5c7e10d 100644 (file)
@@ -1651,8 +1651,7 @@ ul.bullet li {
 .tabs li a.selected:link, .tabs li a.selected:visited {
   text-decoration: none;
   background-color: #4B9FD5;
-  color: #efefef;
-  font-weight: bold;
+  color: #FFF;
   border: 1px solid #CAE3F2;
   margin: 0 1px 0 0;
 }