diff --git a/openslides/assignments/static/js/assignments/site.js b/openslides/assignments/static/js/assignments/site.js index c69597df2..2522250ed 100644 --- a/openslides/assignments/static/js/assignments/site.js +++ b/openslides/assignments/static/js/assignments/site.js @@ -741,6 +741,9 @@ angular.module('OpenSlidesApp.assignments.site', ['OpenSlidesApp.assignments']) gettext('Elections'); gettext('Ballot and ballot papers'); gettext('The 100 % base of an election result consists of'); + gettext('All valid votes (Yes/No/Abstain)'); + gettext('All votes cast (including invalid votes)'); + gettext('Disabled (no percents)'); gettext('Number of ballot papers (selection)'); gettext('Number of all delegates'); gettext('Number of all participants'); diff --git a/openslides/motions/config_variables.py b/openslides/motions/config_variables.py index f71902cda..ac16c1e08 100644 --- a/openslides/motions/config_variables.py +++ b/openslides/motions/config_variables.py @@ -1,5 +1,4 @@ from django.core.validators import MinValueValidator -from django.utils.translation import ugettext_lazy from openslides.core.config import ConfigVariable from openslides.poll.models import PERCENT_BASE_CHOICES @@ -24,10 +23,10 @@ def get_config_variables(): papers' and 'PDF'. The generator has to be evaluated during app loading (see apps.py). """ - percent_base_choices_motion = PERCENT_BASE_CHOICES - percent_base_choices_motion += ({ + PERCENT_BASE_CHOICES_MOTION = ({ 'value': "WITHOUT_ABSTAIN", - 'display_name': ugettext_lazy('Yes and No votes')},) + 'display_name': 'Yes and No votes'},) + PERCENT_BASE_CHOICES_MOTION += PERCENT_BASE_CHOICES # General yield ConfigVariable( name='motions_workflow', @@ -153,7 +152,7 @@ def get_config_variables(): default_value='WITHOUT_INVALID', input_type='choice', label='The 100 % base of a voting result consists of', - choices=percent_base_choices_motion, + choices=PERCENT_BASE_CHOICES_MOTION, weight=355, group='Motions', subgroup='Voting and ballot papers') diff --git a/openslides/motions/static/js/motions/base.js b/openslides/motions/static/js/motions/base.js index cf94e940c..43b7fe983 100644 --- a/openslides/motions/static/js/motions/base.js +++ b/openslides/motions/static/js/motions/base.js @@ -95,8 +95,8 @@ angular.module('OpenSlidesApp.motions', [ percentNumber = Math.round(vote * 100 / this.votesvalid * 10) / 10; } else if (config == "WITH_INVALID" && this.votescast > 0 && vote >= 0) { percentNumber = Math.round(vote * 100 / (this.votescast) * 10) / 10; - } else if (config == "WITHOUT_ABSTAIN" && this.votesvalid > 0 && vote >= 0){ - if (type == 'yes' || type == 'no') { + } else if (config == "WITHOUT_ABSTAIN" && vote >= 0) { + if (type == 'yes' || type == 'no') { percentNumber = Math.round(vote * 100 / (this.yes + this.no) * 10) / 10; } } diff --git a/openslides/motions/static/js/motions/site.js b/openslides/motions/static/js/motions/site.js index 24f40883e..d8e8626d9 100644 --- a/openslides/motions/static/js/motions/site.js +++ b/openslides/motions/static/js/motions/site.js @@ -70,14 +70,14 @@ angular.module('OpenSlidesApp.motions.site', ['OpenSlidesApp.motions', 'OpenSlid results = function() { return motion.polls.map(function(poll, index) { var id = index + 1, - yes = poll.yes ? poll.yes : 0, // if no poll.yes is given, set it to 0 + yes = poll.yes ? poll.yes : '-', // if no poll.yes is given set it to '-' yesRelative = poll.getVote(poll.yes, 'yes').percentStr, - no = poll.no ? poll.no : 0, + no = poll.no ? poll.no : '-', noRelative = poll.getVote(poll.no, 'no').percentStr, - abstain = poll.abstain ? poll.abstain : 0, + abstain = poll.abstain ? poll.abstain : '-', abstainrelativeGet = poll.getVote(poll.abstain, 'abstain').percentStr, - abstainRelative = abstainrelativeGet? abstainrelativeGet : "", - valid = poll.votesvalid, + abstainRelative = abstainrelativeGet ? abstainrelativeGet : '', + valid = poll.votesvalid ? poll.votesvalid : '-', validRelative = poll.getVote(poll.votesvalid, 'votesvalid').percentStr, number = { text: id + ".", @@ -1570,29 +1570,17 @@ angular.module('OpenSlidesApp.motions.site', ['OpenSlidesApp.motions', 'OpenSlid .config([ 'gettext', function (gettext) { - gettext('The assembly may decide,'); - gettext('Workflow of new motions'); gettext('Motions'); + + // subgroup General + gettext('General'); + gettext('Workflow of new motions'); gettext('Identifier'); gettext('Numbered per category'); gettext('Serially numbered'); gettext('Set it manually'); gettext('Motion preamble'); - gettext('Stop submitting new motions by non-staff users'); - gettext('Allow to disable versioning'); - gettext('Activate amendments'); - gettext('Amendments'); - gettext('Prefix for the identifier for amendments'); - gettext('Number of (minimum) required supporters for a motion'); - gettext('Choose 0 to disable the supporting system.'); - gettext('Supporters'); - gettext('Remove all supporters of a motion if a submitter edits his ' + - 'motion in early state'); - gettext('Title for PDF document (all motions)'); - gettext('Preamble text for PDF document (all motioqns)'); - gettext('Show paragraph numbering (only in PDF)'); - /// Prefix for the identifier for amendments - gettext('A'); + gettext('The assembly may decide,'); gettext('Default line numbering'); /// Line numbering: Outside gettext('Outside'); @@ -1602,6 +1590,40 @@ angular.module('OpenSlidesApp.motions.site', ['OpenSlidesApp.motions', 'OpenSlid gettext('None'); gettext('Line length'); gettext('The maximum number of characters per line. Relevant when line numbering is enabled. Min: 40'); + gettext('Stop submitting new motions by non-staff users'); + gettext('Allow to disable versioning'); + + // subgroup Amendments + gettext('Amendments'); + gettext('Activate amendments'); + gettext('Prefix for the identifier for amendments'); + /// Prefix for the identifier for amendments + gettext('A'); + + // subgroup Suppoerters + gettext('Supporters'); + gettext('Number of (minimum) required supporters for a motion'); + gettext('Choose 0 to disable the supporting system.'); + gettext('Remove all supporters of a motion if a submitter edits his ' + + 'motion in early state'); + + // subgroup Voting and ballot papers + gettext('Voting and ballot papers'); + gettext('The 100 % base of a voting result consists of'); + gettext('All valid votes (Yes/No/Abstain)'); + gettext('All votes cast (including invalid votes)'); + gettext('Disabled (no percents)'); + gettext('Yes and No votes'); + gettext('Number of ballot papers (selection)'); + gettext('Number of all delegates'); + gettext('Number of all participants'); + gettext('Use the following custom number'); + gettext('Custom number of ballot papers'); + + // subgroup PDF + gettext('Title for PDF document (all motions)'); + gettext('Preamble text for PDF document (all motioqns)'); + gettext('Show paragraph numbering (only in PDF)'); } ]); diff --git a/openslides/motions/static/templates/motions/motion-detail.html b/openslides/motions/static/templates/motions/motion-detail.html index c1e33d77d..f76fbb933 100644 --- a/openslides/motions/static/templates/motions/motion-detail.html +++ b/openslides/motions/static/templates/motions/motion-detail.html @@ -184,7 +184,7 @@ - + @@ -193,7 +193,7 @@ {{ votesValid.value }} {{ votesValid.percentStr }} - + @@ -205,7 +205,7 @@ - + diff --git a/openslides/motions/static/templates/motions/slide_motion.html b/openslides/motions/static/templates/motions/slide_motion.html index d19789357..32db12bea 100644 --- a/openslides/motions/static/templates/motions/slide_motion.html +++ b/openslides/motions/static/templates/motions/slide_motion.html @@ -52,7 +52,7 @@ {{ voteAbstain.value }} {{ voteAbstain.percentStr }} -
+
diff --git a/openslides/poll/models.py b/openslides/poll/models.py index e05663af8..d0891a675 100644 --- a/openslides/poll/models.py +++ b/openslides/poll/models.py @@ -3,7 +3,6 @@ import locale from django.core.exceptions import ObjectDoesNotExist from django.db import models from django.utils.translation import ugettext as _ -from django.utils.translation import ugettext_lazy from openslides.utils.models import MinMaxIntegerField @@ -67,9 +66,9 @@ class BaseVote(models.Model): return print_value(self.weight, percent_base) PERCENT_BASE_CHOICES = ( - {'value': 'WITHOUT_INVALID', 'display_name': ugettext_lazy('All valid votes (Yes/No/Abstain)')}, - {'value': 'WITH_INVALID', 'display_name': ugettext_lazy('All votes cast (including invalid votes)')}, - {'value': 'DISABLED', 'display_name': ugettext_lazy('Disabled (no percents)')}) + {'value': 'WITHOUT_INVALID', 'display_name': 'All valid votes (Yes/No/Abstain)'}, + {'value': 'WITH_INVALID', 'display_name': 'All votes cast (including invalid votes)'}, + {'value': 'DISABLED', 'display_name': 'Disabled (no percents)'}) class CollectDefaultVotesMixin(models.Model): @@ -118,11 +117,9 @@ class CollectDefaultVotesMixin(models.Model): return value def get_percent_base(self): - if self.get_percent_base_choice() == "WITHOUT_INVALID" and\ - self.votesvalid and self.votesvalid > 0: + if self.get_percent_base_choice() == "WITHOUT_INVALID" and self.votesvalid and self.votesvalid > 0: base = 100 / float(self.votesvalid) - elif self.get_percent_base_choice() == "WITH_INVALID" and\ - self.votescast and self.votescast > 0: + elif self.get_percent_base_choice() == "WITH_INVALID" and self.votescast and self.votescast > 0: base = 100 / float(self.votescast) else: base = None