From 6c2fbf73898371e4a8f9585e468e7b4777007ca2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emanuel=20Sch=C3=BCtze?= Date: Fri, 24 Aug 2018 14:00:53 +0200 Subject: [PATCH] Enable/disable category in motion PDF. --- openslides/motions/static/js/motions/pdf.js | 7 +++++-- openslides/motions/static/js/motions/site.js | 9 ++++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/openslides/motions/static/js/motions/pdf.js b/openslides/motions/static/js/motions/pdf.js index 070918641..084ef2f04 100644 --- a/openslides/motions/static/js/motions/pdf.js +++ b/openslides/motions/static/js/motions/pdf.js @@ -135,7 +135,7 @@ angular.module('OpenSlidesApp.motions.pdf', ['OpenSlidesApp.core.pdf']) } // category - if (motion.category) { + if (params.include.category && motion.category) { metaTableBody.push([ { text: gettextCatalog.getString('Category') + ':', @@ -321,6 +321,7 @@ angular.module('OpenSlidesApp.motions.pdf', ['OpenSlidesApp.core.pdf']) margin: [0, 0, 0, 20], layout: '{{motion-placeholder-to-insert-functions-here}}' }; + params.include.metatable = true; return metaTable; } else { return {}; @@ -329,11 +330,13 @@ angular.module('OpenSlidesApp.motions.pdf', ['OpenSlidesApp.core.pdf']) // motion title var motionTitle = function() { - if (params.include.text && !motion.isParagraphBasedAmendment()) { + if (params.include.metatable && params.include.text && !motion.isParagraphBasedAmendment()) { return [{ text: titlePlain, style: 'heading3' }]; + } else { + return {}; } }; diff --git a/openslides/motions/static/js/motions/site.js b/openslides/motions/static/js/motions/site.js index 19fe7be53..ecb02d566 100644 --- a/openslides/motions/static/js/motions/site.js +++ b/openslides/motions/static/js/motions/site.js @@ -852,10 +852,17 @@ angular.module('OpenSlidesApp.motions.site', [ disabled = {}; } var options = [ - {name: gettextCatalog.getString('State'), id: 'state', disabled: disabled.state}, {name: gettextCatalog.getString('Submitters'), id: 'submitters', disabled: disabled.submitters}, + {name: gettextCatalog.getString('State'), id: 'state', disabled: disabled.state}, {name: gettextCatalog.getString('Voting result'), id: 'votingresult', disabled: disabled.votingResult} ]; + if (_.some(motions, function (motion) { return motion.category; })) { + options.push({ + name: gettextCatalog.getString('Category'), + id: 'category', + disabled: disabled.category, + }); + } if (_.some(motions, function (motion) { return motion.motionBlock; })) { options.push({ name: gettextCatalog.getString('Motion block'),