aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/tools/template.py
diff options
context:
space:
mode:
authorJessica T <xray7224@googlemail.com>2013-04-11 22:37:48 +0100
committerJessica T <xray7224@googlemail.com>2013-04-11 22:37:48 +0100
commitf1c3807db73adcc5eb817d693d160386f87bb15b (patch)
tree9cc05c5aeadf7369c7639eb78a10983f1ab525fe /mediagoblin/tools/template.py
parent71ef20078cc061317eaf42f20bdc905bcce3ab2a (diff)
downloadmediagoblin-f1c3807db73adcc5eb817d693d160386f87bb15b.tar.lz
mediagoblin-f1c3807db73adcc5eb817d693d160386f87bb15b.tar.xz
mediagoblin-f1c3807db73adcc5eb817d693d160386f87bb15b.zip
Adds the timesince ability which fixes #394
Diffstat (limited to 'mediagoblin/tools/template.py')
-rw-r--r--mediagoblin/tools/template.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/mediagoblin/tools/template.py b/mediagoblin/tools/template.py
index 74d811eb..78d65654 100644
--- a/mediagoblin/tools/template.py
+++ b/mediagoblin/tools/template.py
@@ -29,9 +29,11 @@ from mediagoblin import _version
from mediagoblin.tools import common
from mediagoblin.tools.translate import get_gettext_translation
from mediagoblin.tools.pluginapi import get_hook_templates
+from mediagoblin.tools.timesince import timesince
from mediagoblin.meddleware.csrf import render_csrf_form_token
+
SETUP_JINJA_ENVS = {}
@@ -73,6 +75,9 @@ def get_jinja_env(template_loader, locale):
template_env.filters['urlencode'] = url_quote_plus
+ # add human readable fuzzy date time
+ template_env.globals['timesince'] = timesince
+
# allow for hooking up plugin templates
template_env.globals['get_hook_templates'] = get_hook_templates