From 38279f4895383a11fcf7b2e06d094c01c35d142a Mon Sep 17 00:00:00 2001 From: FinnStutzenstein Date: Mon, 6 Feb 2017 15:55:32 +0100 Subject: [PATCH] Inline edit the ballot description (closes #2560) --- CHANGELOG | 1 + .../assignments/static/js/assignments/site.js | 16 ++++++---------- .../templates/assignments/assignment-detail.html | 10 ++++++++-- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index f75403a58..0c507f8f6 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -76,6 +76,7 @@ Elections: - Candidates are now sortable. - Removed unused assignment config to publish winner election results only. - Number of ballots printed can now be set in config. +- Added inline edit field for a specific hint on ballot papers. Users: - Added new matrix-interface for managing groups and their permissions. diff --git a/openslides/assignments/static/js/assignments/site.js b/openslides/assignments/static/js/assignments/site.js index 0f103511b..578f1b9a2 100644 --- a/openslides/assignments/static/js/assignments/site.js +++ b/openslides/assignments/static/js/assignments/site.js @@ -205,7 +205,8 @@ angular.module('OpenSlidesApp.assignments.site', [ 'MajorityMethodChoices', 'Config', 'AssignmentPollDetailCtrlCache', - function ($scope, MajorityMethodChoices, Config, AssignmentPollDetailCtrlCache) { + 'AssignmentPoll', + function ($scope, MajorityMethodChoices, Config, AssignmentPollDetailCtrlCache, AssignmentPoll) { // Define choices. $scope.methodChoices = MajorityMethodChoices; // TODO: Get $scope.baseChoices from config_variables.py without copying them. @@ -228,6 +229,10 @@ angular.module('OpenSlidesApp.assignments.site', [ }; $scope.recalculateMajorities($scope.method); + $scope.saveDescriptionChange = function (poll) { + AssignmentPoll.save(poll); + }; + // Save current values to cache on destroy of this controller. $scope.$on('$destroy', function() { AssignmentPollDetailCtrlCache[$scope.poll.id] = { @@ -814,15 +819,6 @@ angular.module('OpenSlidesApp.assignments.site', [ label: gettextCatalog.getString('Casted ballots'), type: 'number' } - }, - // TODO: update description in separat request - // (without vote result values) - { - key: 'description', - type: 'input', - templateOptions: { - label: gettextCatalog.getString('Comment on the ballot paper') - } } ); diff --git a/openslides/assignments/static/templates/assignments/assignment-detail.html b/openslides/assignments/static/templates/assignments/assignment-detail.html index b764ce52e..b41c4ac30 100644 --- a/openslides/assignments/static/templates/assignments/assignment-detail.html +++ b/openslides/assignments/static/templates/assignments/assignment-detail.html @@ -133,7 +133,13 @@ index="$index" heading="{{ 'Ballot' | translate }} {{ assignment.polls.length - $index }}">
-
+
+ + Set hint for ballot paper ... + {{ poll.description }} + + Delete
-
+