def test_is_plugin_active(event): _populate_app_cache() event.plugins = None assert EventPluginSignal._is_active( event, footer_link_test) is False, event.get_plugins() event.plugins = 'tests' assert EventPluginSignal._is_active( event, footer_link_test) is True, event.get_plugins()
def test_is_plugin_active(event): _populate_app_cache() event.plugins = None assert (EventPluginSignal._is_active(event, footer_link_test) is False), event.plugin_list event.plugins = "tests" assert (EventPluginSignal._is_active(event, footer_link_test) is True), event.plugin_list
from django.dispatch import Signal from pretalx.common.signals import EventPluginSignal nav_event = EventPluginSignal() """ This signal allows you to add additional views to the admin panel navigation. You will get the request as a keyword argument ``request``. Receivers are expected to return a list of dictionaries. The dictionaries should contain at least the keys ``label`` and ``url``. You can also return a ForkAwesome icon name with the key ``icon``, it will be respected depending on the type of navigation. You should also return an ``active`` key with a boolean set to ``True``, when this item should be marked as active. The ``request`` object will have an attribute ``event``. If you use this, you should read the documentation on :ref:`how to deal with URLs <urlconf>` in pretalx. As with all plugin signals, the ``sender`` keyword argument will contain the event. """ nav_global = Signal() """ This signal allows you to add additional views to the navigation bar when no event is selected. You will get the request as a keyword argument ``request``. Receivers are expected to return a list of dictionaries. The dictionaries should contain at least the keys ``label`` and ``url``. You can also return a ForkAwesome icon name with the key ``icon``, it will be respected depending on the type of navigation. You should also return an ``active`` key with a boolean set to ``True``, when this item should be marked as active. If you use this, you should read the documentation on :ref:`how to deal with URLs <urlconf>`
from django.dispatch import Signal from pretalx.common.signals import EventPluginSignal nav_event = EventPluginSignal(providing_args=["request"]) """ This signal allows you to add additional views to the admin panel navigation. You will get the request as a keyword argument ``request``. Receivers are expected to return a list of dictionaries. The dictionaries should contain at least the keys ``label`` and ``url``. You can also return a ForkAwesome icon name with the key ``icon``, it will be respected depending on the type of navigation. You should also return an ``active`` key with a boolean set to ``True``, when this item should be marked as active. The ``request`` object will have an attribute ``event``. If you use this, you should read the documentation on :ref:`how to deal with URLs <urlconf>` in pretalx. As with all plugin signals, the ``sender`` keyword argument will contain the event. """ nav_global = Signal(providing_args=["request"]) """ This signal allows you to add additional views to the navigation bar when no event is selected. You will get the request as a keyword argument ``request``. Receivers are expected to return a list of dictionaries. The dictionaries should contain at least the keys ``label`` and ``url``. You can also return a ForkAwesome icon name with the key ``icon``, it will be respected depending on the type of navigation. You should also return an ``active`` key with a boolean set to ``True``, when this item should be marked as active. If you use this, you should read the documentation on :ref:`how to deal with URLs <urlconf>`
from django.dispatch import receiver from pretalx.common.signals import EventPluginSignal, register_data_exporters schedule_release = EventPluginSignal() """ This signal allows you to trigger additional events when a new schedule version is released. You will receive the new schedule and the user triggering the change (if any). Any exceptions raised will be ignored. As with all plugin signals, the ``sender`` keyword argument will contain the event. Additionally, you will receive the keyword arguments ``schedule`` and ``user`` (which may be ``None``). """ @receiver(register_data_exporters, dispatch_uid="exporter_builtin_ical") def register_ical_exporter(sender, **kwargs): from .exporters import ICalExporter return ICalExporter @receiver(register_data_exporters, dispatch_uid="exporter_builtin_xml") def register_xml_exporter(sender, **kwargs): from .exporters import FrabXmlExporter return FrabXmlExporter
from django.dispatch import Signal from pretalx.common.signals import EventPluginSignal nav_event = EventPluginSignal(providing_args=["request"]) """ This signal allows you to add additional views to the admin panel navigation. You will get the request as a keyword argument ``request``. Receivers are expected to return a list of dictionaries. The dictionaries should contain at least the keys ``label`` and ``url``. You can also return a ForkAwesome icon name with the key ``icon``, it will be respected depending on the type of navigation. You should also return an ``active`` key with a boolean set to ``True``, when this item should be marked as active. The ``request`` object will have an attribute ``event``. If you use this, you should read the documentation on :ref:`how to deal with URLs <urlconf>` in pretalx. As with all plugin signals, the ``sender`` keyword argument will contain the event. """ nav_global = Signal(providing_args=["request"]) """ This signal allows you to add additional views to the navigation bar when no event is selected. You will get the request as a keyword argument ``request``. Receivers are expected to return a list of dictionaries. The dictionaries should contain at least the keys ``label`` and ``url``. You can also return a ForkAwesome icon name with the key ``icon``, it will be respected depending on the type of navigation. You should also return an ``active`` key with a boolean set to ``True``, when this item should be marked as active. If you use this, you should read the documentation on :ref:`how to deal with URLs <urlconf>`
from pretalx.common.signals import EventPluginSignal nav_event = EventPluginSignal( providing_args=["request"] ) """ This signal allows you to add additional views to the admin panel navigation. You will get the request as a keyword argument ``request``. Receivers are expected to return a list of dictionaries. The dictionaries should contain at least the keys ``label`` and ``url``. You can also return a ForkAwesome icon name with the key ``icon``, it will be respected depending on the type of navigation. You should also return an ``active`` key with a boolean set to ``True``, when this item should be marked as active. The ``request`` object will have an attribute ``event``. If you use this, you should read the documentation on :ref:`how to deal with URLs <urlconf>` in pretalx. As with all plugin signals, the ``sender`` keyword argument will contain the event. """
from pretalx.common.signals import EventPluginSignal footer_link = EventPluginSignal() """ This signal allows you to add links to the footer of an event page. You 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. Additionally, the signal will be called with the ``request`` it is processing. """ cfp_steps = EventPluginSignal() """ This signal allows you to add CfP steps of your own. This signal will expect a list of ``pretalx.cfp.flow.BaseCfPStep`` objects. The integration of CfP steps in the CfP workflow is currently considered **unstable** and may change without notice between versions. As with all plugin signals, the ``sender`` keyword argument will contain the event. Additionally, the signal will be called with the ``request`` it is processing. """ html_above_submission_list = EventPluginSignal() """ This signal is sent out to display additional information on the personal user submission list page, above the submission list. As with all plugin signals, the ``sender`` keyword argument will contain the event. Additionally, the signal will be called with the ``request`` it is processing. Thereceivers are expected to return HTML. """
from pretalx.common.signals import EventPluginSignal register_recording_provider = EventPluginSignal() """ This signal is sent out to gather all known recording providers. Receivers should return a subclass of pretalx.agenda.recording.BaseRecordingProvider. As with all event plugin signals, the ``sender`` keyword argument will contain the event. """
from django.dispatch import Signal from pretalx.common.signals import EventPluginSignal nav_event = EventPluginSignal(providing_args=["request"]) """ This signal allows you to add additional views to the admin panel navigation. You will get the request as a keyword argument ``request``. Receivers are expected to return a list of dictionaries. The dictionaries should contain at least the keys ``label`` and ``url``. You can also return a ForkAwesome icon name with the key ``icon``, it will be respected depending on the type of navigation. You should also return an ``active`` key with a boolean set to ``True``, when this item should be marked as active. The ``request`` object will have an attribute ``event``. If you use this, you should read the documentation on :ref:`how to deal with URLs <urlconf>` in pretalx. As with all plugin signals, the ``sender`` keyword argument will contain the event. """ nav_global = Signal(providing_args=["request"]) """ This signal allows you to add additional views to the navigation bar when no event is selected. You will get the request as a keyword argument ``request``. Receivers are expected to return a list of dictionaries. The dictionaries should contain at least the keys ``label`` and ``url``. You can also return a ForkAwesome icon name with the key ``icon``, it will be respected depending on the type of navigation. You should also return an ``active`` key with a boolean set to ``True``, when this item should be marked as active. If you use this, you should read the documentation on :ref:`how to deal with URLs <urlconf>`
from pretalx.common.signals import EventPluginSignal footer_link = EventPluginSignal( providing_args=["request"] ) """ This signal allows you to add links to the footer of an event page. You 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. """
from pretalx.common.signals import EventPluginSignal register_recording_provider = EventPluginSignal(providing_args=[]) """ This signal is sent out to gather all known recording providers. Receivers should return a subclass of pretalx.agenda.recording.BaseRecordingProvider. As with all event plugin signals, the ``sender`` keyword argument will contain the event. """
from pretalx.common.signals import EventPluginSignal submission_state_change = EventPluginSignal( providing_args=["submission", "old_state", "user"]) """ This signal allows you to trigger additional events when a submission changes its state. You will receive the submission after it has been saved, the previous state, and the user triggering the change if available. Any exceptions raised will be ignored. As with all plugin signals, the ``sender`` keyword argument will contain the event. """
from pretalx.common.signals import EventPluginSignal register_mail_placeholders = EventPluginSignal() """ This signal is sent out to get all known email text placeholders. Receivers should return an instance of a subclass of pretalx.mail.placeholder.BaseMailTextPlaceholder or a list of these. As with all event-plugin signals, the ``sender`` keyword argument will contain the event. """
# from pretix.base.signals import logentry_display, event_copy_data # from pretix.control.signals import html_head, nav_event # from pretix.multidomain.urlreverse import eventreverse # from pretix.presale.signals import ( # footer_link, front_page_bottom, html_head as html_head_presale, checkout_confirm_messages # ) from pretalx.cfp.signals import footer_link from pretalx.common.signals import EventPluginSignal from pretalx.event.models import Event from pretalx.orga.signals import nav_event from .models import Page front_page_bottom = EventPluginSignal( providing_args=[] ) @receiver(nav_event, dispatch_uid="pages_nav") def control_nav_pages(sender, request=None, **kwargs): print('in control nav pages') if not request.user.has_perm('orga.change_settings', request.event): return [] url = resolve(request.path_info) return [ { 'label': _('Pages'), 'url': reverse('plugins:pretalx_pages:index', kwargs={ 'event': request.event.slug, }),
from pretalx.common.signals import EventPluginSignal footer_link = EventPluginSignal(providing_args=["request"]) """ This signal allows you to add links to the footer of an event page. You 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. """ cfp_steps = EventPluginSignal(providing_args=["request"]) """ This signal allows you to add CfP steps of your own. This signal will expect a list of ``pretalx.cfp.flow.BaseCfPStep`` objects. The integration of CfP steps in the CfP workflow is currently considered **unstable** and may change without notice between versions. """ html_above_submission_list = EventPluginSignal(providing_args=["request"]) """ This signal is sent out to display additional information on the personal user submission list page, above the submission list. As with all plugin signals, the ``sender`` keyword argument will contain the event. The receivers are expected to return HTML. """ html_above_profile_page = EventPluginSignal(providing_args=["request"]) """ This signal is sent out to display additional information on the personal user profile page, above the submission list.
from pretalx.common.signals import EventPluginSignal submission_state_change = EventPluginSignal( providing_args=['submission', 'old_state', 'user']) """ This signal allows you to trigger additional events when a submission changes its state. You will receive the submission after it has been saved, the previous state, and the user triggering the change if available. Any exceptions raised will be ignored. As with all plugin signals, the ``sender`` keyword argument will contain the event. """