You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bloodhound.apache.org by gj...@apache.org on 2012/04/01 03:09:29 UTC
svn commit: r1307973 - in
/incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard:
templates/bootstrap_two_col_2_1.html web_ui.py widgets/report.py
widgets/templates/widget_grid.html
Author: gjm
Date: Sun Apr 1 01:09:29 2012
New Revision: 1307973
URL: http://svn.apache.org/viewvc?rev=1307973&view=rev
Log:
Dashboard code import: BH_Dashboard: TicketsReportWidget: Updated header, report page index, ctxtnav links
Modified:
incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/templates/bootstrap_two_col_2_1.html
incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/web_ui.py
incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/widgets/report.py
incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/widgets/templates/widget_grid.html
Modified: incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/templates/bootstrap_two_col_2_1.html
URL: http://svn.apache.org/viewvc/incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/templates/bootstrap_two_col_2_1.html?rev=1307973&r1=1307972&r2=1307973&view=diff
==============================================================================
--- incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/templates/bootstrap_two_col_2_1.html (original)
+++ incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/templates/bootstrap_two_col_2_1.html Sun Apr 1 01:09:29 2012
@@ -7,21 +7,15 @@
<xi:include href="layout.html" />
<head>
<title>$title</title>
- <style py:if="default.height is not None">
- .ui-box-panel {
- max-height:${default.height}px !important;
- overflow: auto;
- }
- </style>
- <style>
- .ui-box {
- margin: 10px;
- }
- </style>
</head>
<div py:def="widget_container(w)" role="application">
- <h1>${w.title}</h1>
+ <h1 style="display: inline;">${w.title}</h1>
+ <py:if test="w.ctxtnav">
+ <py:for each="itm in w.ctxtnav">
+ $itm
+ </py:for>
+ </py:if>
<br/>
${w.content}
</div>
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=1307973&r1=1307972&r2=1307973&view=diff
==============================================================================
--- incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/web_ui.py (original)
+++ incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/web_ui.py Sun Apr 1 01:09:29 2012
@@ -121,6 +121,7 @@ class DashboardModule(Component):
render = chrome.render_template
data_strm = (w['c'].render_widget(*w['args']) for w in widgets_spec)
return [{'title' : data['title'],
- 'content' : render(req, template, data['data'], fragment=True)} \
- for template, data, _ in data_strm]
+ 'content' : render(wctx.req, template, data['data'], fragment=True),
+ 'ctxtnav' : data.get('ctxtnav')} \
+ for template, data, wctx in data_strm]
Modified: incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/widgets/report.py
URL: http://svn.apache.org/viewvc/incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/widgets/report.py?rev=1307973&r1=1307972&r2=1307973&view=diff
==============================================================================
--- incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/widgets/report.py (original)
+++ incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/widgets/report.py Sun Apr 1 01:09:29 2012
@@ -29,6 +29,7 @@ from itertools import imap, islice
from genshi.builder import tag
from trac.core import implements, TracError
+from trac.mimeview.api import Context
from trac.resource import ResourceNotFound
from trac.ticket.report import ReportModule
from trac.util.translation import _
@@ -94,12 +95,18 @@ class TicketReportWidget(WidgetBase):
raise
else:
title = data.get('title', '%s {%s}' % (_('Report'), rptid))
+ rptctx = Context.from_request(fakereq, 'report', rptid)
return 'widget_grid.html', \
{
- 'title' : tag.a(title, href=req.href('report', rptid)),
- 'data' : data
+ 'title' : title,
+ 'data' : data,
+ 'ctxtnav' : [
+ tag.a(_('More'), href=req.href('report', rptid)),
+ ('REPORT_MODIFY' in req.perm(rptctx.resource)) and \
+ tag.a(_('Edit'), href=req.href('report', rptid, action='edit')) or None,
+ ]
}, \
- context('report', rptid)
+ rptctx
render_widget = pretty_wrapper(render_widget, check_widget_name)
Modified: incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/widgets/templates/widget_grid.html
URL: http://svn.apache.org/viewvc/incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/widgets/templates/widget_grid.html?rev=1307973&r1=1307972&r2=1307973&view=diff
==============================================================================
--- incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/widgets/templates/widget_grid.html (original)
+++ incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/widgets/templates/widget_grid.html Sun Apr 1 01:09:29 2012
@@ -9,10 +9,10 @@
</div -->
<py:choose test="">
<div py:when="paginator.has_more_pages">
- <h2 class="report-result">
+ <div class="report-result" style="float: left; margin-right: 1.6em;">
Results <span class="numresults">(${paginator.displayed_items()})</span>
- </h2>
- <!-- xi:include href="page_index.html" / -->
+ </div>
+ <xi:include href="page_index.html" />
</div>
<div py:when="numrows" class="numrows">($numrows total rows)</div>
</py:choose>