changeset 18:be9653cc4931 draft

Changed the tstodate behaviour and added it to the package and tables
author marga
date Mon, 16 Jul 2007 20:54:29 +0000
parents b0ebc06249b8
children 9724f1833add
files bts_webui/amancay/templates/package.html bts_webui/amancay/templates/table.html bts_webui/amancay/templatetags/template_filters.py
diffstat 3 files changed, 8 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/bts_webui/amancay/templates/package.html
+++ b/bts_webui/amancay/templates/package.html
@@ -1,3 +1,4 @@
+{% load template_filters %}
 {% extends "base.html" %}
 
 {% block title %}Amancay BTS interface - Package View{% endblock %}
@@ -30,7 +31,7 @@
 		<td class="{{ bug.severity }}">
 			<span class="{{ bug.pending }}">{{ bug.pending }}</span>
 		</td>
-		<td class="date">{{ bug.log_modified }}</td>
+		<td class="date">{{ bug.log_modified|tstodate }}</td>
 	</tr>
 	{% endfor %}
 </table>
--- a/bts_webui/amancay/templates/table.html
+++ b/bts_webui/amancay/templates/table.html
@@ -29,7 +29,7 @@
 		<td class="{{ bug.severity }}">
 			<span class="{{ bug.pending }}">{{ bug.pending }}</span>
 		</td>
-		<td class="date">{{ bug.log_modified|tstodate:"%d/%m/%Y"}}</td>
+		<td class="date">{{ bug.log_modified|tstodate}}</td>
 	</tr>
 	{% endfor %}
 </table>
--- a/bts_webui/amancay/templatetags/template_filters.py
+++ b/bts_webui/amancay/templatetags/template_filters.py
@@ -16,10 +16,12 @@
 		if (d.year != now.year):
 			# marga says:
 			return d.strftime("%d/%m/%y")
-		elif (d.month != now.month):
+		elif (d.month != now.month or d.day != now.day):
 			return d.strftime("%b %e")
-		elif (d.day != now.day):
-			return d.strftime("%a %e")
+		#elif (d.month != now.month):
+		#	return d.strftime("%b %e")
+		#elif (d.day != now.day):
+		#	return d.strftime("%a %e")
 		else:
 			return d.strftime("%k:%M")