From 1f59336e3ec9b8479d250a189c386a0d82382e22 Mon Sep 17 00:00:00 2001 From: FinnStutzenstein Date: Wed, 26 Jul 2017 15:34:05 +0200 Subject: [PATCH] Configvalue for pagenumber alignment in PDF --- CHANGELOG | 1 + openslides/core/config_variables.py | 15 +++++++++++++++ openslides/core/static/js/core/pdf.js | 2 +- openslides/core/static/js/core/site.js | 4 ++++ openslides/motions/config_variables.py | 2 +- 5 files changed, 22 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index ecedfc181..10394a7bd 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -33,6 +33,7 @@ Motions: on server side [#3304]. - Added config value for customize sorting of category list in pdf/docx export [#3329]. +- Added config value for pagenumber alignment in PDF [#3327]. Users: - User without permission to see users can now see agenda item speakers, diff --git a/openslides/core/config_variables.py b/openslides/core/config_variables.py index 70ff69874..794e743bd 100644 --- a/openslides/core/config_variables.py +++ b/openslides/core/config_variables.py @@ -115,6 +115,21 @@ def get_config_variables(): group='General', subgroup='CSV') + # General export settings + + yield ConfigVariable( + name='general_export_pdf_pagenumber_alignment', + default_value='center', + input_type='choice', + label='Pagenumber alignment in PDF', + choices=( + {'value': 'left', 'display_name': 'Left'}, + {'value': 'center', 'display_name': 'Center'}, + {'value': 'right', 'display_name': 'Right'}), + weight=146, + group='General', + subgroup='Export') + # Projector yield ConfigVariable( diff --git a/openslides/core/static/js/core/pdf.js b/openslides/core/static/js/core/pdf.js index 95761c3bc..54f728b0e 100644 --- a/openslides/core/static/js/core/pdf.js +++ b/openslides/core/static/js/core/pdf.js @@ -212,7 +212,7 @@ angular.module('OpenSlidesApp.core.pdf', []) text: '{{currentPage}} / {{pageCount}}', color: '#555', fontSize: 9, - alignment: 'right', + alignment: Config.get('general_export_pdf_pagenumber_alignment').value, margin: [0, 15, 0, 0], }); return { diff --git a/openslides/core/static/js/core/site.js b/openslides/core/static/js/core/site.js index 53cb220b9..847f8e7b1 100644 --- a/openslides/core/static/js/core/site.js +++ b/openslides/core/static/js/core/site.js @@ -1883,6 +1883,10 @@ angular.module('OpenSlidesApp.core.site', [ gettext('Allow access for anonymous guest users'); gettext('Show this text on the login page'); gettext('Separator used for all csv exports and examples'); + gettext('Pagenumber alignment in PDF'); + gettext('Left'); + gettext('Center'); + gettext('Right'); gettext('Show logo on projector'); gettext('You can replace the logo by uploading an image and set it as ' + 'the "Projector logo" in "files".'); diff --git a/openslides/motions/config_variables.py b/openslides/motions/config_variables.py index 333d49567..1ce8190bf 100644 --- a/openslides/motions/config_variables.py +++ b/openslides/motions/config_variables.py @@ -262,6 +262,6 @@ def get_config_variables(): choices=( {'value': 'prefix', 'display_name': 'Prefix'}, {'value': 'name', 'display_name': 'Name'}), - weight=385, + weight=380, group='Motions', subgroup='Export')