diff --git a/openslides/core/static/css/app.css b/openslides/core/static/css/app.css index a8e30f1b4..e27a2020f 100644 --- a/openslides/core/static/css/app.css +++ b/openslides/core/static/css/app.css @@ -605,9 +605,12 @@ img { opacity: 1; } .diff-box .action-row .btn-delete { - margin-left: 10px; + margin-left: 5px; color: red; } +.diff-box .action-row .btn-edit { + margin-left: 5px; +} .diff-box .status-row { font-style: italic; color: gray; diff --git a/openslides/motions/static/js/motions/motion-services.js b/openslides/motions/static/js/motions/motion-services.js index 95990e4cb..71f54f355 100644 --- a/openslides/motions/static/js/motions/motion-services.js +++ b/openslides/motions/static/js/motions/motion-services.js @@ -304,6 +304,10 @@ angular.module('OpenSlidesApp.motions.motionservices', ['OpenSlidesApp.motions', version = _version; }; + obj.editDialog = function(change_recommendation) { + ngDialog.open(ChangeRecommendationForm.getEditDialog(change_recommendation)); + }; + obj.init = function (_scope, _motion) { $scope = _scope; motion = _motion; diff --git a/openslides/motions/static/js/motions/site.js b/openslides/motions/static/js/motions/site.js index f5d9a7145..c09534d27 100644 --- a/openslides/motions/static/js/motions/site.js +++ b/openslides/motions/static/js/motions/site.js @@ -311,6 +311,20 @@ angular.module('OpenSlidesApp.motions.site', [ } }; }, + getEditDialog: function(change) { + return { + template: 'static/templates/motions/change-recommendation-form.html', + controller: 'ChangeRecommendationUpdateCtrl', + className: 'ngdialog-theme-default wide-form', + closeByEscape: false, + closeByDocument: false, + resolve: { + change: function() { + return change; + } + } + }; + }, // angular-formly fields for motion form getFormFields: function (line_from, line_to) { return [ @@ -1231,6 +1245,39 @@ angular.module('OpenSlidesApp.motions.site', [ } ]) +.controller('ChangeRecommendationUpdateCtrl', [ + '$scope', + 'MotionChangeRecommendation', + 'ChangeRecommendationForm', + 'change', + function ($scope, MotionChangeRecommendation, ChangeRecommendationForm, change) { + $scope.alert = {}; + $scope.model = angular.copy(change); + + // get all form fields + $scope.formFields = ChangeRecommendationForm.getFormFields(change.line_from, change.line_to); + // save motion + $scope.save = function (change) { + // inject the changed change recommendation (copy) object back into DS store + MotionChangeRecommendation.inject(change); + // save changed change recommendation object on server + MotionChangeRecommendation.save(change, { method: 'PATCH' }).then( + function(success) { + $scope.closeThisDialog(); + }, + function (error) { + MotionChangeRecommendation.refresh(change); + var message = ''; + for (var e in error.data) { + message += e + ': ' + error.data[e] + ' '; + } + $scope.alert = {type: 'danger', msg: message, show: true}; + } + ); + }; + } +]) + .controller('ChangeRecommendationCreateCtrl', [ '$scope', 'Motion', diff --git a/openslides/motions/static/templates/motions/motion-detail/view-diff.html b/openslides/motions/static/templates/motions/motion-detail/view-diff.html index d5f3ccc63..532985d35 100644 --- a/openslides/motions/static/templates/motions/motion-detail/view-diff.html +++ b/openslides/motions/static/templates/motions/motion-detail/view-diff.html @@ -30,6 +30,11 @@ title="{{ 'Delete' | translate }}"> + +
Rejected