Added hook for links in the footer

This commit is contained in:
Raphael Michel
2016-06-14 13:05:47 +02:00
parent 1bdf332afd
commit 0c4368170f
4 changed files with 21 additions and 1 deletions

View File

@@ -1,7 +1,7 @@
from django.conf import settings
from django.core.urlresolvers import Resolver404, resolve
from .signals import html_head
from .signals import footer_link, html_head
def contextprocessor(request):
@@ -18,10 +18,14 @@ def contextprocessor(request):
ctx = {
}
_html_head = []
_footer = []
if hasattr(request, 'event'):
for receiver, response in html_head.send(request.event, request=request):
_html_head.append(response)
for receiver, response in footer_link.send(request.event, request=request):
_footer.append(response)
ctx['html_head'] = "".join(_html_head)
ctx['footer'] = _footer
ctx['site_url'] = settings.SITE_URL
return ctx

View File

@@ -7,6 +7,13 @@ html_head = EventPluginSignal(
providing_args=["request"]
)
"""
This signal is sent out to include links in the footer
"""
footer_link = EventPluginSignal(
providing_args=["request"]
)
"""
This signal is sent out to retrieve pages for the checkout flow
"""

View File

@@ -58,4 +58,8 @@
<a href="{{ request.event.settings.imprint_url }}" target="_blank">{% trans "Imprint" %}</a>
&middot;
{% endif %}
{% for f in footer %}
<a href="{{ f.url }}" target="_blank">{{ f.label }}</a>
&middot;
{% endfor %}
{% endblock %}