From 611be75d95f3df42f1357795433bbe19495df735 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Ho=CC=88=C3=9Fl?= Date: Fri, 9 Mar 2018 14:34:09 +0100 Subject: [PATCH] Bugfix: Title change recommendations on the projector --- .../static/css/motions/_projector.scss | 7 ++++++ .../motions/static/js/motions/projector.js | 24 +++++++++++++------ .../templates/motions/slide_motion.html | 11 ++++++++- 3 files changed, 34 insertions(+), 8 deletions(-) diff --git a/openslides/motions/static/css/motions/_projector.scss b/openslides/motions/static/css/motions/_projector.scss index 9ae697338..fe689a678 100644 --- a/openslides/motions/static/css/motions/_projector.scss +++ b/openslides/motions/static/css/motions/_projector.scss @@ -27,6 +27,13 @@ p.os-split-after { .diff-box { padding-top: 0; } +.diff-box-title { + margin-bottom: 10px; + .description { + font-weight: bold; + } +} + .motion-text.line-numbers-outside { padding-left: 0; margin-left: 35px; diff --git a/openslides/motions/static/js/motions/projector.js b/openslides/motions/static/js/motions/projector.js index d0ae1c106..5aca64bf0 100644 --- a/openslides/motions/static/js/motions/projector.js +++ b/openslides/motions/static/js/motions/projector.js @@ -30,13 +30,23 @@ angular.module('OpenSlidesApp.motions.projector', [ Motion.bindOne(id, $scope, 'motion'); User.bindAll({}, $scope, 'users'); - MotionChangeRecommendation.bindAll({ - where: { - motion_version_id: { - '==': id, - }, - }, - }, $scope, 'change_recommendations'); + + $scope.$watch(function () { + return MotionChangeRecommendation.lastModified(); + }, function () { + $scope.change_recommendations = []; + $scope.title_change_recommendation = null; + MotionChangeRecommendation.filter({ + 'where': {'motion_version_id': {'==': id}} + }).forEach(function(change) { + if (change.isTextRecommendation()) { + $scope.change_recommendations.push(change); + } + if (change.isTitleRecommendation()) { + $scope.title_change_recommendation = change; + } + }); + }); } ]); diff --git a/openslides/motions/static/templates/motions/slide_motion.html b/openslides/motions/static/templates/motions/slide_motion.html index ad41c8bf1..c0dcb0ae6 100644 --- a/openslides/motions/static/templates/motions/slide_motion.html +++ b/openslides/motions/static/templates/motions/slide_motion.html @@ -68,7 +68,7 @@
-

{{ motion.getTitle() }}

+

{{ motion.getTitleWithChanges(mode) }}

Motion {{ motion.identifier }} | Version {{ motion.getVersion().version_number }} @@ -89,6 +89,15 @@
+
+
+
+ New title: +
+
{{ title_change_recommendation.text }}
+
+
+