1
0
Fork 0
mirror of https://github.com/Kunsi/pretalx-plugin-broadcast-tools synced 2024-11-25 04:41:03 +00:00
pretalx-plugin-broadcast-tools/pretalx_lower_thirds/signals.py

25 lines
768 B
Python
Raw Normal View History

from django.dispatch import receiver
from django.urls import resolve, reverse
from django.utils.translation import ugettext_lazy as _
from pretalx.orga.signals import nav_event_settings
@receiver(nav_event_settings)
def navbar_info(sender, request, **kwargs):
url = resolve(request.path_info)
2021-11-21 07:06:35 +00:00
if not request.user.has_perm("orga.change_settings", request.event):
return []
2021-11-21 07:06:35 +00:00
return [
{
"label": _("lower thirds"),
"url": reverse(
"plugins:pretalx_lower_thirds:orga",
kwargs={
"event": request.event.slug,
},
),
"active": url.namespace == "plugins:pretalx_lower_thirds"
and url.url_name == "orga",
}
]