diff --git a/pretalx_broadcast_tools/exporter.py b/pretalx_broadcast_tools/exporter.py index e8d9640..48068f6 100644 --- a/pretalx_broadcast_tools/exporter.py +++ b/pretalx_broadcast_tools/exporter.py @@ -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, diff --git a/pretalx_broadcast_tools/forms.py b/pretalx_broadcast_tools/forms.py index 6e017bf..af28812 100644 --- a/pretalx_broadcast_tools/forms.py +++ b/pretalx_broadcast_tools/forms.py @@ -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, + ) diff --git a/pretalx_broadcast_tools/templates/pretalx_broadcast_tools/orga.html b/pretalx_broadcast_tools/templates/pretalx_broadcast_tools/orga.html index 43d26ee..0266578 100644 --- a/pretalx_broadcast_tools/templates/pretalx_broadcast_tools/orga.html +++ b/pretalx_broadcast_tools/templates/pretalx_broadcast_tools/orga.html @@ -36,6 +36,13 @@ {% endif %} +
+ + {% translate "PDF export" %} + + {% bootstrap_field form.broadcast_tools_pdf_show_internal_notes layout='event' %} + {% bootstrap_field form.broadcast_tools_pdf_ignore_do_not_record layout='event' %} +