Commits

Olemis Lang committed c0e482b

BH Theme #234: Config options for QCT fields. Description field added ( comment:6:ticket:234 )

Comments (0)

Files changed (4)

-t234/t234_r1419753_qct_link_n_fields.diff
-t234/t234_r1419753_qct_desc.diff
+t234/t234_r1423108_qct_link_n_fields.diff
+t234/t234_r1423108_qct_desc_v2.diff
+#t234/t234_r1419753_qct_desc.diff
 #hgsvn/rm_files.diff

t234/t234_r1423108_qct_desc_v2.diff

+# HG changeset patch
+# Parent 4d0407443d06468cab34804d83041d3c9556bcd8
+BH Theme #234 : Edit description in create ticket shortcut
+
+diff -r 4d0407443d06 bhtheme/htdocs/bloodhound.css
+--- a/bhtheme/htdocs/bloodhound.css	Mon Dec 17 17:00:12 2012 -0500
++++ b/bhtheme/htdocs/bloodhound.css	Mon Dec 17 17:57:26 2012 -0500
+@@ -202,6 +202,10 @@
+   width: 505px;
+ }
+ 
++#qct-fieldset #field-description {
++  width: auto;
++}
++
+ #field-summary {
+   width: 505px;
+ }
+diff -r 4d0407443d06 bhtheme/htdocs/js/theme.js
+--- a/bhtheme/htdocs/js/theme.js	Mon Dec 17 17:00:12 2012 -0500
++++ b/bhtheme/htdocs/js/theme.js	Mon Dec 17 17:57:26 2012 -0500
+@@ -22,8 +22,8 @@
+     var qct_timeout = null;
+ 
+     // Do not close dropdown menu if user interacts with form controls
+-    $('.dropdown-menu input, .dropdown-menu label, .dropdown-menu select')
+-        .click(function (e) { e.stopPropagation(); });
++    $('.dropdown-menu input, .dropdown-menu label, .dropdown-menu select' +
++        ', .dropdown-menu textarea').click(function (e) { e.stopPropagation(); });
+ 
+     // Install popover for create ticket shortcut
+     // Important: Further options specified in markup
+@@ -57,7 +57,7 @@
+ 
+     // Clear input controls inside quick create box
+     function qct_clearui() {
+-      $('#qct-fieldset input, #qct-fieldset select').val('');
++      $('#qct-fieldset input, #qct-fieldset select, #qct-fieldset textarea').val('');
+     }
+ 
+     // We want to submit via #qct-create
+diff -r 4d0407443d06 bhtheme/templates/bloodhound_theme.html
+--- a/bhtheme/templates/bloodhound_theme.html	Mon Dec 17 17:00:12 2012 -0500
++++ b/bhtheme/templates/bloodhound_theme.html	Mon Dec 17 17:57:26 2012 -0500
+@@ -117,9 +117,17 @@
+               </select>
+             </py:def>
+             <py:def function="qct_box()">
+-              <label for="field-summary">Summary</label>
+-              <input type="text" id="field-summary"
+-                  name="field_summary" placeholder="Ticket summary" />
++              <div>
++                <label for="field-summary">Summary</label>
++                <input type="text" id="field-summary"
++                    name="field_summary" placeholder="Ticket summary" />
++              </div>
++              <div>
++                <label for="field-description">Description</label>
++                <textarea id="field-description" name="field_description"
++                    rows="3" cols="28"
++                    placeholder="Ticket description"></textarea>
++              </div>
+               <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
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.