diff --git a/openslides/assignments/static/js/assignments/pdf.js b/openslides/assignments/static/js/assignments/pdf.js index 0e34b44b3..ed83d19e8 100644 --- a/openslides/assignments/static/js/assignments/pdf.js +++ b/openslides/assignments/static/js/assignments/pdf.js @@ -276,33 +276,33 @@ angular.module('OpenSlidesApp.assignments.pdf', ['OpenSlidesApp.core.pdf']) function($q, $filter, gettextCatalog, PDFLayout, Config, User, ImageConverter) { var createInstance = function(assignment, poll, pollNumber) { - var logoAssignmentBallotPaperUrl = Config.get('logo_pdf_assignment_ballot_paper').value.path; + var logoBallotPaperUrl = Config.get('logo_pdf_ballot_paper').value.path; var imageMap = {}; // PDF header var header = function() { var columns = []; - var text = Config.get('general_event_name').value + // logo + if (logoBallotPaperUrl) { + columns.push({ + image: imageMap[logoBallotPaperUrl].data, + fit: [90,20], + width: '20%' + }); + } + var text = Config.get('general_event_name').value; columns.push({ text: text, fontSize: 8, - alignment: 'left', - width: '80%' + alignment: 'right', }); - // logo - columns.push({ - image: imageMap[logoAssignmentBallotPaperUrl].data, - fit: [90,25], - width: '20%' - }); return { color: '#555', - fontSize: 10, - margin: [30, 10, 10, 0], // [left, top, right, bottom] + margin: [30, 10, 10, -10], // [left, top, right, bottom] columns: columns, - columnGap: 5 + columnGap: 10 }; }; @@ -384,7 +384,6 @@ angular.module('OpenSlidesApp.assignments.pdf', ['OpenSlidesApp.core.pdf']) // with a one px width and a fixed top-margin return { columns: [ - header(), { width: 1, margin: [0, marginTop], @@ -393,6 +392,7 @@ angular.module('OpenSlidesApp.assignments.pdf', ['OpenSlidesApp.core.pdf']) { width: '*', stack: [ + header(), createTitle(), createPollHint(), createSelectionField(), @@ -508,7 +508,7 @@ angular.module('OpenSlidesApp.assignments.pdf', ['OpenSlidesApp.core.pdf']) return $q(function (resolve) { var imageSources = [ - logoAssignmentBallotPaperUrl, + logoBallotPaperUrl, ]; ImageConverter.toBase64(imageSources).then(function (_imageMap) { imageMap = _imageMap; diff --git a/openslides/core/config_variables.py b/openslides/core/config_variables.py index 96e628d4b..a689054ff 100644 --- a/openslides/core/config_variables.py +++ b/openslides/core/config_variables.py @@ -253,8 +253,7 @@ def get_config_variables(): 'logo_web_header', 'logo_pdf_header', 'logo_pdf_footer', - 'logo_pdf_assignment_ballot_paper', - 'logo_pdf_motion_poll'], + 'logo_pdf_ballot_paper'], weight=300, group='Logo', hidden=True) @@ -311,21 +310,11 @@ def get_config_variables(): hidden=True) yield ConfigVariable( - name='logo_pdf_assignment_ballot_paper', + name='logo_pdf_ballot_paper', default_value={ - 'display_name': 'Election ballot paper', + 'display_name': 'PDF ballot paper logo', 'path': ''}, input_type='logo', weight=312, group='Logo', hidden=True) - - yield ConfigVariable( - name='logo_pdf_motion_poll', - default_value={ - 'display_name': 'Motion poll', - 'path': ''}, - input_type='logo', - weight=313, - group='Logo', - hidden=True) diff --git a/openslides/core/static/js/core/pdf-worker.js b/openslides/core/static/js/core/pdf-worker.js index 4d4d4b303..074035ed1 100644 --- a/openslides/core/static/js/core/pdf-worker.js +++ b/openslides/core/static/js/core/pdf-worker.js @@ -59,12 +59,6 @@ var replacePlaceholder = function (content) { hLineWidth: function(i, node) { if (i === 0){ return 0; - } else if (i === node.table.body.length) { - if (node.rowsperpage && node.rowsperpage > i) { - return 0.5; - } else { - return 0; - } } else { return 0.5; } diff --git a/openslides/core/static/js/core/site.js b/openslides/core/static/js/core/site.js index fb5ff3b28..009788923 100644 --- a/openslides/core/static/js/core/site.js +++ b/openslides/core/static/js/core/site.js @@ -1907,6 +1907,7 @@ angular.module('OpenSlidesApp.core.site', [ gettext('PDF header logo'); gettext('PDF footer logo'); gettext('Web interface header logo'); + gettext('PDF ballot paper logo'); // Mark the string 'Default projector' here, because it does not appear in the templates. gettext('Default projector'); diff --git a/openslides/core/static/templates/index.html b/openslides/core/static/templates/index.html index a57ef9f3e..68cf0bab0 100644 --- a/openslides/core/static/templates/index.html +++ b/openslides/core/static/templates/index.html @@ -29,7 +29,7 @@
diff --git a/openslides/motions/static/js/motions/pdf.js b/openslides/motions/static/js/motions/pdf.js index e1061bf29..16de80897 100644 --- a/openslides/motions/static/js/motions/pdf.js +++ b/openslides/motions/static/js/motions/pdf.js @@ -555,31 +555,34 @@ angular.module('OpenSlidesApp.motions.pdf', ['OpenSlidesApp.core.pdf']) */ var createInstance = function(title, id) { - var logoMotionPollUrl = Config.get('logo_pdf_motion_poll').value.path; + var logoBallotPaperUrl = Config.get('logo_pdf_ballot_paper').value.path; var imageMap = {}; // PDF header var header = function() { var columns = []; - var text = Config.get('general_event_name').value + var text = Config.get('general_event_name').value; columns.push({ text: text, fontSize: 8, alignment: 'left', - width: '80%' + width: '60%' }); // logo - columns.push({ - image: imageMap[logoMotionPollUrl].data, - fit: [90,25], - width: '20%' - }); + if (logoBallotPaperUrl) { + columns.push({ + image: imageMap[logoBallotPaperUrl].data, + fit: [90,25], + alignment: 'right', + width: '40%' + }); + } return { color: '#555', fontSize: 10, - margin: [30, 10, 10, 0], // [left, top, right, bottom] + margin: [30, 10, 10, -10], // [left, top, right, bottom] columns: columns, columnGap: 5 }; @@ -590,7 +593,7 @@ angular.module('OpenSlidesApp.motions.pdf', ['OpenSlidesApp.core.pdf']) * @function */ var createSection = function() { - var sheetend = 75; + var sheetend = 40; return { stack: [ header(), @@ -679,7 +682,7 @@ angular.module('OpenSlidesApp.motions.pdf', ['OpenSlidesApp.core.pdf']) return $q(function (resolve) { var imageSources = [ - logoMotionPollUrl, + logoBallotPaperUrl, ]; ImageConverter.toBase64(imageSources).then(function (_imageMap) { imageMap = _imageMap;