Repository :
http://git.fedorahosted.org/cgit/fedocal.git
On branch : master
---------------------------------------------------------------
commit 90eb862731c7296fb651c593f501195bc00acf40
Author: Pierre-Yves Chibon <pingou(a)pingoured.fr>
Date: Tue Nov 6 19:41:21 2012 +0100
Add a template filter to display the week heading correctly
---------------------------------------------------------------
fedocal/__init__.py | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/fedocal/__init__.py b/fedocal/__init__.py
index 89eda91..053ef7c 100644
--- a/fedocal/__init__.py
+++ b/fedocal/__init__.py
@@ -63,6 +63,16 @@ def inject_calendars():
return dict(calendars=calendars)
+
+(a)APP.template_filter('WeekHeading')
+def reverse_filter(weekdays):
+ """ Template filter returning the heading string which is located in
+ between the two navigation buttons on the agenda template.
+ """
+ return "%s - %s" % (weekdays[0].strftime('%d %b'),
+ weekdays[-1].strftime('%d %b %Y'))
+
+
def is_admin():
""" Return wether the user is admin for this application or not.
"""
if not flask.g.fas_user: