From b6dc2661ae88380e8591419152b139e05726723e Mon Sep 17 00:00:00 2001 From: Tobias Kunze Date: Sat, 8 Oct 2016 15:53:01 +0200 Subject: [PATCH] Add signal to display html in quota detail view (#264) --- doc/development/api/general.rst | 2 +- src/pretix/control/signals.py | 10 ++++++++++ .../control/templates/pretixcontrol/items/quota.html | 2 ++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/doc/development/api/general.rst b/doc/development/api/general.rst index 193421d648..2a325115fd 100644 --- a/doc/development/api/general.rst +++ b/doc/development/api/general.rst @@ -47,7 +47,7 @@ Backend ------- .. automodule:: pretix.control.signals - :members: nav_event, html_head + :members: nav_event, html_head, quota_detail_html .. automodule:: pretix.base.signals diff --git a/src/pretix/control/signals.py b/src/pretix/control/signals.py index 650a488cdd..e9186e776e 100644 --- a/src/pretix/control/signals.py +++ b/src/pretix/control/signals.py @@ -94,3 +94,13 @@ You will receive the default form class (or the class set by a previous plugin) As with all plugin signals, the ``sender`` keyword argument will contain the event. """ + +quota_detail_html = EventPluginSignal( + providing_args=['quota'] +) +""" +This signal allows you to append HTML to a Quota's detail view. You receive the +quota as argument in the ``quota`` keyword argument. + +As with all plugin signals, the ``sender`` keyword argument will contain the event. +""" diff --git a/src/pretix/control/templates/pretixcontrol/items/quota.html b/src/pretix/control/templates/pretixcontrol/items/quota.html index a08b0cfa20..1a1a9dba41 100644 --- a/src/pretix/control/templates/pretixcontrol/items/quota.html +++ b/src/pretix/control/templates/pretixcontrol/items/quota.html @@ -1,6 +1,7 @@ {% extends "pretixcontrol/items/base.html" %} {% load i18n %} {% load bootstrap3 %} +{% load eventsignal %} {% block title %}{% blocktrans with name=quota.name %}Quota: {{ name }}{% endblocktrans %}{% endblock %} {% block inside %}

@@ -54,4 +55,5 @@ + {% eventsignal request.event "pretix.control.signals.quota_detail_html" quota=quota %} {% endblock %}