mirror of
https://github.com/pretix/pretix.git
synced 2026-05-06 15:24:02 +00:00
Added hook for links in the footer
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
"""
|
||||
|
||||
@@ -58,4 +58,8 @@
|
||||
<a href="{{ request.event.settings.imprint_url }}" target="_blank">{% trans "Imprint" %}</a>
|
||||
·
|
||||
{% endif %}
|
||||
{% for f in footer %}
|
||||
<a href="{{ f.url }}" target="_blank">{{ f.label }}</a>
|
||||
·
|
||||
{% endfor %}
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user