From 8f0c419c3edca5554873c75f014df0f5baaed11a Mon Sep 17 00:00:00 2001 From: Sean Engelhardt Date: Wed, 30 Nov 2016 14:29:09 +0100 Subject: [PATCH] Adds the diff-summary box for motions --- openslides/motions/static/js/motions/pdf.js | 31 +++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/openslides/motions/static/js/motions/pdf.js b/openslides/motions/static/js/motions/pdf.js index 312010b3c..a08172943 100644 --- a/openslides/motions/static/js/motions/pdf.js +++ b/openslides/motions/static/js/motions/pdf.js @@ -188,6 +188,36 @@ angular.module('OpenSlidesApp.motions.pdf', ['OpenSlidesApp.core.pdf']) return metaTableJsonString; }; + //if the diff version shall be printed + var motionDiffLog = function() { + if ($scope.viewChangeRecommendations.mode == "diff") { + var motionDiffLogBox = []; + motionDiffLogBox.push({ + text: gettextCatalog.getString('Summary of change recommendations'), + style: 'heading3' + }); + + angular.forEach($scope.change_recommendations, function(change) { + var changeType = ""; + + if (change.getType(motion.getVersion($scope.version).text) === 0) { + changeType = gettextCatalog.getString("Replacement"); + } else if (change.getType(motion.getVersion($scope.version).text) === 1) { + changeType = gettextCatalog.getString("Insertion"); + } else if (change.getType(motion.getVersion($scope.version).text) === 2) { + changeType = gettextCatalog.getString("Deletion"); + } + + motionDiffLogBox.push({ + text: gettextCatalog.getString('Line') + " " + change.line_from + ": " + changeType + "\n" + }); + }); + return motionDiffLogBox; + } else { + return ""; + } + }; + // motion title var motionTitle = function() { return [{ @@ -246,6 +276,7 @@ angular.module('OpenSlidesApp.motions.pdf', ['OpenSlidesApp.core.pdf']) title, subtitle, metaTable(), + motionDiffLog(), motionTitle(), motionText(), ];