From 7967da0b4e8c5fd0f05bcb2541897b4c72d41aab Mon Sep 17 00:00:00 2001 From: Emanuel Schuetze Date: Sun, 17 Jan 2016 22:32:12 +0100 Subject: [PATCH] Allow 'trivial changes' in motion update (Fixes #1863) --- openslides/motions/static/js/motions/site.js | 21 ++++++++++++++----- .../templates/motions/motion-detail.html | 2 +- .../templates/motions/slide_motion.html | 2 +- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/openslides/motions/static/js/motions/site.js b/openslides/motions/static/js/motions/site.js index 5689bc0be..bc5377053 100644 --- a/openslides/motions/static/js/motions/site.js +++ b/openslides/motions/static/js/motions/site.js @@ -215,6 +215,15 @@ angular.module('OpenSlidesApp.motions.site', ['OpenSlidesApp.motions']) }, ngModelElAttrs: {'ckeditor': 'CKEditorOptions'} }, + { + key: 'disable_versioning', + type: 'checkbox', + templateOptions: { + label: gettextCatalog.getString('Trivial change'), + description: gettextCatalog.getString("Don't create a new version.") + }, + hide: true + }, { key: 'more', type: 'checkbox', @@ -574,11 +583,6 @@ angular.module('OpenSlidesApp.motions.site', ['OpenSlidesApp.motions']) $scope.model.workflow_id = Config.get('motions_workflow').value; // get all form fields $scope.formFields = MotionForm.getFormFields(); - for (var i = 0; i < $scope.formFields.length; i++) { - if ($scope.formFields[i].key == "identifier") { - $scope.formFields[i].hide = true; - } - } // save motion $scope.save = function (motion) { Motion.create(motion).then( @@ -635,6 +639,13 @@ angular.module('OpenSlidesApp.motions.site', ['OpenSlidesApp.motions']) // get reason of latest version $scope.formFields[i].defaultValue = motion.getReason(-1); } + if ($scope.formFields[i].key == "disable_versioning" && + Config.get('motions_allow_disable_versioning')) { + // check current state if versioning is active + if (motion.state.versioning) { + $scope.formFields[i].hide = false; + } + } if ($scope.formFields[i].key == "workflow_id") { // get saved workflow id from state $scope.formFields[i].defaultValue = motion.state.workflow_id; diff --git a/openslides/motions/static/templates/motions/motion-detail.html b/openslides/motions/static/templates/motions/motion-detail.html index 178294115..67c611644 100644 --- a/openslides/motions/static/templates/motions/motion-detail.html +++ b/openslides/motions/static/templates/motions/motion-detail.html @@ -31,7 +31,7 @@

{{ motion.getTitle() }}

Motion {{ motion.identifier }} - | Version {{ motion.active_version }} + | Version {{ motion.getVersion().version_number }} Agenda: {{ motion.agenda_item.item_number }} diff --git a/openslides/motions/static/templates/motions/slide_motion.html b/openslides/motions/static/templates/motions/slide_motion.html index ca0546b1e..b020ddc83 100644 --- a/openslides/motions/static/templates/motions/slide_motion.html +++ b/openslides/motions/static/templates/motions/slide_motion.html @@ -17,7 +17,7 @@

{{ motion.getTitle() }}

Motion {{ motion.identifier }} - | Version {{ motion.active_version }} + | Version {{ motion.getVersion().version_number }}