You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bloodhound.apache.org by gj...@apache.org on 2012/06/21 14:29:31 UTC

svn commit: r1352517 - in /incubator/bloodhound/trunk: bloodhound_dashboard/bhdashboard/templates/bh_model_view.html bloodhound_theme/bhtheme/templates/bh_ticket.html trac/trac/ticket/api.py

Author: gjm
Date: Thu Jun 21 12:29:30 2012
New Revision: 1352517

URL: http://svn.apache.org/viewvc?rev=1352517&view=rev
Log:
trac: move the ITicketFieldProvider implementation into TicketSystem - towards #105

Modified:
    incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/templates/bh_model_view.html
    incubator/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_ticket.html
    incubator/bloodhound/trunk/trac/trac/ticket/api.py

Modified: incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/templates/bh_model_view.html
URL: http://svn.apache.org/viewvc/incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/templates/bh_model_view.html?rev=1352517&r1=1352516&r2=1352517&view=diff
==============================================================================
--- incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/templates/bh_model_view.html (original)
+++ incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/templates/bh_model_view.html Thu Jun 21 12:29:30 2012
@@ -33,13 +33,13 @@
     <script type="text/javascript">
       setup_sticky_panel('#overview');
     </script>
-    <div class="${'span7' if bhdb else 'span11'}" >
+    <div class="${'' if bhdb else 'span11'}" >
       <div class="well">
         $description
         $buttons
       </div>
     </div>
-    <div class="span8">
+    <div>
       $widgets
     </div>
   </div>

Modified: incubator/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_ticket.html
URL: http://svn.apache.org/viewvc/incubator/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_ticket.html?rev=1352517&r1=1352516&r2=1352517&view=diff
==============================================================================
--- incubator/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_ticket.html (original)
+++ incubator/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_ticket.html Thu Jun 21 12:29:30 2012
@@ -103,34 +103,34 @@
         <a href="#propertyform" title="Go to the ticket editor">Modify</a> &darr;
       </div>
       <br/>
-      <h1 id="trac-ticket-title" py:choose="">
-        <py:when test="ticket.exists">
-          <i18n:msg params="id">Ticket #${ticket.id}</i18n:msg>
-          <span class="status"><small>(${ticket.status}<py:if
-              test="ticket.type"> ${ticket.type}</py:if><py:if
-              test="ticket.resolution">: ${ticket.resolution}</py:if>)</small></span>
-          <py:choose test="">
-            <py:when test="version is None" />
-            <py:when test="version == 0">
-              &mdash; 
-              <small>
-                <i18n:msg>at <a href="#comment:description">Initial Version</a></i18n:msg>
-              </small>
-            </py:when>
-            <py:otherwise>
-              &mdash; 
-              <small>
-                <i18n:msg params="version">at <a href="#comment:$version">Version $version</a></i18n:msg>
-              </small>
-            </py:otherwise>
-          </py:choose>
-        </py:when>
-        <py:otherwise>
-          Create New Ticket <small><span py:if="preview_mode and ticket.type" class="status">(${ticket.type})</span></small>
-        </py:otherwise>
-      </h1>
 
       <div class="$colspan">
+        <h1 id="trac-ticket-title" py:choose="">
+          <py:when test="ticket.exists">
+            <i18n:msg params="id">Ticket #${ticket.id}</i18n:msg>
+            <span class="status"><small>(${ticket.status}<py:if
+                test="ticket.type"> ${ticket.type}</py:if><py:if
+                test="ticket.resolution">: ${ticket.resolution}</py:if>)</small></span>
+            <py:choose test="">
+              <py:when test="version is None" />
+              <py:when test="version == 0">
+                &mdash; 
+                <small>
+                  <i18n:msg>at <a href="#comment:description">Initial Version</a></i18n:msg>
+                </small>
+              </py:when>
+              <py:otherwise>
+                &mdash; 
+                <small>
+                  <i18n:msg params="version">at <a href="#comment:$version">Version $version</a></i18n:msg>
+                </small>
+              </py:otherwise>
+            </py:choose>
+          </py:when>
+          <py:otherwise>
+            Create New Ticket <small><span py:if="preview_mode and ticket.type" class="status">(${ticket.type})</span></small>
+          </py:otherwise>
+        </h1>
         <py:if test="ticket.exists">
           <div class="row">
             <div class="$colspan">

Modified: incubator/bloodhound/trunk/trac/trac/ticket/api.py
URL: http://svn.apache.org/viewvc/incubator/bloodhound/trunk/trac/trac/ticket/api.py?rev=1352517&r1=1352516&r2=1352517&view=diff
==============================================================================
--- incubator/bloodhound/trunk/trac/trac/ticket/api.py (original)
+++ incubator/bloodhound/trunk/trac/trac/ticket/api.py Thu Jun 21 12:29:30 2012
@@ -185,37 +185,9 @@ class ITicketFieldProvider(Interface):
         specified as optional.
         """
 
-class TicketFields(Component):
-    implements(ITicketFieldProvider)
-
-    def get_select_fields(self):
-        """Default select and radio fields"""
-        from trac.ticket import model
-        selects = [(10, {'name': 'type', 'label': N_('Type'), 
-                         'cls': model.Type}),
-                   (30, {'name':'priority', 'label': N_('Priority'), 
-                         'cls': model.Priority}),
-                   (40, {'name': 'milestone', 'label': N_('Milestone'), 
-                         'cls': model.Milestone, 'optional': True}),
-                   (50, {'name': 'component', 'label': N_('Component'), 
-                         'cls': model.Component}),
-                   (60, {'name': 'version', 'label': N_('Version'), 
-                         'cls': model.Version, 'optional': True}),
-                   (70, {'name': 'severity', 'label': N_('Severity'), 
-                         'cls': model.Severity})]
-        return selects
-
-    def get_radio_fields(self):
-        """Default radio fields"""
-        from trac.ticket import model
-        radios = [(20, {'name': 'status', 'label': N_('Status'),
-                        'cls': model.Status}),
-                  (80, {'name': 'resolution', 'label': N_('Resolution'), 
-                        'cls': model.Resolution})]
-        return radios
-
 class TicketSystem(Component):
-    implements(IPermissionRequestor, IWikiSyntaxProvider, IResourceManager)
+    implements(IPermissionRequestor, IWikiSyntaxProvider, IResourceManager,
+               ITicketFieldProvider)
 
     ticket_field_providers = ExtensionPoint(ITicketFieldProvider)
     change_listeners = ExtensionPoint(ITicketChangeListener)
@@ -620,3 +592,31 @@ class TicketSystem(Component):
             return revcount[0][0] >= resource.version
         else:
             return False
+
+    # ITicketFieldProvider methods
+
+    def get_select_fields(self):
+        """Default select and radio fields"""
+        from trac.ticket import model
+        selects = [(10, {'name': 'type', 'label': N_('Type'), 
+                         'cls': model.Type}),
+                   (30, {'name':'priority', 'label': N_('Priority'), 
+                         'cls': model.Priority}),
+                   (40, {'name': 'milestone', 'label': N_('Milestone'), 
+                         'cls': model.Milestone, 'optional': True}),
+                   (50, {'name': 'component', 'label': N_('Component'), 
+                         'cls': model.Component}),
+                   (60, {'name': 'version', 'label': N_('Version'), 
+                         'cls': model.Version, 'optional': True}),
+                   (70, {'name': 'severity', 'label': N_('Severity'), 
+                         'cls': model.Severity})]
+        return selects
+
+    def get_radio_fields(self):
+        """Default radio fields"""
+        from trac.ticket import model
+        radios = [(20, {'name': 'status', 'label': N_('Status'),
+                        'cls': model.Status}),
+                  (80, {'name': 'resolution', 'label': N_('Resolution'), 
+                        'cls': model.Resolution})]
+        return radios