Index: web_ui.py =================================================================== --- web_ui.py (revision 7289) +++ web_ui.py (working copy) @@ -21,6 +21,7 @@ import re from StringIO import StringIO import time +import urllib from genshi.core import Markup from genshi.builder import tag @@ -105,7 +106,14 @@ If set to 'default', this is equivalent to 'yes' for new environments but keeps the old behavior for upgraded environments (i.e. 'no'). (''since 0.11'').""") + + query_args = Option('autoquery', 'query_args', default='&order=priority', + doc="additional arguments to the query string") + excluded_fields = Option('autoquery', 'excluded_fields', + default=['estimatedhours', 'hours', 'totalhours'], + doc="fields to exclude from AutoQuery markup") + # IContentConverter methods def get_supported_conversions(self): @@ -557,10 +565,23 @@ if preserve_newlines == 'default': preserve_newlines = self.env.get_version(initial=True) >= 21 # 0.11 preserve_newlines = preserve_newlines in _TRUE_VALUES + + query = self.env.href() + '/query?%s=%s' + self.query_args + def query_link(x, y): + try: + y = urllib.quote_plus(y) + except KeyError: + # XXX work around bug with urllib + unicode + # see http://trac-hacks.org/ticket/3157 + y = y.replace(' ', '+') + return query % ( x, y ) + return {'ticket': ticket, 'context': Context.from_request(req, ticket.resource, absurls=absurls), - 'preserve_newlines': preserve_newlines} + 'preserve_newlines': preserve_newlines, + 'query_link': query_link, + 'excluded_fields': self.excluded_fields } def _toggle_cc(self, req, cc): """Return an (action, recipient) tuple corresponding to a change Index: templates/ticket.html =================================================================== --- templates/ticket.html (revision 7289) +++ templates/ticket.html (working copy) @@ -135,9 +135,16 @@ not in ('type', 'owner')]"> Reported by: - ${authorinfo(ticket.reporter)} + + + ${authorinfo(ticket.reporter)} + + Owned by: - ${ticket.owner and authorinfo(ticket.owner) or ''} + + + ${ticket.owner and authorinfo(ticket.owner) or ''} + ${field.rendered} - ${ticket[field.name]} + + + + + ${ticket[field.name]} + + + + ${ticket[field.name]} + + +