replace context processor by template tag

This commit is contained in:
Serghei Mihai 2015-05-21 10:23:46 +02:00
parent 66a732972f
commit 8faa1c9f7d
5 changed files with 14 additions and 8 deletions

View File

@ -1,4 +0,0 @@
from .util import get_x509_url
def beid_processor(request):
return {'beid_url': get_x509_url(request)}

View File

@ -1,4 +1,4 @@
{% load i18n %}
{% load i18n beid %}
<div id="login-ssl">
<p>
@ -7,7 +7,7 @@
<p>
{% trans "Please connect the card reader and put your identity card in" %}
</p>
<form id='beid_login' action='{{ beid_url }}{% url "beid_signin" %}'>
<form id='beid_login' action='{% beid_url request %}{% url "beid_signin" %}'>
<input type="submit" name="{{ submit_name }}" value="{% trans "Log in" %}"/>
</form>
</div>

View File

@ -1,4 +1,4 @@
{% load i18n %}
{% load i18n beid %}
<h4 id="a2-beid-certificate-profile" class="a2-bied-certificate-profile-title">
{% trans "Belgian eID card" %}
</h4>
@ -24,7 +24,7 @@
{% endfor %}
</ul>
<p>
<form action="{{ beid_url }}{% url "add_beid" %}" method="get">
<form action="{% beid_url request %}{% url "add_beid" %}" method="get">
<label for="id_del_cert">{% trans "Have a belgian eID card?" %}</label>
<input type="hidden" name="next" value="{% url "account_management" %}#a2-beid-certificate-profile" />
<input type="submit" class="submit-button a2-ssl-certificate-submit-button" value="{% trans "Link it to your account" %}">

View File

@ -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)