Astonishingly, the great jinja2 does not provide a builtin urlquote filter,
although it is obviously needed. (jina1 had one) This is:
https://github.com/mitsuhiko/jinja2/issues/17
Provide an urlencode filter, based on werkzeug's url_quote_plus function.
This is dead easy to implement and gives us all the freedom we want.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
from math import ceil
import jinja2
from babel.localedata import exists
+from werkzeug.urls import url_quote_plus
+
from mediagoblin import mg_globals
from mediagoblin import messages
from mediagoblin.tools import common
template_env.globals['app_config'] = mg_globals.app_config
template_env.globals['global_config'] = mg_globals.global_config
+ template_env.filters['urlencode'] = url_quote_plus
+
if exists(locale):
SETUP_JINJA_ENVS[locale] = template_env