1. Olemis Lang
  2. bloodhound_theme-mq

Commits

Olemis Lang  committed 3fab456

BH Theme #234 : Quick create ticket (select) fields as config options

  • Participants
  • Parent commits c0e482b
  • Branches t234_qct_desc

Comments (0)

Files changed (2)

File t234/t234_r1423108_qct_desc_v2.diff

View file
  • Ignore whitespace
                <div class="form-horizontal">
                  <py:for each="field in qct.fields">
                    <label class="control-label" for="field-${field.name}">${field.label}</label>
-diff -r 4d0407443d06 bhtheme/theme.py
---- a/bhtheme/theme.py	Mon Dec 17 17:00:12 2012 -0500
-+++ b/bhtheme/theme.py	Mon Dec 17 17:57:26 2012 -0500
-@@ -21,6 +21,7 @@
- from genshi.filters.transform import Transformer
- 
- from trac.core import *
-+from trac.config import ListOption
- from trac.mimeview.api import get_mimetype
- from trac.resource import Resource
- from trac.ticket.api import TicketSystem
-@@ -323,7 +324,9 @@
- class QuickCreateTicketDialog(Component):
-     implements(IRequestFilter, IRequestHandler)
- 
--    qct_fields = ('product', 'version', 'type')
-+    qct_fields = ListOption('ticket', 'shortcut_fields', 
-+                            'product,version,type',
-+        doc="""Multiple selection fields displayed in create ticket menu""")
- 
-     # IRequestFilter(Interface):
- 
-@@ -348,7 +351,8 @@
-             ticket = Ticket(self.env)
-             tm._populate(fakereq, ticket, False)
-             all_fields = dict([f['name'], f] \
--                              for f in tm._prepare_fields(fakereq, ticket))
-+                              for f in tm._prepare_fields(fakereq, ticket) \
-+                              if f['type'] == 'select')
-             data['qct'] = {'fields': [all_fields[k] for k in self.qct_fields
-                                       if k in all_fields]}
-         return template, data, content_type