1
0
Fork 0
mirror of https://github.com/Kunsi/pretalx-plugin-broadcast-tools synced 2024-11-23 15:51:02 +00:00

rename plugin to 'pretalx_broadcast_tools'

This commit is contained in:
Franzi 2021-11-22 12:09:01 +01:00
parent 7c5e58023c
commit 213db3f640
Signed by: kunsi
GPG key ID: 12E3D2136B818350
17 changed files with 81 additions and 82 deletions

View file

@ -1,6 +1,6 @@
include Makefile include Makefile
recursive-include img *.png recursive-include img *.png
recursive-include pretalx_lower_thirds *.py recursive-include pretalx_broadcast_tools *.py
recursive-include pretalx_lower_thirds/locale * recursive-include pretalx_broadcast_tools/locale *
recursive-include pretalx_lower_thirds/static * recursive-include pretalx_broadcast_tools/static *
recursive-include pretalx_lower_thirds/templates * recursive-include pretalx_broadcast_tools/templates *

View file

@ -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

View file

@ -3,7 +3,7 @@ from hierarkey.forms import HierarkeyForm
from i18nfield.forms import I18nFormField, I18nFormMixin, I18nTextInput from i18nfield.forms import I18nFormField, I18nFormMixin, I18nTextInput
class LowerThirdsSettingsForm(I18nFormMixin, HierarkeyForm): class BroadcastToolsSettingsForm(I18nFormMixin, HierarkeyForm):
lower_thirds_no_talk_info = I18nFormField( lower_thirds_no_talk_info = I18nFormField(
help_text=_( help_text=_(
"Will be shown as talk title if there's currently no talk running." "Will be shown as talk title if there's currently no talk running."

View file

@ -25,12 +25,12 @@ def navbar_info(sender, request, **kwargs):
{ {
"label": _("lower thirds"), "label": _("lower thirds"),
"url": reverse( "url": reverse(
"plugins:pretalx_lower_thirds:orga", "plugins:pretalx_broadcast_tools:orga",
kwargs={ kwargs={
"event": request.event.slug, "event": request.event.slug,
}, },
), ),
"active": url.namespace == "plugins:pretalx_lower_thirds" "active": url.namespace == "plugins:pretalx_broadcast_tools"
and url.url_name == "orga", and url.url_name == "orga",
} }
] ]

View file

@ -66,12 +66,12 @@ function update_lower_third() {
window.setInterval(update_lower_third, 1000); window.setInterval(update_lower_third, 1000);
function update_schedule() { function update_schedule() {
$.getJSON('event.json', function(data) { $.getJSON('../event.json', function(data) {
event_info = data; event_info = data;
$('#box').css('background-color', data['color']); $('#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'); console.info('schedule updated with ' + data['talks'].length + ' talks in ' + data['rooms'].length + ' rooms');
schedule = data; schedule = data;

View file

@ -8,8 +8,8 @@
{% compress js %} {% compress js %}
<script src="{% static "vendored/jquery-3.1.1.js" %}"></script> <script src="{% static "vendored/jquery-3.1.1.js" %}"></script>
{% endcompress %} {% endcompress %}
<script src="{% static "pretalx_lower_thirds/update.js" %}"></script> <script src="{% static "pretalx_broadcast_tools/update.js" %}"></script>
<link rel="stylesheet" href="{% static "pretalx_lower_thirds/frontend.css" %}" /> <link rel="stylesheet" href="{% static "pretalx_broadcast_tools/frontend.css" %}" />
</head> </head>
<body> <body>
<div id="box"> <div id="box">

View file

@ -3,10 +3,15 @@
{% load i18n %} {% load i18n %}
{% block content %} {% block content %}
<h2>{% trans "Set up lower thirds" %}</h2>
<form method="post"> <form method="post">
{% csrf_token %} {% csrf_token %}
{% bootstrap_form form layout='event' %}
<fieldset>
<legend>
{% translate "Set up lower thirds" %}
</legend>
{% bootstrap_field form.lower_thirds_no_talk_info layout='event' %}
{% bootstrap_field form.lower_thirds_info_string layout='event' %}
<p> <p>
The info line will be shown on the bottom right side of your 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 lower third. If you set it to an empty string, it will automatically
@ -26,7 +31,7 @@
<h3>{% trans "room list" %}</h3> <h3>{% trans "room list" %}</h3>
<ul> <ul>
{% for room in request.event.rooms.all %} {% for room in request.event.rooms.all %}
<li><a href="{% url 'plugins:pretalx_lower_thirds:lowerthirds' request.event.slug %}#{{ room.name }}">{{ room.name }}</a></li> <li><a href="{% url 'plugins:pretalx_broadcast_tools:lowerthirds' request.event.slug %}#{{ room.name }}">{{ room.name }}</a></li>
{% endfor %} {% endfor %}
</ul> </ul>
{% endif %} {% endif %}

View file

@ -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<event>[{SLUG_CHARS}]+)/p/broadcast-tools/lower-thirds/$",
views.BroadcastToolsLowerThirdsView.as_view(),
name="lowerthirds",
),
re_path(
f"^(?P<event>[{SLUG_CHARS}]+)/p/broadcast-tools/event.json$",
views.BroadcastToolsEventInfoView.as_view(),
name="event_info",
),
re_path(
f"^(?P<event>[{SLUG_CHARS}]+)/p/broadcast-tools/schedule.json$",
views.BroadcastToolsScheduleView.as_view(),
name="schedule",
),
re_path(
f"^orga/event/(?P<event>[{SLUG_CHARS}]+)/settings/p/broadcast-tools/$",
views.BroadcastToolsOrgaView.as_view(),
name="orga",
),
]

View file

@ -8,17 +8,17 @@ from pretalx.agenda.views.schedule import ScheduleMixin
from pretalx.common.mixins.views import EventPermissionRequired, PermissionRequired from pretalx.common.mixins.views import EventPermissionRequired, PermissionRequired
from pretalx.schedule.exporters import ScheduleData from pretalx.schedule.exporters import ScheduleData
from .forms import LowerThirdsSettingsForm from .forms import BroadcastToolsSettingsForm
class LowerThirdsView(TemplateView): class BroadcastToolsLowerThirdsView(TemplateView):
template_name = "pretalx_lower_thirds/lower_thirds.html" template_name = "pretalx_broadcast_tools/lower_thirds.html"
class LowerThirdsOrgaView(PermissionRequired, FormView): class BroadcastToolsOrgaView(PermissionRequired, FormView):
form_class = LowerThirdsSettingsForm form_class = BroadcastToolsSettingsForm
permission_required = "orga.change_settings" permission_required = "orga.change_settings"
template_name = "pretalx_lower_thirds/orga.html" template_name = "pretalx_broadcast_tools/orga.html"
def get_success_url(self): def get_success_url(self):
return self.request.path return self.request.path
@ -40,7 +40,7 @@ class LowerThirdsOrgaView(PermissionRequired, FormView):
} }
class EventInfoView(TemplateView): class BroadcastToolsEventInfoView(TemplateView):
def get(self, request, *args, **kwargs): def get(self, request, *args, **kwargs):
color = self.request.event.primary_color or "#3aa57c" color = self.request.event.primary_color or "#3aa57c"
return JsonResponse( return JsonResponse(
@ -50,13 +50,10 @@ class EventInfoView(TemplateView):
"no_talk": str(self.request.event.settings.lower_thirds_no_talk_info), "no_talk": str(self.request.event.settings.lower_thirds_no_talk_info),
"color": color, "color": color,
}, },
json_dumps_params={
"indent": 4,
},
) )
class ScheduleView(EventPermissionRequired, ScheduleMixin, TemplateView): class BroadcastToolsScheduleView(EventPermissionRequired, ScheduleMixin, TemplateView):
permission_required = "agenda.view_schedule" permission_required = "agenda.view_schedule"
def get(self, request, *args, **kwargs): def get(self, request, *args, **kwargs):
@ -108,7 +105,4 @@ class ScheduleView(EventPermissionRequired, ScheduleMixin, TemplateView):
for talk in room["talks"] for talk in room["talks"]
], ],
}, },
json_dumps_params={
"indent": 4,
},
) )

View file

@ -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

View file

@ -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<event>[{SLUG_CHARS}]+)/p/lower-thirds/$",
views.LowerThirdsView.as_view(),
name="lowerthirds",
),
re_path(
f"^(?P<event>[{SLUG_CHARS}]+)/p/lower-thirds/event.json$",
views.EventInfoView.as_view(),
name="event_info",
),
re_path(
f"^(?P<event>[{SLUG_CHARS}]+)/p/lower-thirds/schedule.json$",
views.ScheduleView.as_view(),
name="schedule",
),
re_path(
f"^orga/event/(?P<event>[{SLUG_CHARS}]+)/p/lower-thirds/$",
views.LowerThirdsOrgaView.as_view(),
name="orga",
),
]

View file

@ -23,15 +23,15 @@ cmdclass = {"build": CustomBuild}
setup( setup(
name="pretalx-plugin-lower-thirds", name="pretalx-plugin-broadcast-tools",
version="0.1.2", version="0.1.2",
description=( description=(
"Creates lower thirds from your current schedule. Will show " "Some tools which can be used for supporting a broadcasting "
"speaker names and talk title using the configured track and " "software, for example a 'lower third' page which can be "
"event colours." "embedded into your broadcasting software"
), ),
long_description=long_description, 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="kunsi",
author_email="git@kunsmann.eu", author_email="git@kunsmann.eu",
license="Apache Software License", license="Apache Software License",
@ -41,6 +41,6 @@ setup(
cmdclass=cmdclass, cmdclass=cmdclass,
entry_points=""" entry_points="""
[pretalx.plugin] [pretalx.plugin]
pretalx_lower_thirds=pretalx_lower_thirds:PretalxPluginMeta pretalx_broadcast_tools=pretalx_broadcast_tools:PretalxPluginMeta
""", """,
) )