From c466af760ca0c0369b3d8051d34e92165dbbd205 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emanuel=20Sch=C3=BCtze?= Date: Wed, 30 Nov 2016 21:13:12 +0100 Subject: [PATCH] Motion PDF: Fix line numbers and style in summary box. --- openslides/motions/static/js/motions/pdf.js | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/openslides/motions/static/js/motions/pdf.js b/openslides/motions/static/js/motions/pdf.js index a08172943..b191e6719 100644 --- a/openslides/motions/static/js/motions/pdf.js +++ b/openslides/motions/static/js/motions/pdf.js @@ -188,17 +188,18 @@ angular.module('OpenSlidesApp.motions.pdf', ['OpenSlidesApp.core.pdf']) return metaTableJsonString; }; - //if the diff version shall be printed - var motionDiffLog = function() { + // summary of change recommendations (for motion diff version only) + var motionDiffSummary = function() { if ($scope.viewChangeRecommendations.mode == "diff") { var motionDiffLogBox = []; motionDiffLogBox.push({ text: gettextCatalog.getString('Summary of change recommendations'), - style: 'heading3' + style: 'bold' }); angular.forEach($scope.change_recommendations, function(change) { var changeType = ""; + var lineNumbers = ""; if (change.getType(motion.getVersion($scope.version).text) === 0) { changeType = gettextCatalog.getString("Replacement"); @@ -208,10 +209,18 @@ angular.module('OpenSlidesApp.motions.pdf', ['OpenSlidesApp.core.pdf']) changeType = gettextCatalog.getString("Deletion"); } + if (change.line_from >= change.line_to - 1) { + lineNumbers = change.line_from; + } else { + lineNumbers = change.line_from + " - " + (change.line_to - 1); + } motionDiffLogBox.push({ - text: gettextCatalog.getString('Line') + " " + change.line_from + ": " + changeType + "\n" + text: gettextCatalog.getString('Line') + " " + lineNumbers + ": " + changeType + "\n" }); }); + motionDiffLogBox.push({ + text: "\n\n" + }); return motionDiffLogBox; } else { return ""; @@ -276,7 +285,7 @@ angular.module('OpenSlidesApp.motions.pdf', ['OpenSlidesApp.core.pdf']) title, subtitle, metaTable(), - motionDiffLog(), + motionDiffSummary(), motionTitle(), motionText(), ];