2023-12-13 23:58:00 +01:00
|
|
|
from django.dispatch import receiver
|
|
|
|
from django.urls import reverse
|
|
|
|
from pretalx.orga.signals import nav_event_settings
|
|
|
|
|
|
|
|
|
|
|
|
@receiver(nav_event_settings)
|
|
|
|
def pretalx_musicrate_settings(sender, request, **kwargs):
|
|
|
|
if not request.user.has_perm("orga.change_settings", request.event):
|
|
|
|
return []
|
|
|
|
return [
|
|
|
|
{
|
2023-12-14 19:36:50 +01:00
|
|
|
"label": "pretalx-musicrate",
|
2023-12-13 23:58:00 +01:00
|
|
|
"url": reverse(
|
|
|
|
"plugins:pretalx_musicrate:settings",
|
|
|
|
kwargs={"event": request.event.slug},
|
|
|
|
),
|
|
|
|
"active": request.resolver_match.url_name
|
|
|
|
== "plugins:pretalx_musicrate:settings",
|
|
|
|
}
|
|
|
|
]
|