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:
parent
39da8f942f
commit
c7a2f5c47c
@ -55,6 +55,15 @@ def get_config_variables():
|
|||||||
group='Elections',
|
group='Elections',
|
||||||
subgroup='Ballot and ballot papers')
|
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(
|
yield ConfigVariable(
|
||||||
name='assignments_pdf_ballot_papers_selection',
|
name='assignments_pdf_ballot_papers_selection',
|
||||||
default_value='CUSTOM_NUMBER',
|
default_value='CUSTOM_NUMBER',
|
||||||
|
@ -285,6 +285,7 @@ class Assignment(RESTModelMixin, models.Model):
|
|||||||
|
|
||||||
# Add all candidates to list of speakers of related agenda item
|
# Add all candidates to list of speakers of related agenda item
|
||||||
# TODO: Try to do this in a bulk create
|
# TODO: Try to do this in a bulk create
|
||||||
|
if config['assignments_add_candidates_to_list_of_speakers']:
|
||||||
for candidate in self.candidates:
|
for candidate in self.candidates:
|
||||||
try:
|
try:
|
||||||
Speaker.objects.add(candidate, self.agenda_item, skip_autoupdate=True)
|
Speaker.objects.add(candidate, self.agenda_item, skip_autoupdate=True)
|
||||||
|
@ -72,7 +72,9 @@ angular.module('OpenSlidesApp.assignments', [])
|
|||||||
|
|
||||||
if (base && !skipPercents) {
|
if (base && !skipPercents) {
|
||||||
percentNumber = Math.round(vote.weight * 100 / base * 100) / 100;
|
percentNumber = Math.round(vote.weight * 100 / base * 100) / 100;
|
||||||
percentStr = "(" + percentNumber + "%)";
|
if (percentNumber >= 0) {
|
||||||
|
percentStr = '(' + percentNumber + ' %)';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
votes.push({
|
votes.push({
|
||||||
'order': order,
|
'order': order,
|
||||||
|
@ -875,6 +875,7 @@ angular.module('OpenSlidesApp.assignments.site', [
|
|||||||
gettext('Two-thirds majority');
|
gettext('Two-thirds majority');
|
||||||
gettext('Three-quarters majority');
|
gettext('Three-quarters majority');
|
||||||
gettext('Disabled');
|
gettext('Disabled');
|
||||||
|
gettext('Put all candidates on the list of speakers');
|
||||||
gettext('Title for PDF document (all elections)');
|
gettext('Title for PDF document (all elections)');
|
||||||
gettext('Preamble text for PDF document (all elections)');
|
gettext('Preamble text for PDF document (all elections)');
|
||||||
//other translations
|
//other translations
|
||||||
|
Loading…
Reference in New Issue
Block a user