diff --git a/MANIFEST.in b/MANIFEST.in index 8efe3ea..81100a3 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,6 +1,6 @@ include Makefile recursive-include img *.png -recursive-include pretalx_lower_thirds *.py -recursive-include pretalx_lower_thirds/locale * -recursive-include pretalx_lower_thirds/static * -recursive-include pretalx_lower_thirds/templates * +recursive-include pretalx_broadcast_tools *.py +recursive-include pretalx_broadcast_tools/locale * +recursive-include pretalx_broadcast_tools/static * +recursive-include pretalx_broadcast_tools/templates * diff --git a/pretalx_broadcast_tools/apps.py b/pretalx_broadcast_tools/apps.py new file mode 100644 index 0000000..d0bd8f8 --- /dev/null +++ b/pretalx_broadcast_tools/apps.py @@ -0,0 +1,21 @@ +from django.apps import AppConfig +from django.utils.translation import gettext_lazy + + +class PluginApp(AppConfig): + name = "pretalx_broadcast_tools" + verbose_name = "Broadcasting Tools" + + class PretalxPluginMeta: + name = gettext_lazy("Broadcasting Tools") + author = "kunsi" + description = gettext_lazy( + "Some tools which can be used for supporting a broadcasting " + "software, for example a 'lower third' page which can be " + "embedded into your broadcasting software" + ) + visible = True + version = "0.1.2" + + def ready(self): + from . import signals # NOQA diff --git a/pretalx_lower_thirds/forms.py b/pretalx_broadcast_tools/forms.py similarity index 90% rename from pretalx_lower_thirds/forms.py rename to pretalx_broadcast_tools/forms.py index 89f8ea1..6e017bf 100644 --- a/pretalx_lower_thirds/forms.py +++ b/pretalx_broadcast_tools/forms.py @@ -3,7 +3,7 @@ from hierarkey.forms import HierarkeyForm from i18nfield.forms import I18nFormField, I18nFormMixin, I18nTextInput -class LowerThirdsSettingsForm(I18nFormMixin, HierarkeyForm): +class BroadcastToolsSettingsForm(I18nFormMixin, HierarkeyForm): lower_thirds_no_talk_info = I18nFormField( help_text=_( "Will be shown as talk title if there's currently no talk running." diff --git a/pretalx_lower_thirds/locale/de_DE/LC_MESSAGES/.gitkeep b/pretalx_broadcast_tools/locale/de_DE/LC_MESSAGES/.gitkeep similarity index 100% rename from pretalx_lower_thirds/locale/de_DE/LC_MESSAGES/.gitkeep rename to pretalx_broadcast_tools/locale/de_DE/LC_MESSAGES/.gitkeep diff --git a/pretalx_lower_thirds/locale/fr_FR/LC_MESSAGES/.gitkeep b/pretalx_broadcast_tools/locale/fr_FR/LC_MESSAGES/.gitkeep similarity index 100% rename from pretalx_lower_thirds/locale/fr_FR/LC_MESSAGES/.gitkeep rename to pretalx_broadcast_tools/locale/fr_FR/LC_MESSAGES/.gitkeep diff --git a/pretalx_lower_thirds/signals.py b/pretalx_broadcast_tools/signals.py similarity index 89% rename from pretalx_lower_thirds/signals.py rename to pretalx_broadcast_tools/signals.py index 59245d4..7eb9234 100644 --- a/pretalx_lower_thirds/signals.py +++ b/pretalx_broadcast_tools/signals.py @@ -25,12 +25,12 @@ def navbar_info(sender, request, **kwargs): { "label": _("lower thirds"), "url": reverse( - "plugins:pretalx_lower_thirds:orga", + "plugins:pretalx_broadcast_tools:orga", kwargs={ "event": request.event.slug, }, ), - "active": url.namespace == "plugins:pretalx_lower_thirds" + "active": url.namespace == "plugins:pretalx_broadcast_tools" and url.url_name == "orga", } ] diff --git a/pretalx_lower_thirds/static/pretalx_lower_thirds/.gitkeep b/pretalx_broadcast_tools/static/pretalx_broadcast_tools/.gitkeep similarity index 100% rename from pretalx_lower_thirds/static/pretalx_lower_thirds/.gitkeep rename to pretalx_broadcast_tools/static/pretalx_broadcast_tools/.gitkeep diff --git a/pretalx_lower_thirds/static/pretalx_lower_thirds/frontend.css b/pretalx_broadcast_tools/static/pretalx_broadcast_tools/frontend.css similarity index 100% rename from pretalx_lower_thirds/static/pretalx_lower_thirds/frontend.css rename to pretalx_broadcast_tools/static/pretalx_broadcast_tools/frontend.css diff --git a/pretalx_lower_thirds/static/pretalx_lower_thirds/update.js b/pretalx_broadcast_tools/static/pretalx_broadcast_tools/update.js similarity index 95% rename from pretalx_lower_thirds/static/pretalx_lower_thirds/update.js rename to pretalx_broadcast_tools/static/pretalx_broadcast_tools/update.js index 1bd8cb6..cf59ea4 100644 --- a/pretalx_lower_thirds/static/pretalx_lower_thirds/update.js +++ b/pretalx_broadcast_tools/static/pretalx_broadcast_tools/update.js @@ -66,12 +66,12 @@ function update_lower_third() { window.setInterval(update_lower_third, 1000); function update_schedule() { - $.getJSON('event.json', function(data) { + $.getJSON('../event.json', function(data) { event_info = data; $('#box').css('background-color', data['color']); }); - $.getJSON('schedule.json', function(data) { + $.getJSON('../schedule.json', function(data) { console.info('schedule updated with ' + data['talks'].length + ' talks in ' + data['rooms'].length + ' rooms'); schedule = data; diff --git a/pretalx_lower_thirds/templates/pretalx_lower_thirds/.gitkeep b/pretalx_broadcast_tools/templates/pretalx_broadcast_tools/.gitkeep similarity index 100% rename from pretalx_lower_thirds/templates/pretalx_lower_thirds/.gitkeep rename to pretalx_broadcast_tools/templates/pretalx_broadcast_tools/.gitkeep diff --git a/pretalx_lower_thirds/templates/pretalx_lower_thirds/lower_thirds.html b/pretalx_broadcast_tools/templates/pretalx_broadcast_tools/lower_thirds.html similarity index 77% rename from pretalx_lower_thirds/templates/pretalx_lower_thirds/lower_thirds.html rename to pretalx_broadcast_tools/templates/pretalx_broadcast_tools/lower_thirds.html index 5b2fdc9..237f2ca 100644 --- a/pretalx_lower_thirds/templates/pretalx_lower_thirds/lower_thirds.html +++ b/pretalx_broadcast_tools/templates/pretalx_broadcast_tools/lower_thirds.html @@ -8,8 +8,8 @@ {% compress js %} {% endcompress %} - - + +
diff --git a/pretalx_lower_thirds/templates/pretalx_lower_thirds/orga.html b/pretalx_broadcast_tools/templates/pretalx_broadcast_tools/orga.html similarity index 77% rename from pretalx_lower_thirds/templates/pretalx_lower_thirds/orga.html rename to pretalx_broadcast_tools/templates/pretalx_broadcast_tools/orga.html index 7f5021a..73c8034 100644 --- a/pretalx_lower_thirds/templates/pretalx_lower_thirds/orga.html +++ b/pretalx_broadcast_tools/templates/pretalx_broadcast_tools/orga.html @@ -3,10 +3,15 @@ {% load i18n %} {% block content %} -

{% trans "Set up lower thirds" %}

{% csrf_token %} - {% bootstrap_form form layout='event' %} + +
+ + {% translate "Set up lower thirds" %} + + {% bootstrap_field form.lower_thirds_no_talk_info layout='event' %} + {% bootstrap_field form.lower_thirds_info_string layout='event' %}

The info line will be shown on the bottom right side of your lower third. If you set it to an empty string, it will automatically @@ -26,7 +31,7 @@

{% trans "room list" %}

{% endif %} diff --git a/pretalx_broadcast_tools/urls.py b/pretalx_broadcast_tools/urls.py new file mode 100644 index 0000000..8445b01 --- /dev/null +++ b/pretalx_broadcast_tools/urls.py @@ -0,0 +1,27 @@ +from django.urls import re_path +from pretalx.event.models.event import SLUG_CHARS + +from . import views + +urlpatterns = [ + re_path( + f"^(?P[{SLUG_CHARS}]+)/p/broadcast-tools/lower-thirds/$", + views.BroadcastToolsLowerThirdsView.as_view(), + name="lowerthirds", + ), + re_path( + f"^(?P[{SLUG_CHARS}]+)/p/broadcast-tools/event.json$", + views.BroadcastToolsEventInfoView.as_view(), + name="event_info", + ), + re_path( + f"^(?P[{SLUG_CHARS}]+)/p/broadcast-tools/schedule.json$", + views.BroadcastToolsScheduleView.as_view(), + name="schedule", + ), + re_path( + f"^orga/event/(?P[{SLUG_CHARS}]+)/settings/p/broadcast-tools/$", + views.BroadcastToolsOrgaView.as_view(), + name="orga", + ), +] diff --git a/pretalx_lower_thirds/views.py b/pretalx_broadcast_tools/views.py similarity index 85% rename from pretalx_lower_thirds/views.py rename to pretalx_broadcast_tools/views.py index 168a30d..5d7b30d 100644 --- a/pretalx_lower_thirds/views.py +++ b/pretalx_broadcast_tools/views.py @@ -8,17 +8,17 @@ from pretalx.agenda.views.schedule import ScheduleMixin from pretalx.common.mixins.views import EventPermissionRequired, PermissionRequired from pretalx.schedule.exporters import ScheduleData -from .forms import LowerThirdsSettingsForm +from .forms import BroadcastToolsSettingsForm -class LowerThirdsView(TemplateView): - template_name = "pretalx_lower_thirds/lower_thirds.html" +class BroadcastToolsLowerThirdsView(TemplateView): + template_name = "pretalx_broadcast_tools/lower_thirds.html" -class LowerThirdsOrgaView(PermissionRequired, FormView): - form_class = LowerThirdsSettingsForm +class BroadcastToolsOrgaView(PermissionRequired, FormView): + form_class = BroadcastToolsSettingsForm permission_required = "orga.change_settings" - template_name = "pretalx_lower_thirds/orga.html" + template_name = "pretalx_broadcast_tools/orga.html" def get_success_url(self): return self.request.path @@ -40,7 +40,7 @@ class LowerThirdsOrgaView(PermissionRequired, FormView): } -class EventInfoView(TemplateView): +class BroadcastToolsEventInfoView(TemplateView): def get(self, request, *args, **kwargs): color = self.request.event.primary_color or "#3aa57c" return JsonResponse( @@ -50,13 +50,10 @@ class EventInfoView(TemplateView): "no_talk": str(self.request.event.settings.lower_thirds_no_talk_info), "color": color, }, - json_dumps_params={ - "indent": 4, - }, ) -class ScheduleView(EventPermissionRequired, ScheduleMixin, TemplateView): +class BroadcastToolsScheduleView(EventPermissionRequired, ScheduleMixin, TemplateView): permission_required = "agenda.view_schedule" def get(self, request, *args, **kwargs): @@ -108,7 +105,4 @@ class ScheduleView(EventPermissionRequired, ScheduleMixin, TemplateView): for talk in room["talks"] ], }, - json_dumps_params={ - "indent": 4, - }, ) diff --git a/pretalx_lower_thirds/apps.py b/pretalx_lower_thirds/apps.py deleted file mode 100644 index 3ba30b2..0000000 --- a/pretalx_lower_thirds/apps.py +++ /dev/null @@ -1,21 +0,0 @@ -from django.apps import AppConfig -from django.utils.translation import gettext_lazy - - -class PluginApp(AppConfig): - name = "pretalx_lower_thirds" - verbose_name = "Lower Thirds" - - class PretalxPluginMeta: - name = gettext_lazy("Lower Thirds") - author = "kunsi" - description = gettext_lazy( - "Creates lower thirds from your current schedule. Will show " - "speaker names and talk title using the configured track and " - "event colours." - ) - visible = True - version = "0.0.0" - - def ready(self): - from . import signals # NOQA diff --git a/pretalx_lower_thirds/urls.py b/pretalx_lower_thirds/urls.py deleted file mode 100644 index 592cad3..0000000 --- a/pretalx_lower_thirds/urls.py +++ /dev/null @@ -1,27 +0,0 @@ -from django.urls import re_path -from pretalx.event.models.event import SLUG_CHARS - -from . import views - -urlpatterns = [ - re_path( - f"^(?P[{SLUG_CHARS}]+)/p/lower-thirds/$", - views.LowerThirdsView.as_view(), - name="lowerthirds", - ), - re_path( - f"^(?P[{SLUG_CHARS}]+)/p/lower-thirds/event.json$", - views.EventInfoView.as_view(), - name="event_info", - ), - re_path( - f"^(?P[{SLUG_CHARS}]+)/p/lower-thirds/schedule.json$", - views.ScheduleView.as_view(), - name="schedule", - ), - re_path( - f"^orga/event/(?P[{SLUG_CHARS}]+)/p/lower-thirds/$", - views.LowerThirdsOrgaView.as_view(), - name="orga", - ), -] diff --git a/setup.py b/setup.py index fb148fd..0508904 100644 --- a/setup.py +++ b/setup.py @@ -23,15 +23,15 @@ cmdclass = {"build": CustomBuild} setup( - name="pretalx-plugin-lower-thirds", + name="pretalx-plugin-broadcast-tools", version="0.1.2", description=( - "Creates lower thirds from your current schedule. Will show " - "speaker names and talk title using the configured track and " - "event colours." + "Some tools which can be used for supporting a broadcasting " + "software, for example a 'lower third' page which can be " + "embedded into your broadcasting software" ), long_description=long_description, - url="https://git.franzi.business/kunsi/pretalx-plugin-lower-thirds", + url="https://github.com/Kunsi/pretalx-plugin-broadcast-tools", author="kunsi", author_email="git@kunsmann.eu", license="Apache Software License", @@ -41,6 +41,6 @@ setup( cmdclass=cmdclass, entry_points=""" [pretalx.plugin] -pretalx_lower_thirds=pretalx_lower_thirds:PretalxPluginMeta +pretalx_broadcast_tools=pretalx_broadcast_tools:PretalxPluginMeta """, )