Author: gjm
Date: Tue Jun 19 16:16:48 2012
New Revision: 1351761
URL: http://svn.apache.org/viewvc?rev=1351761&view=rev
Log:
dashboard: provides mechanism for substituting links to objects, adjusts
heading use and adds versions and milestones to dashboard view - towards #93
Modified:
incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/web_ui.py
incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/widgets/templates/widget_cloud.html
incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/widgets/ticket.py
Modified: incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/web_ui.py
URL:
http://svn.apache.org/viewvc/incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/web_ui.py?rev=1351761&r1=1351760&r2=1351761&view=diff
==============================================================================
--- incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/web_ui.py
(original)
+++ incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/web_ui.py Tue
Jun 19 16:16:48 2012
@@ -139,25 +139,46 @@ class DashboardModule(Component):
'div' : [
{
'_class' : 'span8',
- 'widgets' : [3, 2, 0]
+ 'widgets' : ['my tickets', 'active
tickets',
+ 'versions', 'milestones',
+ 'components']
},
{
'_class' : 'span4',
- 'widgets' : [1]
+ 'widgets' : ['activity']
}
]
}
],
'widgets' : {
- 0: {
+ 'components': {
'args' : [
'TicketFieldValues',
None,
{'args' : {
'field' : 'component',
+ 'title' : 'Components',
'verbose' : True}}]
},
- 2: {
+ 'milestones': {
+ 'args' : [
+ 'TicketFieldValues',
+ None,
+ {'args' : {
+ 'field' : 'milestone',
+ 'title' : 'Milestones',
+ 'verbose' : True}}]
+ },
+ 'versions': {
+ 'args' : [
+ 'TicketFieldValues',
+ None,
+ {'args' : {
+ 'field' : 'version',
+ 'title' : 'Versions',
+ 'verbose' : True}}]
+ },
+ 'active tickets': {
'args' : [
'TicketQuery',
None,
@@ -170,7 +191,7 @@ class DashboardModule(Component):
'title' : 'Active Tickets'}}],
'altlinks' : False
},
- 3: {
+ 'my tickets': {
'args' : [
'TicketQuery',
None,
@@ -185,7 +206,7 @@ class DashboardModule(Component):
}],
'altlinks' : False
},
- 1: {
+ 'activity': {
'args' : ['Timeline', None, {'args' : {}}]
},
}
Modified:
incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/widgets/templates/widget_cloud.html
URL:
http://svn.apache.org/viewvc/incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/widgets/templates/widget_cloud.html?rev=1351761&r1=1351760&r2=1351761&view=diff
==============================================================================
---
incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/widgets/templates/widget_cloud.html
(original)
+++
incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/widgets/templates/widget_cloud.html
Tue Jun 19 16:16:48 2012
@@ -25,8 +25,10 @@
</span>
</py:def>
+ <py:if test="heading is not None">
<h3 style="display: inline;">$heading</h3>
<br/>
+ </py:if>
<py:if test="_view != view">
<xi:include href="widget_alert.html"
py:with="msglabel = 'Warning'; msgbody = 'Unknown view ' + view" />
Modified:
incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/widgets/ticket.py
URL:
http://svn.apache.org/viewvc/incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/widgets/ticket.py?rev=1351761&r1=1351760&r2=1351761&view=diff
==============================================================================
---
incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/widgets/ticket.py
(original)
+++
incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/widgets/ticket.py
Tue Jun 19 16:16:48 2012
@@ -49,6 +49,9 @@ class TicketFieldValuesWidget(WidgetBase
"""Display a tag cloud representing frequency of values assigned to
ticket fields.
"""
+ DASH_ITEM_HREF_MAP = {'milestone': ('milestone',),
+ }
+
def get_widget_params(self, name):
"""Return a dictionary containing arguments specification for
the widget with specified name.
@@ -198,13 +201,28 @@ class TicketFieldValuesWidget(WidgetBase
item_link= lambda item: query_href + \
'&' + urlencode([(fieldnm, item[0])])
+ if fieldnm in self.DASH_ITEM_HREF_MAP:
+ def dash_item_link(item):
+ if item[0]:
+ args = self.DASH_ITEM_HREF_MAP[fieldnm] + (item[0],)
+ return req.href(*args)
+ else:
+ return item_link(item)
+ else:
+ dash_item_link = item_link
+
+ if title is None:
+ heading = _(fieldnm.capitalize())
+ else:
+ heading = None
+
return 'widget_cloud.html', \
{
'title' : title,
'data' : dict(
bounds=minmax(items, lambda x: x[1]),
- item_link= item_link,
- heading=_(fieldnm.capitalize()),
+ item_link=dash_item_link,
+ heading=heading,
items=items,
verbose=verbose,
view=view,