From dbdaa9748c2b55a0e3a51b4c9b435d11e851fc65 Mon Sep 17 00:00:00 2001 From: FinnStutzenstein Date: Mon, 12 Dec 2016 12:14:30 +0100 Subject: [PATCH] More motion select mode options and layout changes for guests --- .../static/templates/agenda/item-list.html | 1 + .../assignments/assignment-list.html | 1 + openslides/core/static/css/app.css | 5 ++ .../templates/mediafiles/mediafile-list.html | 1 + openslides/motions/static/js/motions/site.js | 40 +++++++++++--- .../static/templates/motions/motion-list.html | 53 +++++++++++++++++-- .../static/templates/users/user-list.html | 1 + 7 files changed, 92 insertions(+), 10 deletions(-) diff --git a/openslides/agenda/static/templates/agenda/item-list.html b/openslides/agenda/static/templates/agenda/item-list.html index 4be59732f..5dc5ee9f1 100644 --- a/openslides/agenda/static/templates/agenda/item-list.html +++ b/openslides/agenda/static/templates/agenda/item-list.html @@ -256,6 +256,7 @@ +
diff --git a/openslides/assignments/static/templates/assignments/assignment-list.html b/openslides/assignments/static/templates/assignments/assignment-list.html index 9e5617596..075e97312 100644 --- a/openslides/assignments/static/templates/assignments/assignment-list.html +++ b/openslides/assignments/static/templates/assignments/assignment-list.html @@ -219,6 +219,7 @@
+
diff --git a/openslides/core/static/css/app.css b/openslides/core/static/css/app.css index dcb8e9615..2e1a78981 100644 --- a/openslides/core/static/css/app.css +++ b/openslides/core/static/css/app.css @@ -964,6 +964,11 @@ img { width: calc(100% - 50px); } +.os-table .no-projector-spacer { + margin-right: 20px; + float: left; +} + .os-table .header-row { border-top: 1px solid #ddd; background-color: #f5f5f5; diff --git a/openslides/mediafiles/static/templates/mediafiles/mediafile-list.html b/openslides/mediafiles/static/templates/mediafiles/mediafile-list.html index 403c888ab..4677be975 100644 --- a/openslides/mediafiles/static/templates/mediafiles/mediafile-list.html +++ b/openslides/mediafiles/static/templates/mediafiles/mediafile-list.html @@ -276,6 +276,7 @@
+
diff --git a/openslides/motions/static/js/motions/site.js b/openslides/motions/static/js/motions/site.js index aa0a438f1..4003e82a3 100644 --- a/openslides/motions/static/js/motions/site.js +++ b/openslides/motions/static/js/motions/site.js @@ -944,6 +944,10 @@ angular.module('OpenSlidesApp.motions.site', [ motion.reason = motion.getReason(-1); Motion.save(motion); }; + // delete single motion + $scope.delete = function (motion) { + Motion.destroy(motion.id); + }; $scope.toggleTag = function (motion, tag) { if ($scope.hasTag(motion, tag)) { // remove @@ -1035,18 +1039,40 @@ angular.module('OpenSlidesApp.motions.site', [ }); } }; - // delete selected motions - $scope.deleteMultiple = function () { + var selectModeAction = function (predicate) { angular.forEach($scope.motionsFiltered, function (motion) { - if (motion.selected) - Motion.destroy(motion.id); + if (motion.selected) { + predicate(motion); + } }); $scope.isSelectMode = false; $scope.uncheckAll(); }; - // delete single motion - $scope.delete = function (motion) { - Motion.destroy(motion.id); + // delete selected motions + $scope.deleteMultiple = function () { + selectModeAction(function (motion) { + $scope.delete(motion); + }); + }; + // set status for selected motions + $scope.setStatusMultiple = function (stateId) { + selectModeAction(function (motion) { + $scope.updateState(motion, stateId); + }); + }; + // set category for selected motions + $scope.setCategoryMultiple = function (categoryId) { + selectModeAction(function (motion) { + motion.category_id = categoryId === 'no_category_selected' ? null : categoryId; + $scope.save(motion); + }); + }; + // set status for selected motions + $scope.setMotionBlockMultiple = function (motionBlockId) { + selectModeAction(function (motion) { + motion.motion_block_id = motionBlockId === 'no_motionBlock_selected' ? null : motionBlockId; + $scope.save(motion); + }); }; } ]) diff --git a/openslides/motions/static/templates/motions/motion-list.html b/openslides/motions/static/templates/motions/motion-list.html index d87f8b175..80ca2150d 100644 --- a/openslides/motions/static/templates/motions/motion-list.html +++ b/openslides/motions/static/templates/motions/motion-list.html @@ -77,12 +77,58 @@
-
+
+ + + + + + + Set status + + + + + + Set category + + + + + + Set motion block + - + class="btn btn-danger"> Delete selected motions @@ -385,6 +431,7 @@
+
diff --git a/openslides/users/static/templates/users/user-list.html b/openslides/users/static/templates/users/user-list.html index 3dc645cd3..f822bcdc7 100644 --- a/openslides/users/static/templates/users/user-list.html +++ b/openslides/users/static/templates/users/user-list.html @@ -274,6 +274,7 @@
+