mirror of
https://github.com/Kunsi/pretalx-plugin-broadcast-tools
synced 2024-11-23 10:11:03 +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
|
@ -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 *
|
||||
|
|
21
pretalx_broadcast_tools/apps.py
Normal file
21
pretalx_broadcast_tools/apps.py
Normal 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
|
|
@ -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."
|
|
@ -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",
|
||||
}
|
||||
]
|
|
@ -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;
|
|
@ -8,8 +8,8 @@
|
|||
{% compress js %}
|
||||
<script src="{% static "vendored/jquery-3.1.1.js" %}"></script>
|
||||
{% endcompress %}
|
||||
<script src="{% static "pretalx_lower_thirds/update.js" %}"></script>
|
||||
<link rel="stylesheet" href="{% static "pretalx_lower_thirds/frontend.css" %}" />
|
||||
<script src="{% static "pretalx_broadcast_tools/update.js" %}"></script>
|
||||
<link rel="stylesheet" href="{% static "pretalx_broadcast_tools/frontend.css" %}" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="box">
|
|
@ -3,10 +3,15 @@
|
|||
{% load i18n %}
|
||||
|
||||
{% block content %}
|
||||
<h2>{% trans "Set up lower thirds" %}</h2>
|
||||
<form method="post">
|
||||
{% 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>
|
||||
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 @@
|
|||
<h3>{% trans "room list" %}</h3>
|
||||
<ul>
|
||||
{% 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 %}
|
||||
</ul>
|
||||
{% endif %}
|
27
pretalx_broadcast_tools/urls.py
Normal file
27
pretalx_broadcast_tools/urls.py
Normal 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",
|
||||
),
|
||||
]
|
|
@ -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,
|
||||
},
|
||||
)
|
|
@ -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
|
|
@ -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",
|
||||
),
|
||||
]
|
12
setup.py
12
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
|
||||
""",
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue