diff --git a/pretalx_lower_thirds/forms.py b/pretalx_lower_thirds/forms.py new file mode 100644 index 0000000..b8eb5da --- /dev/null +++ b/pretalx_lower_thirds/forms.py @@ -0,0 +1,17 @@ +from django import forms +from django.utils.translation import gettext_lazy as _ +from hierarkey.forms import HierarkeyForm + + +class LowerThirdsSettingsForm(HierarkeyForm): + lower_thirds_no_talk_info = forms.CharField( + help_text='Will be shown as talk title if there\'s currently no talk running.', + initial = 'Sorry, there\'s currently no talk running', + label='"no talk running" information', + required=True, + ) + lower_thirds_info_string = forms.CharField( + initial='', + label='info line', + required=False, + ) diff --git a/pretalx_lower_thirds/signals.py b/pretalx_lower_thirds/signals.py index a025794..ed713a7 100644 --- a/pretalx_lower_thirds/signals.py +++ b/pretalx_lower_thirds/signals.py @@ -1 +1,18 @@ -# Register your receivers here +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) + if not request.user.has_perm('orga.change_settings', request.event): + return [] + 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', + }] diff --git a/pretalx_lower_thirds/static/pretalx_lower_thirds/frontend.css b/pretalx_lower_thirds/static/pretalx_lower_thirds/frontend.css index 7b49b82..074f1dd 100644 --- a/pretalx_lower_thirds/static/pretalx_lower_thirds/frontend.css +++ b/pretalx_lower_thirds/static/pretalx_lower_thirds/frontend.css @@ -28,3 +28,8 @@ #speaker { font-size: 20px; } + +#info_line { + font-size: 16px; + text-align: right; +} diff --git a/pretalx_lower_thirds/static/pretalx_lower_thirds/update.js b/pretalx_lower_thirds/static/pretalx_lower_thirds/update.js index ee25ec1..a0b401e 100644 --- a/pretalx_lower_thirds/static/pretalx_lower_thirds/update.js +++ b/pretalx_lower_thirds/static/pretalx_lower_thirds/update.js @@ -49,9 +49,11 @@ function update_lower_third() { if (current_talk) { $('#title').text(current_talk['title']); $('#speaker').text(current_talk['persons'].join(', ')); + $('#info_line').text(current_talk['infoline']); } else { - $('#title').text('Currently no talk'); + $('#title').text(schedule['conference']['no_talk']); $('#speaker').text(''); + $('#info_line').text(''); } if (current_talk && current_talk['track']) { diff --git a/pretalx_lower_thirds/templates/pretalx_lower_thirds/lower_thirds.html b/pretalx_lower_thirds/templates/pretalx_lower_thirds/lower_thirds.html index 0efedaa..ff715ca 100644 --- a/pretalx_lower_thirds/templates/pretalx_lower_thirds/lower_thirds.html +++ b/pretalx_lower_thirds/templates/pretalx_lower_thirds/lower_thirds.html @@ -20,6 +20,7 @@
Loading ...
Content should appear soon. If not, please verify you have Javascript enabled.
+