diff --git a/openslides/assignments/static/js/assignments/base.js b/openslides/assignments/static/js/assignments/base.js index 719c6c880..e09cd9135 100644 --- a/openslides/assignments/static/js/assignments/base.js +++ b/openslides/assignments/static/js/assignments/base.js @@ -33,7 +33,8 @@ angular.module('OpenSlidesApp.assignments', []) _.forEach(this.votes, function (vote) { // Initial values for the vote - var value = '', + var order = '', + value = '', percentStr = '', percentNumber; @@ -52,6 +53,19 @@ angular.module('OpenSlidesApp.assignments', []) value = 0; // Vote was not defined. Set value to 0. } } + switch (vote.value) { + case "Yes": + order = 1; + break; + case "No": + order = 2; + break; + case "Abstain": + order = 3; + break; + default: + order = 0; + } // Special case where to skip percents var skipPercents = config === 'YES_NO' && vote.value === 'Abstain'; @@ -61,13 +75,14 @@ angular.module('OpenSlidesApp.assignments', []) percentStr = "(" + percentNumber + "%)"; } votes.push({ + 'order': order, 'label': gettextCatalog.getString(vote.value), 'value': value, 'percentStr': percentStr, 'percentNumber': percentNumber }); }); - return votes; + return _.sortBy(votes, 'order'); }, // Returns 0 or positive integer if quorum is reached or surpassed. diff --git a/openslides/assignments/static/templates/assignments/slide_assignment.html b/openslides/assignments/static/templates/assignments/slide_assignment.html index 0973e7a9b..7882302dd 100644 --- a/openslides/assignments/static/templates/assignments/slide_assignment.html +++ b/openslides/assignments/static/templates/assignments/slide_assignment.html @@ -48,11 +48,11 @@