diff --git a/doc/development/api/general.rst b/doc/development/api/general.rst index 9e163959a..308de0702 100644 --- a/doc/development/api/general.rst +++ b/doc/development/api/general.rst @@ -45,7 +45,7 @@ Backend .. automodule:: pretix.control.signals :members: nav_event, html_head, html_page_start, quota_detail_html, nav_topbar, nav_global, nav_organizer, nav_event_settings, - order_info, event_settings_widget, oauth_application_registered, order_position_buttons + order_info, event_settings_widget, oauth_application_registered, order_position_buttons, nav_item .. automodule:: pretix.base.signals diff --git a/src/pretix/control/signals.py b/src/pretix/control/signals.py index b6c83923c..de58fb5d3 100644 --- a/src/pretix/control/signals.py +++ b/src/pretix/control/signals.py @@ -237,6 +237,24 @@ As with all plugin signals, the ``sender`` keyword argument will contain the eve A second keyword argument ``request`` will contain the request object. """ +nav_item = EventPluginSignal( + providing_args=['request', 'item'] +) +""" +This signal is sent out to include tab links on the settings page of an item. +Receivers are expected to return a list of dictionaries. The dictionaries +should contain at least the keys ``label`` and ``url``. You should also return +an ``active`` key with a boolean set to ``True``, when this item should be marked +as active. + +If your linked view should stay in the tab-like context of this page, we recommend +that you use ``pretix.control.views.item.ItemDetailMixin`` for your view +and your template inherits from ``pretixcontrol/item/base.html``. + +As with all plugin signals, the ``sender`` keyword argument will contain the event. +A second keyword argument ``request`` will contain the request object. +""" + event_settings_widget = EventPluginSignal( providing_args=['request'] ) diff --git a/src/pretix/control/templates/pretixcontrol/item/base.html b/src/pretix/control/templates/pretixcontrol/item/base.html index fc6a05995..87d785441 100644 --- a/src/pretix/control/templates/pretixcontrol/item/base.html +++ b/src/pretix/control/templates/pretixcontrol/item/base.html @@ -27,6 +27,13 @@ {% trans "Bundled products" %} + {% for n in extra_nav %} +