From 1c508765fae9dea0aa49236a727ce61ce32323a0 Mon Sep 17 00:00:00 2001 From: FinnStutzenstein Date: Fri, 27 Oct 2017 12:36:31 +0200 Subject: [PATCH] Update state field when following a recommendation --- openslides/motions/static/js/motions/site.js | 5 +++++ .../motions/static/templates/motions/motion-detail.html | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/openslides/motions/static/js/motions/site.js b/openslides/motions/static/js/motions/site.js index 69fd48fd5..e2adecc5e 100644 --- a/openslides/motions/static/js/motions/site.js +++ b/openslides/motions/static/js/motions/site.js @@ -1372,6 +1372,11 @@ angular.module('OpenSlidesApp.motions.site', [ dialog.scope = $scope; ngDialog.open(dialog); }; + // follow recommendation + $scope.followRecommendation = function () { + $scope.updateState($scope.motion.recommendation.id); + $scope.saveAdditionalStateField($scope.recommendationExtension); + }; // update state $scope.updateState = function (state_id) { $http.put('/rest/motions/motion/' + motion.id + '/set_state/', {'state': state_id}); diff --git a/openslides/motions/static/templates/motions/motion-detail.html b/openslides/motions/static/templates/motions/motion-detail.html index faa9c678a..d7ca5c3ff 100644 --- a/openslides/motions/static/templates/motions/motion-detail.html +++ b/openslides/motions/static/templates/motions/motion-detail.html @@ -219,7 +219,7 @@ ng-if="motion.recommendation && motion.isAllowed('change_state') && motion.state.next_states_id.indexOf(motion.recommendation.id) !== -1" - ng-click="updateState(motion.recommendation.id)" + ng-click="followRecommendation()" class="btn btn-default btn-sm"> Follow recommendation