From 0e401e722309b6bb0ec929663650b80e92edca2a Mon Sep 17 00:00:00 2001 From: FinnStutzenstein Date: Fri, 17 Feb 2017 13:21:11 +0100 Subject: [PATCH] Fixing MotionBlock autoupdate and added projector button (fixes #2958) --- openslides/motions/projector.py | 4 ++-- openslides/motions/static/js/motions/motion-block.js | 12 +++++++++++- .../static/templates/motions/motion-block-list.html | 4 ++++ 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/openslides/motions/projector.py b/openslides/motions/projector.py index 8a64c6d8f..3245f2584 100644 --- a/openslides/motions/projector.py +++ b/openslides/motions/projector.py @@ -74,10 +74,10 @@ class MotionBlockSlide(ProjectorElement): def get_collection_elements_required_for_this(self, collection_element, config_entry): output = super().get_collection_elements_required_for_this(collection_element, config_entry) - # Full update if a motion changes because then it may be appended to + # Send all changed motions to the projector, because it may be appended # or removed from the block. if collection_element.collection_string == Motion.get_collection_string(): - output.extend(self.get_requirements_as_collection_elements(config_entry)) + output.append(collection_element) return output def update_data(self): diff --git a/openslides/motions/static/js/motions/motion-block.js b/openslides/motions/static/js/motions/motion-block.js index bf2c1f90f..1dc90ddc2 100644 --- a/openslides/motions/static/js/motions/motion-block.js +++ b/openslides/motions/static/js/motions/motion-block.js @@ -106,7 +106,17 @@ angular.module('OpenSlidesApp.motions.motionBlock', []) 'ngDialog', 'MotionBlock', 'MotionBlockForm', - function ($scope, ngDialog, MotionBlock, MotionBlockForm) { + 'Projector', + 'ProjectionDefault', + function ($scope, ngDialog, MotionBlock, MotionBlockForm, Projector, ProjectionDefault) { + $scope.$watch(function () { + return Projector.lastModified(); + }, function () { + var projectiondefault = ProjectionDefault.filter({name: 'motionBlocks'})[0]; + if (projectiondefault) { + $scope.defaultProjectorId = projectiondefault.projector_id; + } + }); // Two-way data binding for all MotionBlock instances. MotionBlock.bindAll({}, $scope, 'motionBlocks'); diff --git a/openslides/motions/static/templates/motions/motion-block-list.html b/openslides/motions/static/templates/motions/motion-block-list.html index c526845fd..efc6e4a1d 100644 --- a/openslides/motions/static/templates/motions/motion-block-list.html +++ b/openslides/motions/static/templates/motions/motion-block-list.html @@ -25,10 +25,14 @@ + +
Name Motions
+ + {{ motionBlock.title }}