From f7fcb69cc2d9c5ae836dd52d751112d507b38d99 Mon Sep 17 00:00:00 2001 From: FinnStutzenstein Date: Fri, 9 Dec 2016 11:21:55 +0100 Subject: [PATCH] Some stylistic changes and new motion filter option --- openslides/core/static/css/app.css | 4 + openslides/core/static/js/core/site.js | 3 + .../templates/core/manage-projectors.html | 3 +- .../templates/core/projector-controls.html | 25 +++---- openslides/motions/static/js/motions/site.js | 54 ++++++++----- .../static/templates/motions/motion-list.html | 75 ++++++++++++++++++- 6 files changed, 123 insertions(+), 41 deletions(-) diff --git a/openslides/core/static/css/app.css b/openslides/core/static/css/app.css index 3deb12a93..98305a70d 100644 --- a/openslides/core/static/css/app.css +++ b/openslides/core/static/css/app.css @@ -925,6 +925,10 @@ img { min-height: 1px; } +.os-table .id-col-space { + width: calc(100% - 50px); +} + .os-table .header-row { border-top: 1px solid #ddd; background-color: #f5f5f5; diff --git a/openslides/core/static/js/core/site.js b/openslides/core/static/js/core/site.js index b142ddfc0..873e06a60 100644 --- a/openslides/core/static/js/core/site.js +++ b/openslides/core/static/js/core/site.js @@ -1038,6 +1038,9 @@ angular.module('OpenSlidesApp.core.site', [ countdown.editFlag = false; countdown.description = countdown.new_description; Countdown.save(countdown); + if (!countdown.running) { + countdown.reset(); + } }; $scope.addCountdown = function () { var default_time = parseInt($scope.config('projector_default_countdown')); diff --git a/openslides/core/static/templates/core/manage-projectors.html b/openslides/core/static/templates/core/manage-projectors.html index 1dbc57fbe..89723e65a 100644 --- a/openslides/core/static/templates/core/manage-projectors.html +++ b/openslides/core/static/templates/core/manage-projectors.html @@ -130,8 +130,7 @@ -
- +
- - - diff --git a/openslides/motions/static/js/motions/site.js b/openslides/motions/static/js/motions/site.js index ec0cd25e3..e62356258 100644 --- a/openslides/motions/static/js/motions/site.js +++ b/openslides/motions/static/js/motions/site.js @@ -806,6 +806,25 @@ angular.module('OpenSlidesApp.motions.site', [ }); $scope.alert = {}; + // collect all states and all recommendations of all workflows + $scope.states = []; + $scope.recommendations = []; + var workflows = Workflow.getAll(); + _.forEach(workflows, function (workflow) { + var workflowHeader = { + headername: workflow.name, + workflowHeader: true, + }; + $scope.states.push(workflowHeader); + $scope.recommendations.push(workflowHeader); + _.forEach(workflow.states, function (state) { + $scope.states.push(state); + if (state.recommendation_label) { + $scope.recommendations.push(state); + } + }); + }); + // Filtering $scope.filter = osTableFilter.createInstance('MotionTableFilter'); @@ -814,7 +833,8 @@ angular.module('OpenSlidesApp.motions.site', [ state: [], category: [], motionBlock: [], - tag: [] + tag: [], + recommendation: [], }; } $scope.filter.propertyList = ['identifier', 'origin']; @@ -824,6 +844,7 @@ angular.module('OpenSlidesApp.motions.site', [ function (motion) {return motion.getReason();}, function (motion) {return motion.category ? motion.category.name : '';}, function (motion) {return motion.motionBlock ? motion.motionBlock.name : '';}, + function (motion) {return motion.recommendation ? motion.getRecommendationName() : '';}, ]; $scope.filter.propertyDict = { 'submitters' : function (submitter) { @@ -840,7 +861,8 @@ angular.module('OpenSlidesApp.motions.site', [ state: function (motion) {return motion.state_id;}, category: function (motion) {return motion.category_id;}, motionBlock: function (motion) {return motion.motion_block_id;}, - tag: function (motion) {return motion.tags_id;} + tag: function (motion) {return motion.tags_id;}, + recommendation: function (motion) {return motion.recommendation_id;}, }; // Sorting $scope.sort = osTableSort.createInstance(); @@ -864,30 +886,22 @@ angular.module('OpenSlidesApp.motions.site', [ display_name: 'Last modified'}, ]; - // collect all states of all workflows - // TODO: regard workflows only which are used by motions - $scope.states = []; - var workflows = Workflow.getAll(); - angular.forEach(workflows, function (workflow) { - if (workflows.length > 1) { - var wf = {}; - wf.name = workflow.name; - wf.workflowHeader = true; - $scope.states.push(wf); - } - angular.forEach(workflow.states, function (state) { - $scope.states.push(state); - }); - }); - // update state $scope.updateState = function (motion, state_id) { $http.put('/rest/motions/motion/' + motion.id + '/set_state/', {'state': state_id}); }; // reset state - $scope.reset_state = function (motion) { + $scope.resetState = function (motion) { $http.put('/rest/motions/motion/' + motion.id + '/set_state/', {}); }; + // update recommendation + $scope.updateRecommendation = function (motion, recommendation_id) { + $http.put('/rest/motions/motion/' + motion.id + '/set_recommendation/', {'recommendation': recommendation_id}); + }; + // reset recommendation + $scope.resetRecommendation = function (motion) { + $http.put('/rest/motions/motion/' + motion.id + '/set_recommendation/', {}); + }; $scope.hasTag = function (motion, tag) { return _.indexOf(motion.tags_id, tag.id) > -1; @@ -1166,7 +1180,7 @@ angular.module('OpenSlidesApp.motions.site', [ $scope.updateRecommendation = function (recommendation_id) { $http.put('/rest/motions/motion/' + motion.id + '/set_recommendation/', {'recommendation': recommendation_id}); }; - // reset state + // reset recommendation $scope.resetRecommendation = function () { $http.put('/rest/motions/motion/' + motion.id + '/set_recommendation/', {}); }; diff --git a/openslides/motions/static/templates/motions/motion-list.html b/openslides/motions/static/templates/motions/motion-list.html index eb1090d77..4bda569b7 100644 --- a/openslides/motions/static/templates/motions/motion-list.html +++ b/openslides/motions/static/templates/motions/motion-list.html @@ -121,7 +121,7 @@ + + + + Recommendation + + + + + + + + + {{ recommendation.recommendation_label | translate }} + + @@ -319,6 +357,7 @@ | MultiselectFilter: filter.multiselectFilters.state : getItemId.state | MultiselectFilter: filter.multiselectFilters.category : getItemId.category | MultiselectFilter: filter.multiselectFilters.motionBlock : getItemId.motionBlock + | MultiselectFilter: filter.multiselectFilters.recommendation : getItemId.recommendation | MultiselectFilter: filter.multiselectFilters.tag : getItemId.tag | toArray | orderBy: sort.column : sort.reverse)"> @@ -340,14 +379,17 @@ {{ motion.identifier }}
-
+
+ +
+ {{ motion.getStateName() }} @@ -359,7 +401,7 @@
  • - + Reset state @@ -368,6 +410,31 @@
  • + +
    + + + {{ motion.getRecommendationName() }} + + + + + + +