You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bloodhound.apache.org by rj...@apache.org on 2013/05/30 05:00:23 UTC
svn commit: r1487711 -
/bloodhound/trunk/bloodhound_dashboard/bhdashboard/widgets/templates/widget_grid.html
Author: rjollos
Date: Thu May 30 03:00:23 2013
New Revision: 1487711
URL: http://svn.apache.org/r1487711
Log:
Refs #527: Fix for traceback when rendering `[[Widget(TicketQuery, query="!closed")]]`. The `widget_grid` template can now handle `datetime` objects.
Modified:
bloodhound/trunk/bloodhound_dashboard/bhdashboard/widgets/templates/widget_grid.html
Modified: bloodhound/trunk/bloodhound_dashboard/bhdashboard/widgets/templates/widget_grid.html
URL: http://svn.apache.org/viewvc/bloodhound/trunk/bloodhound_dashboard/bhdashboard/widgets/templates/widget_grid.html?rev=1487711&r1=1487710&r2=1487711&view=diff
==============================================================================
--- bloodhound/trunk/bloodhound_dashboard/bhdashboard/widgets/templates/widget_grid.html (original)
+++ bloodhound/trunk/bloodhound_dashboard/bhdashboard/widgets/templates/widget_grid.html Thu May 30 03:00:23 2013
@@ -103,21 +103,21 @@
</py:when>
<!--! generic fields -->
- <py:when test="col == 'time'">
- <td class="date" py:attrs="td_attrs">${cell.value != '' and format_time(int(cell.value)) or '--'}
+ <py:when test="col == 'time'" py:with="value = int(cell.value) if isinstance(cell.value, str) else cell.value">
+ <td class="date" py:attrs="td_attrs">${cell.value != '' and format_time(value) or '--'}
</td>
</py:when>
-
- <py:when test="col in ('date', 'created', 'modified')">
- <td class="date" py:attrs="td_attrs">${cell.value != '' and format_date(int(cell.value)) or '--'}
+
+ <py:when test="col in ('date', 'created', 'modified')" py:with="value = int(cell.value) if isinstance(cell.value, str) else cell.value">
+ <td class="date" py:attrs="td_attrs">${cell.value != '' and format_date(value) or '--'}
</td>
</py:when>
-
- <py:when test="col == 'datetime'">
- <td class="date" py:attrs="td_attrs">${cell.value != '' and format_datetime(int(cell.value)) or '--'}
+
+ <py:when test="col == 'datetime'" py:with="value = int(cell.value) if isinstance(cell.value, str) else cell.value">
+ <td class="date" py:attrs="td_attrs">${cell.value != '' and format_datetime(value) or '--'}
</td>
</py:when>
-
+
<py:when test="col == 'description'">
<td class="$col" py:attrs="td_attrs" xml:space="preserve">
${wiki_to_html(context(row.resource), cell.value)}