diff --git a/openslides/agenda/static/templates/agenda/item-list.html b/openslides/agenda/static/templates/agenda/item-list.html index 0ca7023d3..7a0e0fe49 100644 --- a/openslides/agenda/static/templates/agenda/item-list.html +++ b/openslides/agenda/static/templates/agenda/item-list.html @@ -78,7 +78,7 @@ Sort ... - Numbering @@ -325,6 +325,15 @@ + + + + + Set item number ... + Change item number ... + + + diff --git a/openslides/assignments/static/js/assignments/site.js b/openslides/assignments/static/js/assignments/site.js index 7418aa275..03b96d794 100644 --- a/openslides/assignments/static/js/assignments/site.js +++ b/openslides/assignments/static/js/assignments/site.js @@ -632,18 +632,19 @@ angular.module('OpenSlidesApp.assignments.site', [ .controller('AssignmentCreateCtrl', [ '$scope', + '$state', 'Assignment', 'AssignmentForm', 'Agenda', 'AgendaUpdate', - function($scope, Assignment, AssignmentForm, Agenda, AgendaUpdate) { + function($scope, $state, Assignment, AssignmentForm, Agenda, AgendaUpdate) { $scope.model = {}; // set default value for open posts form field $scope.model.open_posts = 1; // get all form fields $scope.formFields = AssignmentForm.getFormFields(true); // save assignment - $scope.save = function(assignment) { + $scope.save = function(assignment, gotoDetailView) { Assignment.create(assignment).then( function(success) { // type: Value 1 means a non hidden agenda item, value 2 means a hidden agenda item, @@ -651,6 +652,9 @@ angular.module('OpenSlidesApp.assignments.site', [ var changes = [{key: 'type', value: (assignment.showAsAgendaItem ? 1 : 2)}, {key: 'parent_id', value: assignment.agenda_parent_item_id}]; AgendaUpdate.saveChanges(success.agenda_item_id,changes); + if (gotoDetailView) { + $state.go('assignments.assignment.detail', {id: success.id}); + } $scope.closeThisDialog(); } ); @@ -660,12 +664,13 @@ angular.module('OpenSlidesApp.assignments.site', [ .controller('AssignmentUpdateCtrl', [ '$scope', + '$state', 'Assignment', 'AssignmentForm', 'Agenda', 'AgendaUpdate', 'assignmentId', - function($scope, Assignment, AssignmentForm, Agenda, AgendaUpdate, assignmentId) { + function($scope, $state, Assignment, AssignmentForm, Agenda, AgendaUpdate, assignmentId) { var assignment = Assignment.get(assignmentId); $scope.alert = {}; // set initial values for form model by create deep copy of assignment object @@ -684,7 +689,7 @@ angular.module('OpenSlidesApp.assignments.site', [ } // save assignment - $scope.save = function (assignment) { + $scope.save = function (assignment, gotoDetailView) { // inject the changed assignment (copy) object back into DS store Assignment.inject(assignment); // save change assignment object on server @@ -693,6 +698,9 @@ angular.module('OpenSlidesApp.assignments.site', [ var changes = [{key: 'type', value: (assignment.showAsAgendaItem ? 1 : 2)}, {key: 'parent_id', value: assignment.agenda_parent_item_id}]; AgendaUpdate.saveChanges(success.agenda_item_id,changes); + if (gotoDetailView) { + $state.go('assignments.assignment.detail', {id: success.id}); + } $scope.closeThisDialog(); }, function (error) { diff --git a/openslides/assignments/static/templates/assignments/assignment-form.html b/openslides/assignments/static/templates/assignments/assignment-form.html index 3fd6de432..1e3ab0928 100644 --- a/openslides/assignments/static/templates/assignments/assignment-form.html +++ b/openslides/assignments/static/templates/assignments/assignment-form.html @@ -5,8 +5,13 @@ {{ alert.msg }} - + + + + + Open election detail view after save. + Save diff --git a/openslides/core/static/css/app.css b/openslides/core/static/css/app.css index 302a8b70b..827827b59 100644 --- a/openslides/core/static/css/app.css +++ b/openslides/core/static/css/app.css @@ -384,9 +384,6 @@ img { opacity: 1; background-color: #eee; } -.col1 .details .motion-toolbar .toolbar-left .goto-line-number { - max-width: 220px; -} .col1 .details .inline-editing-activator { margin-right: 13px; @@ -1642,6 +1639,10 @@ tr.selected td { background-color: #ff9999; } +/** Angular formly **/ +.checkbox label { + padding-left: 0; +} /** Colors **/ diff --git a/openslides/core/static/js/core/site.js b/openslides/core/static/js/core/site.js index cae342285..f268ce039 100644 --- a/openslides/core/static/js/core/site.js +++ b/openslides/core/static/js/core/site.js @@ -634,6 +634,11 @@ angular.module('OpenSlidesApp.core.site', [ extends: 'input', templateUrl: 'static/templates/core/password.html', }); + formlyConfig.setType({ + name: 'checkbox', + templateUrl: 'static/templates/core/checkbox.html', + overwriteOk: true, + }); formlyConfig.setType({ name: 'select-single', extends: 'select', diff --git a/openslides/core/static/templates/core/checkbox.html b/openslides/core/static/templates/core/checkbox.html new file mode 100644 index 000000000..da3bf5403 --- /dev/null +++ b/openslides/core/static/templates/core/checkbox.html @@ -0,0 +1,7 @@ + + + + {{to.label}} + {{to.required ? '*' : ''}} + + diff --git a/openslides/motions/static/js/motions/site.js b/openslides/motions/static/js/motions/site.js index 248bbd778..e40e8e174 100644 --- a/openslides/motions/static/js/motions/site.js +++ b/openslides/motions/static/js/motions/site.js @@ -995,6 +995,7 @@ angular.module('OpenSlidesApp.motions.site', [ .controller('MotionDetailCtrl', [ '$scope', '$http', + '$timeout', 'operator', 'ngDialog', 'MotionForm', @@ -1015,16 +1016,18 @@ angular.module('OpenSlidesApp.motions.site', [ 'MotionCommentsInlineEditing', 'Projector', 'ProjectionDefault', - function($scope, $http, operator, ngDialog, MotionForm, + 'MotionBlock', + function($scope, $http, $timeout, operator, ngDialog, MotionForm, ChangeRecommmendationCreate, ChangeRecommmendationView, MotionChangeRecommendation, MotionPDFExport, Motion, MotionComment, Category, Mediafile, Tag, User, Workflow, Config, motionId, MotionInlineEditing, - MotionCommentsInlineEditing, Projector, ProjectionDefault) { + MotionCommentsInlineEditing, Projector, ProjectionDefault, MotionBlock) { var motion = Motion.get(motionId); Category.bindAll({}, $scope, 'categories'); Mediafile.bindAll({}, $scope, 'mediafiles'); Tag.bindAll({}, $scope, 'tags'); User.bindAll({}, $scope, 'users'); Workflow.bindAll({}, $scope, 'workflows'); + MotionBlock.bindAll({}, $scope, 'motionBlocks'); $scope.$watch(function () { return MotionChangeRecommendation.lastModified(); }, function () { @@ -1132,6 +1135,10 @@ angular.module('OpenSlidesApp.motions.site', [ $('html, body').animate({ 'scrollTop': scrollTop - 50 }, 1000); + // remove the line highlight after 2 seconds. + $timeout(function () { + $scope.highlight = 0; + }, 2000); } // set highlight and scroll on Projector setHighlightOnProjector($scope.linesForProjector ? line : 0); @@ -1148,6 +1155,12 @@ angular.module('OpenSlidesApp.motions.site', [ } ngDialog.open(MotionForm.getDialog(motion)); }; + $scope.save = function (motion) { + motion.title = motion.getTitle(-1); + motion.text = motion.getText(-1); + motion.reason = motion.getReason(-1); + Motion.save(motion); + }; // support $scope.support = function () { $http.post('/rest/motions/motion/' + motion.id + '/support/'); @@ -1173,24 +1186,49 @@ angular.module('OpenSlidesApp.motions.site', [ $scope.reset_state = function () { $http.put('/rest/motions/motion/' + motion.id + '/set_state/', {}); }; + // toggle functions for meta information + $scope.toggleCategory = function (category) { + if ($scope.motion.category_id == category.id) { + $scope.motion.category_id = null; + } else { + $scope.motion.category_id = category.id; + } + $scope.save($scope.motion); + }; + $scope.toggleMotionBlock = function (block) { + if ($scope.motion.motion_block_id == block.id) { + $scope.motion.motion_block_id = null; + } else { + $scope.motion.motion_block_id = block.id; + } + $scope.save($scope.motion); + + }; + $scope.toggleTag = function (tag) { + if (_.indexOf($scope.motion.tags_id, tag.id) > -1) { + // remove + $scope.motion.tags_id = _.filter($scope.motion.tags_id, + function (tag_id){ + return tag_id != tag.id; + } + ); + } else { + $scope.motion.tags_id.push(tag.id); + } + $scope.save($scope.motion); + }; // save additional state field $scope.saveAdditionalStateField = function (stateExtension) { if (stateExtension) { motion["comment " + $scope.commentFieldForState] = stateExtension; - motion.title = motion.getTitle(-1); - motion.text = motion.getText(-1); - motion.reason = motion.getReason(-1); - Motion.save(motion); + $scope.save(motion); } }; // save additional recommendation field $scope.saveAdditionalRecommendationField = function (recommendationExtension) { if (recommendationExtension) { motion["comment " + $scope.commentFieldForRecommendation] = recommendationExtension; - motion.title = motion.getTitle(-1); - motion.text = motion.getText(-1); - motion.reason = motion.getReason(-1); - Motion.save(motion); + $scope.save(motion); } }; // update recommendation @@ -1414,7 +1452,7 @@ angular.module('OpenSlidesApp.motions.site', [ $scope.formFields = MotionForm.getFormFields(true); // save motion - $scope.save = function (motion) { + $scope.save = function (motion, gotoDetailView) { Motion.create(motion).then( function(success) { // type: Value 1 means a non hidden agenda item, value 2 means a hidden agenda item, @@ -1422,7 +1460,7 @@ angular.module('OpenSlidesApp.motions.site', [ var changes = [{key: 'type', value: (motion.showAsAgendaItem ? 1 : 2)}, {key: 'parent_id', value: motion.agenda_parent_item_id}]; AgendaUpdate.saveChanges(success.agenda_item_id, changes); - if (isAmendment) { + if (isAmendment || gotoDetailView) { $state.go('motions.motion.detail', {id: success.id}); } $scope.closeThisDialog(); @@ -1434,6 +1472,7 @@ angular.module('OpenSlidesApp.motions.site', [ .controller('MotionUpdateCtrl', [ '$scope', + '$state', 'Motion', 'Category', 'Config', @@ -1445,7 +1484,8 @@ angular.module('OpenSlidesApp.motions.site', [ 'Agenda', 'AgendaUpdate', 'motionId', - function($scope, Motion, Category, Config, Mediafile, MotionForm, Tag, User, Workflow, Agenda, AgendaUpdate, motionId) { + function($scope, $state, Motion, Category, Config, Mediafile, MotionForm, Tag, + User, Workflow, Agenda, AgendaUpdate, motionId) { Category.bindAll({}, $scope, 'categories'); Mediafile.bindAll({}, $scope, 'mediafiles'); Tag.bindAll({}, $scope, 'tags'); @@ -1501,7 +1541,7 @@ angular.module('OpenSlidesApp.motions.site', [ } // save motion - $scope.save = function (motion) { + $scope.save = function (motion, gotoDetailView) { // inject the changed motion (copy) object back into DS store Motion.inject(motion); // save change motion object on server @@ -1512,6 +1552,9 @@ angular.module('OpenSlidesApp.motions.site', [ var changes = [{key: 'type', value: (motion.showAsAgendaItem ? 1 : 2)}, {key: 'parent_id', value: motion.agenda_parent_item_id}]; AgendaUpdate.saveChanges(success.agenda_item_id,changes); + if (gotoDetailView) { + $state.go('motions.motion.detail', {id: success.id}); + } $scope.closeThisDialog(); }, function (error) { diff --git a/openslides/motions/static/templates/motions/motion-detail.html b/openslides/motions/static/templates/motions/motion-detail.html index ef553b160..094e2d7b1 100644 --- a/openslides/motions/static/templates/motions/motion-detail.html +++ b/openslides/motions/static/templates/motions/motion-detail.html @@ -132,10 +132,10 @@ State - + State - + {{ state.action_word | translate }} @@ -171,10 +171,10 @@ - + {{ config('motions_recommendations_by') }} - + @@ -189,11 +189,11 @@ - + {{ motion.getRecommendationName() }} + ng-if="motion.recommendation.show_recommendation_extension_field"> {{ commentFieldForRecommendation }} - Category + Category + + + + Category + + + + + + + {{ category.name }} + + + + + {{ motion.category.name }} - Motion block + Motion block + + + + Motion block + + + + + + + {{ motionBlock.title }} + + + + + {{ motion.motionBlock.title }} {{ motion.motionBlock.title }} - Tags + Tags + + + + Tags + + + + + + + {{ tag.name }} + + + + + {{ tag.name }}{{$last ? '' : ', '}} diff --git a/openslides/motions/static/templates/motions/motion-detail/toolbar.html b/openslides/motions/static/templates/motions/motion-detail/toolbar.html index 6b4899456..fd7dabc0b 100644 --- a/openslides/motions/static/templates/motions/motion-detail/toolbar.html +++ b/openslides/motions/static/templates/motions/motion-detail/toolbar.html @@ -48,28 +48,23 @@ - - - - - - - - - - go - - - - - - - + + + + + + + go + + + + + + diff --git a/openslides/motions/static/templates/motions/motion-form.html b/openslides/motions/static/templates/motions/motion-form.html index 6495c665e..4129515ca 100644 --- a/openslides/motions/static/templates/motions/motion-form.html +++ b/openslides/motions/static/templates/motions/motion-form.html @@ -6,8 +6,13 @@ {{ alert.msg }} - + + + + + Open motion detail view after save. + Save