Merge pull request #3735 from FinnStutzenstein/improvements

Fixed percentage for special values (fixes #3736), added config to couple the candidates with the list of speakers (closes #3737)
This commit is contained in:
Emanuel Schütze 2018-05-15 09:26:31 +02:00 committed by GitHub
commit ea8a540a71
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 22 additions and 9 deletions

View File

@ -55,6 +55,15 @@ def get_config_variables():
group='Elections',
subgroup='Ballot and ballot papers')
yield ConfigVariable(
name='assignments_add_candidates_to_list_of_speakers',
default_value=True,
input_type='boolean',
label='Put all candidates on the list of speakers',
weight=428,
group='Elections',
subgroup='Ballot and ballot papers')
yield ConfigVariable(
name='assignments_pdf_ballot_papers_selection',
default_value='CUSTOM_NUMBER',

View File

@ -285,6 +285,7 @@ class Assignment(RESTModelMixin, models.Model):
# Add all candidates to list of speakers of related agenda item
# TODO: Try to do this in a bulk create
if config['assignments_add_candidates_to_list_of_speakers']:
for candidate in self.candidates:
try:
Speaker.objects.add(candidate, self.agenda_item, skip_autoupdate=True)

View File

@ -72,7 +72,9 @@ angular.module('OpenSlidesApp.assignments', [])
if (base && !skipPercents) {
percentNumber = Math.round(vote.weight * 100 / base * 100) / 100;
percentStr = "(" + percentNumber + "%)";
if (percentNumber >= 0) {
percentStr = '(' + percentNumber + ' %)';
}
}
votes.push({
'order': order,

View File

@ -875,6 +875,7 @@ angular.module('OpenSlidesApp.assignments.site', [
gettext('Two-thirds majority');
gettext('Three-quarters majority');
gettext('Disabled');
gettext('Put all candidates on the list of speakers');
gettext('Title for PDF document (all elections)');
gettext('Preamble text for PDF document (all elections)');
//other translations