1
0
Fork 0
mirror of https://github.com/Kunsi/pretalx-plugin-broadcast-tools synced 2024-05-15 04:12:34 +00:00

Merge pull request #8 from dhavlik/main

implement theme change and rc3 theme
This commit is contained in:
Franzi 2021-12-25 08:58:52 +01:00 committed by GitHub
commit e7c99cc7c9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 104 additions and 4 deletions

View file

@ -7,12 +7,17 @@ This plugin allows you to add configurable lower thirds ("Bauchbinden"
in German) to your pretalx instance. Most likely this will be used in in German) to your pretalx instance. Most likely this will be used in
(for example) a Browser Source inside `OBS Studio`_. (for example) a Browser Source inside `OBS Studio`_.
It currently contains two selectable themes, a general one, which colours
are automatically determined from the event and track colours set inside
pretalx, and one specifically for `rC3 2021 NOWHERE`_.
.. image:: img/lower_thirds.png .. image:: img/lower_thirds.png
:width: 400 :width: 400
:alt: Screenshot of the lower third output. There's currently a talk running. :alt: Screenshot of the lower third output. There's currently a talk running.
The colours will be automatically determined from the event and track .. image:: img/lower_thirds_rc3.png
colours set inside pretalx. :width: 400
:alt: Screenshot of the rc3 2021 theme.
You can also add a configurable third line to the lower thirds, for You can also add a configurable third line to the lower thirds, for
example to hint your audience to vote for the talks. To make this easier, example to hint your audience to vote for the talks. To make this easier,
@ -53,6 +58,16 @@ Copyright 2021 Franziska 'kuns' Kunsmann
Released under the terms of the Apache License 2.0 Released under the terms of the Apache License 2.0
Contained Fonts
---------------
"Changa-SemiBold.ttf" by The Changa Project Authors (https://github.com/eliheuer/changa-vf)
Open Font License 1.1 (http://scripts.sil.org/OFL)
"SpaceMono-Regular.ttf" by Google Inc.
Open Font License 1.1 (http://scripts.sil.org/OFL)
.. _pretalx: https://github.com/pretalx/pretalx .. _pretalx: https://github.com/pretalx/pretalx
.. _pretalx development setup: https://docs.pretalx.org/en/latest/developer/setup.html .. _pretalx development setup: https://docs.pretalx.org/en/latest/developer/setup.html
.. _OBS Studio: https://obsproject.com/ .. _OBS Studio: https://obsproject.com/
.. _rC3 2021 NOWHERE: https://events.ccc.de/2021/10/13/remote-chaos-experience/

BIN
img/lower_thirds_rc3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 87 KiB

After

Width:  |  Height:  |  Size: 489 KiB

View file

@ -1,9 +1,15 @@
from django.forms import ChoiceField, RadioSelect
from django.utils.translation import gettext_lazy as _ from django.utils.translation import gettext_lazy as _
from hierarkey.forms import HierarkeyForm from hierarkey.forms import HierarkeyForm
from i18nfield.forms import I18nFormField, I18nFormMixin, I18nTextInput from i18nfield.forms import I18nFormField, I18nFormMixin, I18nTextInput
class BroadcastToolsSettingsForm(I18nFormMixin, HierarkeyForm): class BroadcastToolsSettingsForm(I18nFormMixin, HierarkeyForm):
lower_thirds_theme = ChoiceField(
choices=(("default", "default"), ("rc3-2021", "rc3-2021")),
label=_("Theme"),
widget=RadioSelect,
)
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

@ -0,0 +1,71 @@
@font-face {
font-family: 'Changa';
src: url('Changa-SemiBold.ttf') format('truetype');
}
@font-face {
font-family: 'Space Mono';
src: url('SpaceMono-Regular.ttf') format('truetype');
}
body {
background-color: transparent;
margin: 0;
padding: 0;
}
p {
margin: 0;
}
#l3box {
width: 1020px;
position: absolute;
bottom: 80px;
left: 50%;
margin-left: -2010px;
color: white;
background-color: transparent !important;
border:1px solid #ccc !important;
border-bottom: none !important;
animation: slide 0.7s forwards;
animation-delay: 2s;
}
#l3title {
font-family: 'Changa';
text-transform: lowercase;
line-height: 45px;
font-size: 30px;
letter-spacing: 110%;
color: #4c4c4c;
text-align: center;
background-color: white;
padding: 10px 5px;
}
#l3speaker, #l3info_line {
font-family: 'Space Mono', monospace;
font-size: 27px;
margin: 0;
color: white;
background-color: rgba(0,0,0,0.75);
}
#l3speaker {
padding: 10px 20px;
}
#l3info_line {
border-top: 1px solid #ccc;
font-size: 14px;
line-height: 36px;
padding: 0 20px;
text-align: right;
}
@keyframes slide {
100% {
margin-left: -510px;
}
}

View file

@ -9,7 +9,7 @@
<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_broadcast_tools/update.js" %}"></script> <script src="{% static "pretalx_broadcast_tools/update.js" %}"></script>
<link rel="stylesheet" href="{% static "pretalx_broadcast_tools/frontend.css" %}" /> <link rel="stylesheet" href="{{ view.css_url }}" />
{% if request.event and request.event.custom_css %} {% if request.event and request.event.custom_css %}
<link rel="stylesheet" type="text/css" href="{{ request.event.custom_css.url }}"/> <link rel="stylesheet" type="text/css" href="{{ request.event.custom_css.url }}"/>
{% endif %} {% endif %}

View file

@ -10,6 +10,7 @@
<legend> <legend>
{% translate "Set up lower thirds" %} {% translate "Set up lower thirds" %}
</legend> </legend>
{% bootstrap_field form.lower_thirds_theme layout='event' %}
{% bootstrap_field form.lower_thirds_no_talk_info layout='event' %} {% bootstrap_field form.lower_thirds_no_talk_info layout='event' %}
{% bootstrap_field form.lower_thirds_info_string layout='event' %} {% bootstrap_field form.lower_thirds_info_string layout='event' %}
<p> <p>

View file

@ -2,6 +2,7 @@ import datetime as dt
import pytz import pytz
from django.http import JsonResponse from django.http import JsonResponse
from django.templatetags.static import static
from django.views.generic import FormView from django.views.generic import FormView
from django.views.generic.base import TemplateView from django.views.generic.base import TemplateView
from pretalx.agenda.views.schedule import ScheduleMixin from pretalx.agenda.views.schedule import ScheduleMixin
@ -10,10 +11,16 @@ from pretalx.schedule.exporters import ScheduleData
from .forms import BroadcastToolsSettingsForm from .forms import BroadcastToolsSettingsForm
THEME_CSS = {"default": "frontend.css", "rc3-2021": "frontend_rc3.css"}
class BroadcastToolsLowerThirdsView(TemplateView): class BroadcastToolsLowerThirdsView(TemplateView):
template_name = "pretalx_broadcast_tools/lower_thirds.html" template_name = "pretalx_broadcast_tools/lower_thirds.html"
def css_url(self):
css = THEME_CSS.get(self.request.event.settings.lower_thirds_theme)
return static(f"pretalx_broadcast_tools/{css}")
class BroadcastToolsOrgaView(PermissionRequired, FormView): class BroadcastToolsOrgaView(PermissionRequired, FormView):
form_class = BroadcastToolsSettingsForm form_class = BroadcastToolsSettingsForm
@ -62,7 +69,7 @@ class BroadcastToolsScheduleView(EventPermissionRequired, ScheduleMixin, Templat
schedule=self.schedule, schedule=self.schedule,
) )
tz = pytz.timezone(schedule.event.timezone) tz = pytz.timezone(schedule.event.timezone)
infoline = str(schedule.event.settings.infoline or "") infoline = str(schedule.event.settings.lower_thirds_info_string or "")
return JsonResponse( return JsonResponse(
{ {
"rooms": sorted( "rooms": sorted(