2021-11-20 16:46:05 +00:00
|
|
|
from django.dispatch import receiver
|
|
|
|
from django.urls import resolve, reverse
|
2023-06-03 21:07:34 +00:00
|
|
|
from django.utils.translation import gettext_lazy as _
|
2023-08-23 06:11:19 +00:00
|
|
|
from django.utils.translation import gettext_noop
|
2021-11-21 12:07:19 +00:00
|
|
|
from i18nfield.strings import LazyI18nString
|
|
|
|
from pretalx.common.models.settings import hierarkey
|
2022-10-22 16:07:40 +00:00
|
|
|
from pretalx.common.signals import register_data_exporters
|
2021-11-20 16:46:05 +00:00
|
|
|
from pretalx.orga.signals import nav_event_settings
|
|
|
|
|
2021-11-21 12:07:19 +00:00
|
|
|
hierarkey.add_default(
|
2022-11-07 03:21:53 +00:00
|
|
|
"broadcast_tools_lower_thirds_no_talk_info",
|
2021-11-21 12:07:19 +00:00
|
|
|
LazyI18nString.from_gettext(
|
|
|
|
gettext_noop("Sorry, there's currently no talk running")
|
|
|
|
),
|
|
|
|
LazyI18nString,
|
|
|
|
)
|
2022-11-07 03:21:53 +00:00
|
|
|
hierarkey.add_default("broadcast_tools_lower_thirds_info_string", "", LazyI18nString)
|
2021-11-21 12:07:19 +00:00
|
|
|
|
2021-11-20 16:46:05 +00:00
|
|
|
|
|
|
|
@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):
|
2021-11-20 16:46:05 +00:00
|
|
|
return []
|
2021-11-21 07:06:35 +00:00
|
|
|
return [
|
|
|
|
{
|
2021-11-22 19:53:07 +00:00
|
|
|
"label": _("broadcast tools"),
|
2021-11-21 07:06:35 +00:00
|
|
|
"url": reverse(
|
2021-11-22 11:09:01 +00:00
|
|
|
"plugins:pretalx_broadcast_tools:orga",
|
2021-11-21 07:06:35 +00:00
|
|
|
kwargs={
|
|
|
|
"event": request.event.slug,
|
|
|
|
},
|
|
|
|
),
|
2021-11-22 11:09:01 +00:00
|
|
|
"active": url.namespace == "plugins:pretalx_broadcast_tools"
|
2021-11-21 07:06:35 +00:00
|
|
|
and url.url_name == "orga",
|
|
|
|
}
|
|
|
|
]
|
2022-10-22 16:07:40 +00:00
|
|
|
|
|
|
|
|
2024-10-31 19:21:26 +00:00
|
|
|
@receiver(register_data_exporters, dispatch_uid="exporter_broadcast_pdf")
|
2022-10-22 16:07:40 +00:00
|
|
|
def register_data_exporter(sender, **kwargs):
|
|
|
|
from .exporter import PDFExporter
|
2022-10-22 16:35:31 +00:00
|
|
|
|
2022-10-22 16:07:40 +00:00
|
|
|
return PDFExporter
|