mirror of
https://github.com/Kunsi/pretalx-plugin-broadcast-tools
synced 2024-11-21 15:31:01 +00:00
add option to switch between feedback and public qr code
This commit is contained in:
parent
e0f47458cd
commit
bb55df2723
4 changed files with 37 additions and 3 deletions
|
@ -22,6 +22,14 @@ 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."
|
||||
),
|
||||
label=_("Show feedback QR code instead of talk detail QR code"),
|
||||
required=False,
|
||||
)
|
||||
broadcast_tools_pdf_show_internal_notes = BooleanField(
|
||||
help_text=_(
|
||||
"If checked, the value of the 'internal notes' field in a "
|
||||
|
|
|
@ -41,9 +41,15 @@ function update_room_info() {
|
|||
|
||||
current_talk = get_current_talk(15);
|
||||
if (current_talk) {
|
||||
if (event_info['room-info']['qr_type'] == 'feedback') {
|
||||
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 {
|
||||
qr_info = '<img src="' + current_talk['urls']['public_qr'] + '" alt="QR Code linking to URL below"><p>' + current_talk['urls']['public'] + '</p>';
|
||||
}
|
||||
|
||||
$('#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('<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>');
|
||||
$('#broadcast_tools_room_info_qr').html(qr_info);
|
||||
} else {
|
||||
$('#broadcast_tools_room_info_title').text(event_info['name']);
|
||||
$('#broadcast_tools_room_info_speaker').text(room_name);
|
||||
|
|
|
@ -59,6 +59,12 @@
|
|||
hide itself.
|
||||
</p>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend>
|
||||
{% translate "Room info" %}
|
||||
</legend>
|
||||
{% bootstrap_field form.broadcast_tools_room_info_feedback_instead_of_public layout='event' %}
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend>
|
||||
{% translate "PDF export" %}
|
||||
|
|
|
@ -69,12 +69,15 @@ class BroadcastToolsEventInfoView(View):
|
|||
color = self.request.event.primary_color or "#3aa57c"
|
||||
return JsonResponse(
|
||||
{
|
||||
"slug": self.request.event.slug,
|
||||
"color": color,
|
||||
"name": str(self.request.event.name),
|
||||
"no_talk": str(
|
||||
self.request.event.settings.broadcast_tools_lower_thirds_no_talk_info
|
||||
),
|
||||
"color": color,
|
||||
"room-info": {
|
||||
"qr_type": "feedback" if self.request.event.settings.broadcast_tools_room_info_feedback_instead_of_public else "public",
|
||||
},
|
||||
"slug": self.request.event.slug,
|
||||
},
|
||||
)
|
||||
|
||||
|
@ -156,6 +159,17 @@ class BroadcastToolsScheduleView(EventPermissionRequired, ScheduleMixin, View):
|
|||
"talk": talk.submission.id,
|
||||
},
|
||||
),
|
||||
"public": "{}{}".format(
|
||||
schedule.event.custom_domain or settings.SITE_URL,
|
||||
talk.submission.urls.public,
|
||||
),
|
||||
"public_qr": reverse(
|
||||
"plugins:pretalx_broadcast_tools:public_qr_id",
|
||||
kwargs={
|
||||
"event": schedule.event.slug,
|
||||
"talk": talk.submission.id,
|
||||
},
|
||||
),
|
||||
},
|
||||
}
|
||||
for day in schedule.data
|
||||
|
|
Loading…
Reference in a new issue