From 8faa1c9f7dd199a76f342c91d1538e304d377b04 Mon Sep 17 00:00:00 2001 From: Serghei Mihai Date: Thu, 21 May 2015 10:23:46 +0200 Subject: [PATCH] replace context processor by template tag --- src/authentic2_beid/context_processors.py | 4 ---- src/authentic2_beid/templates/beid/login_form.html | 4 ++-- src/authentic2_beid/templates/beid/profile.html | 4 ++-- src/authentic2_beid/templatetags/__init__.py | 0 src/authentic2_beid/templatetags/beid.py | 10 ++++++++++ 5 files changed, 14 insertions(+), 8 deletions(-) delete mode 100644 src/authentic2_beid/context_processors.py create mode 100644 src/authentic2_beid/templatetags/__init__.py create mode 100644 src/authentic2_beid/templatetags/beid.py diff --git a/src/authentic2_beid/context_processors.py b/src/authentic2_beid/context_processors.py deleted file mode 100644 index 29e8467..0000000 --- a/src/authentic2_beid/context_processors.py +++ /dev/null @@ -1,4 +0,0 @@ -from .util import get_x509_url - -def beid_processor(request): - return {'beid_url': get_x509_url(request)} diff --git a/src/authentic2_beid/templates/beid/login_form.html b/src/authentic2_beid/templates/beid/login_form.html index a0b57a6..9a45751 100644 --- a/src/authentic2_beid/templates/beid/login_form.html +++ b/src/authentic2_beid/templates/beid/login_form.html @@ -1,4 +1,4 @@ -{% load i18n %} +{% load i18n beid %}

@@ -7,7 +7,7 @@

{% trans "Please connect the card reader and put your identity card in" %}

-
+
diff --git a/src/authentic2_beid/templates/beid/profile.html b/src/authentic2_beid/templates/beid/profile.html index fcdfa3d..dae1a0d 100644 --- a/src/authentic2_beid/templates/beid/profile.html +++ b/src/authentic2_beid/templates/beid/profile.html @@ -1,4 +1,4 @@ -{% load i18n %} +{% load i18n beid %}

{% trans "Belgian eID card" %}

@@ -24,7 +24,7 @@ {% endfor %}

-

+ diff --git a/src/authentic2_beid/templatetags/__init__.py b/src/authentic2_beid/templatetags/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/authentic2_beid/templatetags/beid.py b/src/authentic2_beid/templatetags/beid.py new file mode 100644 index 0000000..c47561b --- /dev/null +++ b/src/authentic2_beid/templatetags/beid.py @@ -0,0 +1,10 @@ +from django import template + +from authentic2_beid.util import get_x509_url + +register = template.Library() + +@register.simple_tag +def beid_url(request): + print "R: %s" % request + return get_x509_url(request)