Merge pull request #3162 from FinnStutzenstein/assignmentOrder

Fixing order for assignment poll form and translation for slide (fixe…
This commit is contained in:
Norman Jäckel 2017-03-28 13:39:09 +02:00 committed by GitHub
commit 0ab2503fdc
2 changed files with 12 additions and 27 deletions

View File

@ -742,27 +742,11 @@ angular.module('OpenSlidesApp.assignments.site', [
options.forEach(function(option) {
var defaultValue;
if (assignmentpoll.pollmethod == 'yna' || assignmentpoll.pollmethod == 'yn') {
if (assignmentpoll.pollmethod == 'yna') {
defaultValue = {
'yes': '',
'no': '',
'abstain': ''
};
}
else {
defaultValue = {
'yes': '',
'no': ''
};
}
defaultValue = {};
_.forEach(option.votes, function (vote) {
defaultValue[vote.value.toLowerCase()] = vote.weight;
});
if (option.votes.length) {
defaultValue.yes = option.votes[0].weight;
defaultValue.no = option.votes[1].weight;
if (assignmentpoll.pollmethod == 'yna'){
defaultValue.abstain = option.votes[2].weight;
}
}
$scope.formFields.push(
{
noFormControl: true,
@ -787,7 +771,8 @@ angular.module('OpenSlidesApp.assignments.site', [
required: true
},
defaultValue: defaultValue.no
});
}
);
if (assignmentpoll.pollmethod == 'yna'){
$scope.formFields.push(
{
@ -801,7 +786,7 @@ angular.module('OpenSlidesApp.assignments.site', [
defaultValue: defaultValue.abstain
});
}
} else {
} else { // votes method
if (option.votes.length) {
defaultValue = option.votes[0].weight;
}

View File

@ -48,12 +48,12 @@
<div ng-init="votes = option.getVotes()">
<div ng-show="poll.pollmethod == 'yna' || poll.pollmethod == 'yn'">
<span ng-show="poll.pollmethod == 'yna'">
{{ votes[0].label }}: {{ votes[0].value }} ·
{{ votes[1].label }}: {{ votes[1].value }} ·
{{ votes[2].label }}: {{ votes[2].value }} </span>
{{ votes[0].label | translate }}: {{ votes[0].value }} ·
{{ votes[1].label | translate }}: {{ votes[1].value }} ·
{{ votes[2].label | translate }}: {{ votes[2].value }} </span>
<span ng-show="poll.pollmethod == 'yn'">
{{ votes[0].label }}: {{ votes[0].value }} ·
{{ votes[1].label }}: {{ votes[1].value }}</span>
{{ votes[0].label | translate }}: {{ votes[0].value }} ·
{{ votes[1].label | translate }}: {{ votes[1].value }}</span>
<uib-progress ng-if="votes[0].percentNumber>=0">
<uib-bar value="votes[0].percentNumber" type="success">
<span ng-hide="votes[0].percentNumber < 5">{{votes[0].percentNumber}} %</span>