incubator-bloodhound-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From g..@apache.org
Subject svn commit: r1352218 - in /incubator/bloodhound/trunk/bloodhound_theme/bhtheme: templates/bh_milestone_view.html templates/bh_product_view.html theme.py
Date Wed, 20 Jun 2012 17:28:45 GMT
Author: gjm
Date: Wed Jun 20 17:28:44 2012
New Revision: 1352218

URL: http://svn.apache.org/viewvc?rev=1352218&view=rev
Log:
theme: converts milestone template to use the generic model template and adds an overriding
product template also using the generic template - towards #93 (from Olemis with small modifications)

Added:
    incubator/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_product_view.html   (with
props)
Modified:
    incubator/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_milestone_view.html
    incubator/bloodhound/trunk/bloodhound_theme/bhtheme/theme.py

Modified: incubator/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_milestone_view.html
URL: http://svn.apache.org/viewvc/incubator/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_milestone_view.html?rev=1352218&r1=1352217&r2=1352218&view=diff
==============================================================================
--- incubator/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_milestone_view.html (original)
+++ incubator/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_milestone_view.html Wed
Jun 20 17:28:44 2012
@@ -8,11 +8,6 @@
       xmlns:xi="http://www.w3.org/2001/XInclude">
   <xi:include href="layout.html" />
   <xi:include href="widget_macros.html" />
-  <head>
-    <title>Milestone ${milestone.name}</title>
-    <link py:if="'MILESTONE_MODIFY' in perm(milestone.resource)" rel="alternate" type="application/x-wiki"
-          title="Edit this milestone" href="${href.milestone(milestone.name, action='edit')}"
/>
-  </head>
 
   <py:def function="milestone_date">
     <py:choose test="">
@@ -48,114 +43,71 @@
     </py:choose>
   </py:def>
 
-  <body>
-    <div class="row">
-      <div class="${'span8' if bhdb else 'span12'}">
-        <div class="stickyBox">
-          <div id="overview" class="stickyStatus">
-            <div class="whitebox"></div>
-            <h1 style="display: inline;">Milestone ${milestone.name}</h1>
-            <h6>${milestone_date()} &nbsp;&nbsp;&nbsp; ${milestone_owner()}</h6>
-            <br/>
-            <xi:include href="widget_progress.html"
-                py:with="view = 'compact'; legend = True;" />
-            <div class="stickyEndMark"></div>
-          </div>
-        </div>
-        <script type="text/javascript">
-          setup_sticky_panel('#overview');
-        </script>
-        <div class="${'span7' if bhdb else 'span11'}" >
-          <div class="well">
-            ${wiki_to_html(context, milestone.description)}
-            <div py:if="'MILESTONE_MODIFY' in perm(milestone.resource) or
-                        'MILESTONE_DELETE' in perm(milestone.resource) or
-                        attachments.can_create">
-              <form py:if="'MILESTONE_MODIFY' in perm(milestone.resource)"
-                  method="get" action="" id="editmilestone"
-                  style="display: inline-block">
-                <input type="hidden" name="action" value="edit" />
-                <div class="btn-group">
-                  <button class="btn" name="editmilestonebutton" type="submit">
-                    <i class="icon-edit"></i>
-                    ${_('Edit')}
-                  </button>
-                </div>
-              </form>
-              <form py:if="'MILESTONE_DELETE' in perm(milestone.resource)"
-                  method="get" action="" id="deletemilestone"
-                  style="display: inline-block">
-                <input type="hidden" name="action" value="delete" />
-                <div class="btn-group">
-                  <button class="btn" name="deletemilestonebutton" type="submit">
-                    <i class="icon-trash"></i>
-                    ${_('Delete')}
-                  </button>
-                </div>
-              </form>
-              <xi:include href="bh_attach_file_form.html" py:with="alist = attachments"
/>
-            </div>
-          </div>
+  <py:def function="milestone_heading()">
+    <h1 style="display: inline;">Milestone ${milestone.name}</h1>
+    <h6>${milestone_date()} &nbsp;&nbsp;&nbsp; ${milestone_owner()}</h6>
+  </py:def>
+
+  <py:def function="milestone_buttons()">
+    <div py:if="'MILESTONE_MODIFY' in perm(milestone.resource) or
+                'MILESTONE_DELETE' in perm(milestone.resource) or
+                attachments.can_create">
+      <form py:if="'MILESTONE_MODIFY' in perm(milestone.resource)"
+          method="get" action="" id="editmilestone"
+          style="display: inline-block">
+        <input type="hidden" name="action" value="edit" />
+        <div class="btn-group">
+          <button class="btn" name="editmilestonebutton" type="submit">
+            <i class="icon-edit"></i>
+            ${_('Edit')}
+          </button>
         </div>
-        <div class="span8">
-          <!--! bh:layout urn="bootstrap_grid">
-            <bh:schema>
-              {
-                "div" : [
-                    {
-                      "_class" : "row",
-                      "div" : [
-                          {
-                            "_class" : "${'span8' if bhdb else 'span12'}",
-                            "widgets" : ["tickets", "components"]
-                          }
-                        ]
-                    }
-                  ]
-              }
-            </bh:schema>
-            <bh:widgets>
-              {
-                "tickets" : {
-                    "args" : ["TicketQuery", null, {
-                        "args" : {
-                            "max" : 10,
-                            "query" : "milestone=${milestone.name}&amp;status=!closed&amp;group=time&amp;col=id&amp;col=summary&amp;col=owner&amp;col=status&amp;col=priority&amp;order=priority&amp;groupdesc=1&amp;desc=1",
-                            "title" : "Active tickets in milestone"
-                          }
-                      }]
-                  },
-                "components" : {
-                    "args" : ["TicketFieldValues", null, {
-                        "args" : {
-                            "field" : "component",
-                            "query" : "milestone=${milestone.name}&amp;group=component",
-                            "verbose" : true
-                          }
-                      }]
-                  }
-              }
-            </bh:widgets>
-          </bh:layout -->
-          <bh:widget urn="TicketQuery">
-            <bh:args>
-              <bh:arg name="max">10</bh:arg>
-              <bh:arg name="query">milestone=${milestone.name}&amp;status=!closed&amp;group=time&amp;col=id&amp;col=summary&amp;col=owner&amp;col=status&amp;col=priority&amp;order=priority&amp;groupdesc=1&amp;desc=1</bh:arg>
-              <bh:arg name="title">Active tickets in milestone</bh:arg>
-            </bh:args>
-          </bh:widget>
-          <bh:widget urn="TicketFieldValues">
-            <bh:args>
-              <bh:arg name="field">component</bh:arg>
-              <bh:arg name="verbose">true</bh:arg>
-              <bh:arg name="query">milestone=${milestone.name}&amp;group=component</bh:arg>
-            </bh:args>
-          </bh:widget>
+      </form>
+      <form py:if="'MILESTONE_DELETE' in perm(milestone.resource)"
+          method="get" action="" id="deletemilestone"
+          style="display: inline-block">
+        <input type="hidden" name="action" value="delete" />
+        <div class="btn-group">
+          <button class="btn" name="deletemilestonebutton" type="submit">
+            <i class="icon-trash"></i>
+            ${_('Delete')}
+          </button>
         </div>
-      </div>
-      <div py:if="bhdb" class="span4">
-        <bh:widget urn="Timeline" />
-      </div>
+      </form>
+      <xi:include href="bh_attach_file_form.html" py:with="alist = attachments" />
+    </div>
+  </py:def>
+
+  <py:def function="milestone_widgets()">
+    <bh:widget urn="TicketQuery">
+      <bh:args>
+        <bh:arg name="max">10</bh:arg>
+        <bh:arg name="query">milestone=${milestone.name}&amp;status=!closed&amp;group=time&amp;col=id&amp;col=summary&amp;col=owner&amp;col=status&amp;col=priority&amp;order=priority&amp;groupdesc=1&amp;desc=1</bh:arg>
+        <bh:arg name="title">Active tickets in milestone</bh:arg>
+      </bh:args>
+    </bh:widget>
+    <bh:widget urn="TicketFieldValues">
+      <bh:args>
+        <bh:arg name="field">component</bh:arg>
+        <bh:arg name="verbose">true</bh:arg>
+        <bh:arg name="query">milestone=${milestone.name}&amp;group=component</bh:arg>
+      </bh:args>
+    </bh:widget>
+  </py:def>
+
+  <head>
+    <title>Milestone ${milestone.name}</title>
+    <link py:if="'MILESTONE_MODIFY' in perm(milestone.resource)" rel="alternate" type="application/x-wiki"
+          title="Edit this milestone" href="${href.milestone(milestone.name, action='edit')}"
/>
+  </head>
+  <body>
+    <div id="content" class="row milestne">
+      <xi:include href="bh_model_view.html"
+          py:with="heading = milestone_heading(); buttons = milestone_buttons();
+              progress_data = {'stats' : stats, 'interval_hrefs' : interval_hrefs};
+              description = wiki_to_html(context, milestone.description);
+              widgets = milestone_widgets();" />
     </div>
   </body>
+
 </html>

Added: incubator/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_product_view.html
URL: http://svn.apache.org/viewvc/incubator/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_product_view.html?rev=1352218&view=auto
==============================================================================
--- incubator/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_product_view.html (added)
+++ incubator/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_product_view.html Wed
Jun 20 17:28:44 2012
@@ -0,0 +1,97 @@
+<!DOCTYPE html
+    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+      xmlns:py="http://genshi.edgewall.org/"
+      xmlns:i18n="http://genshi.edgewall.org/i18n"
+      xmlns:bh="http://issues.apache.org/bloodhound/wiki/Ui/Dashboard"
+      xmlns:xi="http://www.w3.org/2001/XInclude">
+  <xi:include href="layout.html" />
+  <xi:include href="widget_macros.html" />
+
+  <py:def function="product_owner()">
+    <py:choose>
+      <py:when test="product.owner">
+        Owned by
+        <a href="${href.query(owner=product.owner, status='!closed',
+            product=product.name, order='priority')}">${product.owner}</a>
+      </py:when>
+      <py:otherwise>&nbsp;</py:otherwise>
+    </py:choose>
+  </py:def>
+
+  <py:def function="product_heading()">
+    <h1 style="display: inline;">Product ${product.name}</h1>
+    <h6>${product_owner()}</h6>
+  </py:def>
+
+  <py:def function="product_buttons()">
+    <div py:if="'PRODUCT_MODIFY' in perm(product.resource) or
+                'PRODUCT_DELETE' in perm(product.resource) or
+                attachments.can_create"
+        class="buttons">
+      <form py:if="'PRODUCT_MODIFY' in perm(product.resource)"
+          method="get" action="" id="editproduct"
+          style="display: inline-block">
+        <input type="hidden" name="action" value="edit" />
+        <div class="btn-group">
+          <button class="btn" name="editproductbutton" type="submit">
+            <i class="icon-edit"></i>
+            ${_('Edit')}
+          </button>
+        </div>
+      </form>
+      <form py:if="'PRODUCT_DELETE' in perm(product.resource)"
+          method="get" action="" id="deleteproduct"
+          style="display: inline-block">
+        <input type="hidden" name="action" value="delete" />
+        <div class="btn-group">
+          <button class="btn" name="deleteproductbutton" type="submit">
+            <i class="icon-trash"></i>
+            ${_('Delete')}
+          </button>
+        </div>
+      </form>
+    </div>
+  </py:def>
+
+  <py:def function="product_widgets()">
+    <bh:widget urn="TicketQuery">
+      <bh:args>
+        <bh:arg name="max">10</bh:arg>
+        <bh:arg name="query">product=${product.name}&amp;status=!closed&amp;group=time&amp;col=id&amp;col=summary&amp;col=owner&amp;col=status&amp;col=priority&amp;order=priority&amp;groupdesc=1&amp;desc=1</bh:arg>
+        <bh:arg name="title">Active tickets</bh:arg>
+      </bh:args>
+    </bh:widget>
+    <bh:widget urn="TicketFieldValues">
+      <bh:args>
+        <bh:arg name="field">version</bh:arg>
+        <bh:arg name="verbose">true</bh:arg>
+        <bh:arg name="query">product=${product.name}&amp;group=version</bh:arg>
+      </bh:args>
+    </bh:widget>
+    <bh:widget urn="TicketFieldValues">
+      <bh:args>
+        <bh:arg name="field">component</bh:arg>
+        <bh:arg name="verbose">true</bh:arg>
+        <bh:arg name="query">product=${product.name}&amp;group=component</bh:arg>
+      </bh:args>
+    </bh:widget>
+  </py:def>
+
+  <head>
+    <title>Product ${product.name}</title>
+    <link py:if="'PRODUCT_MODIFY' in perm(product.resource)" rel="alternate" type="application/x-wiki"
+          title="Edit this product" href="${href.products(product.prefix, action='edit')}"
/>
+  </head>
+  <body>
+    <div id="content" class="row product">
+      <xi:include href="bh_model_view.html"
+          py:with="heading = product_heading(); buttons = product_buttons();
+              description = wiki_to_html(context, product.description);
+              widgets = product_widgets();" />
+    </div>
+  </body>
+
+</html>
+

Propchange: incubator/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_product_view.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_product_view.html
------------------------------------------------------------------------------
    svn:mime-type = text/html

Modified: incubator/bloodhound/trunk/bloodhound_theme/bhtheme/theme.py
URL: http://svn.apache.org/viewvc/incubator/bloodhound/trunk/bloodhound_theme/bhtheme/theme.py?rev=1352218&r1=1352217&r2=1352218&view=diff
==============================================================================
--- incubator/bloodhound/trunk/bloodhound_theme/bhtheme/theme.py (original)
+++ incubator/bloodhound/trunk/bloodhound_theme/bhtheme/theme.py Wed Jun 20 17:28:44 2012
@@ -93,6 +93,9 @@ class BloodhoundTheme(ThemeBase):
         'ticket.html' : ('bh_ticket.html', None),
         'ticket_preview.html' : ('bh_ticket_preview.html', None),
 
+        # Multi Product
+        'product_view.html' : ('bh_product_view.html', None),
+
         # General purpose
         'history_view.html' : ('bh_history_view.html', None),
     }



Mime
View raw message