Update state field when following a recommendation

This commit is contained in:
FinnStutzenstein 2017-10-27 12:36:31 +02:00
parent 73407133bd
commit 1c508765fa
2 changed files with 6 additions and 1 deletions

View File

@ -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});

View File

@ -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">
<i class="fa fa-magic"></i>
<translate>Follow recommendation</translate>