mirror of
https://github.com/Kunsi/pretalx-plugin-broadcast-tools
synced 2025-06-07 10:02:23 +00:00
rename plugin to 'pretalx_broadcast_tools'
This commit is contained in:
parent
7c5e58023c
commit
213db3f640
17 changed files with 81 additions and 82 deletions
36
pretalx_broadcast_tools/signals.py
Normal file
36
pretalx_broadcast_tools/signals.py
Normal file
|
@ -0,0 +1,36 @@
|
|||
from django.dispatch import receiver
|
||||
from django.urls import resolve, reverse
|
||||
from django.utils.translation import gettext_noop
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from i18nfield.strings import LazyI18nString
|
||||
from pretalx.common.models.settings import hierarkey
|
||||
from pretalx.orga.signals import nav_event_settings
|
||||
|
||||
hierarkey.add_default(
|
||||
"lower_thirds_no_talk_info",
|
||||
LazyI18nString.from_gettext(
|
||||
gettext_noop("Sorry, there's currently no talk running")
|
||||
),
|
||||
LazyI18nString,
|
||||
)
|
||||
hierarkey.add_default("lower_thirds_info_string", "", LazyI18nString)
|
||||
|
||||
|
||||
@receiver(nav_event_settings)
|
||||
def navbar_info(sender, request, **kwargs):
|
||||
url = resolve(request.path_info)
|
||||
if not request.user.has_perm("orga.change_settings", request.event):
|
||||
return []
|
||||
return [
|
||||
{
|
||||
"label": _("lower thirds"),
|
||||
"url": reverse(
|
||||
"plugins:pretalx_broadcast_tools:orga",
|
||||
kwargs={
|
||||
"event": request.event.slug,
|
||||
},
|
||||
),
|
||||
"active": url.namespace == "plugins:pretalx_broadcast_tools"
|
||||
and url.url_name == "orga",
|
||||
}
|
||||
]
|
Loading…
Add table
Add a link
Reference in a new issue