mirror of
https://github.com/Kunsi/pretalx-plugin-broadcast-tools
synced 2024-11-21 12:11:02 +00:00
room info: add option to hide qr code or show the submission image
This commit is contained in:
parent
fa31e72db1
commit
12864749f9
4 changed files with 34 additions and 17 deletions
|
@ -1,4 +1,4 @@
|
|||
from django.forms import BooleanField, CharField, Textarea
|
||||
from django.forms import BooleanField, CharField, Textarea, ChoiceField
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
from hierarkey.forms import HierarkeyForm
|
||||
from i18nfield.forms import I18nFormField, I18nFormMixin, I18nTextInput
|
||||
|
@ -22,14 +22,26 @@ class BroadcastToolsSettingsForm(I18nFormMixin, HierarkeyForm):
|
|||
required=False,
|
||||
widget=I18nTextInput,
|
||||
)
|
||||
broadcast_tools_room_info_feedback_instead_of_public = BooleanField(
|
||||
help_text=_(
|
||||
"If checked, the qr code shown on the 'room info' page will "
|
||||
"link to the feedback page instead of the talk detail page."
|
||||
|
||||
broadcast_tools_room_info_lower_content = ChoiceField(
|
||||
choices=(
|
||||
("", "No lower content"),
|
||||
("public_qr", "QR code linking to the 'talk detail' page"),
|
||||
(
|
||||
"feedback_qr",
|
||||
"QR code linking to the feedback page of the currently running talk",
|
||||
),
|
||||
("talk_image", "session image uploaded by the speaker(s)"),
|
||||
),
|
||||
label=_("Show feedback QR code instead of talk detail QR code"),
|
||||
required=False,
|
||||
help_text=_(
|
||||
"If a talk is running, the room info page will always show "
|
||||
"the talk title and the list of speakers. The content below "
|
||||
"is configurable here."
|
||||
),
|
||||
label=_("lower content"),
|
||||
required=True,
|
||||
)
|
||||
|
||||
broadcast_tools_pdf_show_internal_notes = BooleanField(
|
||||
help_text=_(
|
||||
"If checked, the value of the 'internal notes' field in a "
|
||||
|
|
|
@ -13,15 +13,14 @@ function update_room_info() {
|
|||
}
|
||||
|
||||
if (!room_name) {
|
||||
$('#broadcast_tools_room_info_title').text(event_info['name']);
|
||||
$('#broadcast_tools_room_info_speaker').text('Backstage');
|
||||
$('#broadcast_tools_room_info_roomname').text(event_info['name']);
|
||||
$('#broadcast_tools_room_info_title').text('Backstage');
|
||||
$('#broadcast_tools_room_info_speaker').text('');
|
||||
$('#broadcast_tools_room_info_qr').text('');
|
||||
$('#broadcast_tools_room_info').css('background-color', event_info['color']);
|
||||
return
|
||||
}
|
||||
|
||||
$('#broadcast_tools_room_info_roomname').text(room_name);
|
||||
|
||||
if (!schedule) {
|
||||
$('#broadcast_tools_room_info_speaker').text('Waiting for schedule ...')
|
||||
return
|
||||
|
@ -43,17 +42,23 @@ function update_room_info() {
|
|||
|
||||
current_talk = get_current_talk(15);
|
||||
if (current_talk) {
|
||||
if (event_info['room-info']['qr_type'] == 'feedback') {
|
||||
if (event_info['room-info']['lower_info'] == 'feedback_qr') {
|
||||
qr_info = '<img src="' + current_talk['urls']['feedback_qr'] + '" alt="Feedback QR Code"><p>Leave Feedback by scanning the code or visiting ' + current_talk['urls']['feedback'] + '</p>';
|
||||
} else {
|
||||
} else if (event_info['room-info']['lower_info'] == 'public_qr') {
|
||||
qr_info = '<img src="' + current_talk['urls']['public_qr'] + '" alt="QR Code linking to URL below"><p>' + current_talk['urls']['public'] + '</p>';
|
||||
} else if (event_info['room-info']['lower_info'] == 'talk_image' && current_talk['image_url']) {
|
||||
qr_info = '<img src="' + current_talk['image_url'] + '" alt="Talk image">';
|
||||
} else {
|
||||
qr_info = '';
|
||||
}
|
||||
|
||||
$('#broadcast_tools_room_info_roomname').text(room_name);
|
||||
$('#broadcast_tools_room_info_title').text(current_talk['title']);
|
||||
$('#broadcast_tools_room_info_speaker').text(current_talk['persons'].join(', '));
|
||||
$('#broadcast_tools_room_info_qr').html(qr_info);
|
||||
} else {
|
||||
$('#broadcast_tools_room_info_title').text(event_info['name']);
|
||||
$('#broadcast_tools_room_info_roomname').text(event_info['name']);
|
||||
$('#broadcast_tools_room_info_title').text(room_name);
|
||||
$('#broadcast_tools_room_info_speaker').text('');
|
||||
$('#broadcast_tools_room_info_qr').text('');
|
||||
}
|
||||
|
|
|
@ -64,6 +64,7 @@
|
|||
{% translate "Room info" %}
|
||||
</legend>
|
||||
{% bootstrap_field form.broadcast_tools_room_info_feedback_instead_of_public layout='event' %}
|
||||
{% bootstrap_field form.broadcast_tools_room_info_lower_content layout='event' %}
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend>
|
||||
|
|
|
@ -75,9 +75,7 @@ class BroadcastToolsEventInfoView(View):
|
|||
self.request.event.settings.broadcast_tools_lower_thirds_no_talk_info
|
||||
),
|
||||
"room-info": {
|
||||
"qr_type": "feedback"
|
||||
if self.request.event.settings.broadcast_tools_room_info_feedback_instead_of_public
|
||||
else "public",
|
||||
"lower_info": self.request.event.settings.broadcast_tools_room_info_lower_content or '',
|
||||
},
|
||||
"slug": self.request.event.slug,
|
||||
},
|
||||
|
@ -149,6 +147,7 @@ class BroadcastToolsScheduleView(EventPermissionRequired, ScheduleMixin, View):
|
|||
else None,
|
||||
"room": room["name"].localize(schedule.event.locale),
|
||||
"infoline": infoline.format(**placeholders(schedule, talk)),
|
||||
"image_url": talk.submission.image_url,
|
||||
"urls": {
|
||||
"feedback": "{}{}".format(
|
||||
schedule.event.custom_domain or settings.SITE_URL,
|
||||
|
|
Loading…
Reference in a new issue