Add signal global_footer_link

This commit is contained in:
Raphael Michel
2021-02-04 17:32:10 +01:00
parent af7d9942f6
commit 5ae7a350b0
3 changed files with 16 additions and 3 deletions

View File

@@ -34,7 +34,7 @@ Frontend
-------- --------
.. automodule:: pretix.presale.signals .. automodule:: pretix.presale.signals
:members: html_head, html_footer, footer_link, front_page_top, front_page_bottom, front_page_bottom_widget, fee_calculation_for_cart, contact_form_fields, question_form_fields, contact_form_fields_overrides, question_form_fields_overrides, checkout_confirm_messages, checkout_confirm_page_content, checkout_all_optional, html_page_header, sass_preamble, sass_postamble, render_seating_plan, checkout_flow_steps, position_info, position_info_top, item_description, global_html_head, global_html_footer, global_html_page_header :members: html_head, html_footer, footer_link, global_footer_link, front_page_top, front_page_bottom, front_page_bottom_widget, fee_calculation_for_cart, contact_form_fields, question_form_fields, contact_form_fields_overrides, question_form_fields_overrides, checkout_confirm_messages, checkout_confirm_page_content, checkout_all_optional, html_page_header, sass_preamble, sass_postamble, render_seating_plan, checkout_flow_steps, position_info, position_info_top, item_description, global_html_head, global_html_footer, global_html_page_header
.. automodule:: pretix.presale.signals .. automodule:: pretix.presale.signals

View File

@@ -14,8 +14,8 @@ from pretix.helpers.i18n import (
from ..base.i18n import get_language_without_region from ..base.i18n import get_language_without_region
from .signals import ( from .signals import (
footer_link, global_html_footer, global_html_head, global_html_page_header, footer_link, global_footer_link, global_html_footer, global_html_head,
html_footer, html_head, html_page_header, global_html_page_header, html_footer, html_head, html_page_header,
) )
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
@@ -65,6 +65,11 @@ def _default_context(request):
_html_head.append(response) _html_head.append(response)
for receiver, response in global_html_footer.send(None, request=request): for receiver, response in global_html_footer.send(None, request=request):
_html_foot.append(response) _html_foot.append(response)
for receiver, response in global_footer_link.send(None, request=request):
if isinstance(response, list):
_footer += response
else:
_footer.append(response)
if hasattr(request, 'event') and get_scope(): if hasattr(request, 'event') and get_scope():
for receiver, response in html_head.send(request.event, request=request): for receiver, response in html_head.send(request.event, request=request):

View File

@@ -105,6 +105,14 @@ are expected to return a dictionary containing the keys ``label`` and ``url``.
As with all plugin signals, the ``sender`` keyword argument will contain the event. As with all plugin signals, the ``sender`` keyword argument will contain the event.
""" """
global_footer_link = Signal(
providing_args=["request"]
)
"""
The signal ``pretix.presale.signals.global_footer_link`` allows you to add links to the footer of any page. You
are expected to return a dictionary containing the keys ``label`` and ``url``.
"""
checkout_confirm_messages = EventPluginSignal() checkout_confirm_messages = EventPluginSignal()
""" """
This signal is sent out to retrieve short messages that need to be acknowledged by the user before the This signal is sent out to retrieve short messages that need to be acknowledged by the user before the