mirror of
https://github.com/Kunsi/pretalx-plugin-broadcast-tools
synced 2024-12-22 19:29:12 +00:00
pdf export: make "show internal notes" and "ignore do_not_record" configurable
This commit is contained in:
parent
2e221cbf46
commit
ddd4bca708
3 changed files with 33 additions and 1 deletions
|
@ -155,7 +155,10 @@ class PDFInfoPage(Flowable):
|
|||
)
|
||||
)
|
||||
|
||||
if self.talk.submission.internal_notes:
|
||||
if (
|
||||
self.talk.submission.internal_notes
|
||||
and self.event.settings.broadcast_tools_pdf_show_internal_notes
|
||||
):
|
||||
self._space()
|
||||
for line in self.talk.submission.internal_notes.splitlines():
|
||||
line = line.strip()
|
||||
|
@ -182,6 +185,11 @@ class PDFExporter(ScheduleData):
|
|||
for fahrplan_day in self.data:
|
||||
for room_details in fahrplan_day["rooms"]:
|
||||
for talk in room_details["talks"]:
|
||||
if (
|
||||
talk.submission.do_not_record
|
||||
and self.event.settings.broadcast_tools_pdf_ignore_do_not_record
|
||||
):
|
||||
continue
|
||||
pages.append(
|
||||
PDFInfoPage(
|
||||
self.event,
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
from django.forms import BooleanField
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
from hierarkey.forms import HierarkeyForm
|
||||
from i18nfield.forms import I18nFormField, I18nFormMixin, I18nTextInput
|
||||
|
@ -18,3 +19,19 @@ class BroadcastToolsSettingsForm(I18nFormMixin, HierarkeyForm):
|
|||
required=False,
|
||||
widget=I18nTextInput,
|
||||
)
|
||||
broadcast_tools_pdf_show_internal_notes = BooleanField(
|
||||
help_text=_(
|
||||
"If checked, the value of the 'internal notes' field in a "
|
||||
"submission will get added to the pdf export."
|
||||
),
|
||||
label=_("Show internal notes in pdf export"),
|
||||
required=False,
|
||||
)
|
||||
broadcast_tools_pdf_ignore_do_not_record = BooleanField(
|
||||
help_text=_(
|
||||
"If checked, 'do not record' talks will not generate a page "
|
||||
"in the pdf export."
|
||||
),
|
||||
label=_("Ignore 'do not record' talks when generating pdf"),
|
||||
required=False,
|
||||
)
|
||||
|
|
|
@ -36,6 +36,13 @@
|
|||
</ul>
|
||||
{% endif %}
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend>
|
||||
{% translate "PDF export" %}
|
||||
</legend>
|
||||
{% bootstrap_field form.broadcast_tools_pdf_show_internal_notes layout='event' %}
|
||||
{% bootstrap_field form.broadcast_tools_pdf_ignore_do_not_record layout='event' %}
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<div class="submit-group panel">
|
||||
<span></span>
|
||||
|
|
Loading…
Reference in a new issue