Author: matevz
Date: Thu Feb 28 15:00:53 2013
New Revision: 1451223

URL: http://svn.apache.org/r1451223
Log:
#326 - Multiproduct UI: Breadcrumbs

Modified:
    
incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_theme/bhtheme/htdocs/bloodhound.css
    
incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_theme/bhtheme/templates/bh_path_ticket.html
    
incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_theme/bhtheme/theme.py

Modified: 
incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_theme/bhtheme/htdocs/bloodhound.css
URL: 
http://svn.apache.org/viewvc/incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_theme/bhtheme/htdocs/bloodhound.css?rev=1451223&r1=1451222&r2=1451223&view=diff
==============================================================================
--- 
incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_theme/bhtheme/htdocs/bloodhound.css
 (original)
+++ 
incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_theme/bhtheme/htdocs/bloodhound.css
 Thu Feb 28 15:00:53 2013
@@ -548,6 +548,10 @@ input[type="submit"].btn.btn-micro {
   padding: 7px 14px;
 }
 
+#breadcrumbbar .btn-group a:hover {
+  text-decoration: none;
+}
+
 @media (max-width: 979px) {
   .hidden-desktop {
     display: inherit !important;

Modified: 
incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_theme/bhtheme/templates/bh_path_ticket.html
URL: 
http://svn.apache.org/viewvc/incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_theme/bhtheme/templates/bh_path_ticket.html?rev=1451223&r1=1451222&r2=1451223&view=diff
==============================================================================
--- 
incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_theme/bhtheme/templates/bh_path_ticket.html
 (original)
+++ 
incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_theme/bhtheme/templates/bh_path_ticket.html
 Thu Feb 28 15:00:53 2013
@@ -26,11 +26,24 @@
     <a title="View the dashboard" href="${href.dashboard()}">Dashboard</a>
     <span class="divider">/</span>
   </li>
-  <li py:if="ticket.product" py:with="prodlink = path_show_product and 
href.products(ticket.product) or href.query(product=ticket['product'], 
active='!closed')">
-    <a title="Active tickets for product ${ticket.product}"
-        href="${prodlink}">
-      ${ticket.product}
-    </a>
+  <li py:if="ticket.product"
+      py:with="prodlink = path_show_product and href.products(ticket.product) 
or href.query(product=ticket['product'], active='!closed') ;
+          single_product = not product_list or len(product_list) &lt; 2">
+    <div class="btn-group" py:strip="single_product">
+      <button class="btn btn-mini" py:strip="single_product">
+        <a title="Active tickets for product ${ticket.product}" 
href="${prodlink}">${ticket.product}</a>
+      </button>
+      <py:if test="not single_product">
+        <button class="btn btn-mini dropdown-toggle" data-toggle="dropdown">
+          <span class="caret"></span>
+        </button>
+        <ul class="dropdown-menu">
+          <li py:for="prefix,name in product_list">
+            <a title="Active tickets for product ${prefix}" 
href="${href.products(prefix)}">${prefix}</a>
+          </li>
+        </ul>
+      </py:if>
+    </div>
     <span class="divider">/</span>
   </li>
   <li py:if="ticket.milestone" py:with="mslink = path_show_milestone and 
href.milestone(ticket.milestone) or href.query(milestone=ticket['milestone'], 
active='!closed')">

Modified: 
incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_theme/bhtheme/theme.py
URL: 
http://svn.apache.org/viewvc/incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_theme/bhtheme/theme.py?rev=1451223&r1=1451222&r2=1451223&view=diff
==============================================================================
--- 
incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_theme/bhtheme/theme.py
 (original)
+++ 
incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_theme/bhtheme/theme.py
 Thu Feb 28 15:00:53 2013
@@ -50,6 +50,8 @@ from pkg_resources import get_distributi
 from urlparse import urlparse
 from wsgiref.util import setup_testing_defaults
 
+from multiproduct.model import Product
+
 try:
     from multiproduct.ticket.web_ui import ProductTicketModule
 except ImportError:
@@ -322,6 +324,13 @@ class BloodhoundTheme(ThemeBase):
                 res = Resource(resname, data['ticket'][resname])
                 data['path_show_' + resname] = permname in req.perm(res)
 
+            # add list of products available to this user
+            product_list = []
+            for product in Product.select(self.env):
+                if 'PRODUCT_VIEW' in req.perm(product.resource):
+                    product_list.append((product.prefix, product.name))
+            data['product_list'] = product_list
+
     # INavigationContributor methods
 
     def get_active_navigation_item(self, req):


Reply via email to