incubator-bloodhound-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Apache Bloodhound" <bloodhound-...@incubator.apache.org>
Subject Re: [Apache Bloodhound] #93: Converting dashboard views to new template
Date Tue, 19 Jun 2012 04:21:57 GMT
#93: Converting dashboard views to new template
--------------------------+----------------------
  Reporter:  gjm          |      Owner:  olemis
      Type:  enhancement  |     Status:  accepted
  Priority:  major        |  Milestone:
 Component:  dashboard    |    Version:
Resolution:               |   Keywords:
--------------------------+----------------------

Comment (by olemis):

 Replying to [comment:21 gjm]:
 > As a quick hack, I have just been trying the following to modify the
 links provided by the {{{TicketFieldValuesWidget}}} for lists of
 milestones so that they go direct to the relevant page instead of the
 query.
 >

 Though I think it will be better this way ...

 {{{
 #!diff
 Index: bhdashboard/widgets/ticket.py
 ===================================================================
 --- bhdashboard/widgets/ticket.py       (revision 1351306)
 +++ bhdashboard/widgets/ticket.py       (working copy)
 @@ -198,12 +198,18 @@
              item_link= lambda item: query_href + \
                      '&' + urlencode([(fieldnm, item[0])])

 +        def dash_item_link(item):
 +            if item[0]:
 +                return req.href(fieldnm, item[0])
 +
          return 'widget_cloud.html', \
                  {
                      'title' : title,
                      'data' : dict(
                              bounds=minmax(items, lambda x: x[1]),
 -                            item_link= item_link,
 +                            item_link= dash_item_link if fieldnm in
 ('milestone',) else item_link,
                              heading=_(fieldnm.capitalize()),
                              items=items,
                              verbose=verbose,
 }}}


 You know , something like that . The idea is avoid calling `item_link`
 inside `dash_item_link` . The `if` statement and associated check should
 also be redundant . Hence that way it should be more efficient . Further
 enhancements still possible ''';)'''

-- 
Ticket URL: <https://issues.apache.org/bloodhound/ticket/93#comment:23>
Apache Bloodhound <https://issues.apache.org/bloodhound/>
The Apache Bloodhound (incubating) issue tracker

Mime
View raw message