diff --git a/openslides/motion/pdf.py b/openslides/motion/pdf.py index 3b86c1aff..ace5308cf 100644 --- a/openslides/motion/pdf.py +++ b/openslides/motion/pdf.py @@ -212,8 +212,11 @@ def convert_html_to_reportlab(pdf, text): if paragraph == '\n' or paragraph == '\n\n' or paragraph == '\n\t': continue if "
" in paragraph: - pdf.append(Paragraph(paragraph.replace('\n', '
'), stylesheet['InnerMonotypeParagraph'], str(paragraph_number))) - paragraph_number += 1 + if config["motion_pdf_paragraph_numbering"]: + pdf.append(Paragraph(paragraph.replace('\n', '
'), stylesheet['InnerMonotypeParagraph'], str(paragraph_number))) + paragraph_number += 1 + else: + pdf.append(Paragraph(paragraph.replace('\n', '
'), stylesheet['InnerMonotypeParagraph'])) elif "" in paragraph: pdf.append(Paragraph(paragraph, stylesheet['InnerListParagraph'])) elif " " in paragraph: pdf.append(Paragraph(paragraph, stylesheet['InnerH3Paragraph'])) else: - pdf.append(Paragraph(paragraph, stylesheet['InnerParagraph'], str(paragraph_number))) - paragraph_number += 1 + if config["motion_pdf_paragraph_numbering"]: + pdf.append(Paragraph(paragraph, stylesheet['InnerParagraph'], str(paragraph_number))) + paragraph_number += 1 + else: + pdf.append(Paragraph(paragraph, stylesheet['InnerParagraph'])) def all_motion_cover(pdf, motions): diff --git a/openslides/motion/signals.py b/openslides/motion/signals.py index 4a43663ef..34e265a67 100644 --- a/openslides/motion/signals.py +++ b/openslides/motion/signals.py @@ -88,6 +88,12 @@ def setup_motion_config_page(sender, **kwargs): widget=forms.Textarea(), required=False, label=ugettext_lazy('Preamble text for PDF document (all motions)'))) + motion_pdf_paragraph_numbering = ConfigVariable( + name='motion_pdf_paragraph_numbering', + default_value=False, + form_field=forms.BooleanField( + label=ugettext_lazy('Show paragraph numbering'), + required=False)) motion_allow_disable_versioning = ConfigVariable( name='motion_allow_disable_versioning', default_value=False, @@ -126,6 +132,7 @@ def setup_motion_config_page(sender, **kwargs): motion_pdf_ballot_papers_number, motion_pdf_title, motion_pdf_preamble, + motion_pdf_paragraph_numbering, motion_allow_disable_versioning, motion_workflow, motion_identifier))