From 7ada65a628636ba2d2b4e76e350f774d6c428dd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emanuel=20Sch=C3=BCtze?= Date: Mon, 17 Oct 2016 16:30:03 +0200 Subject: [PATCH] Optimized template and translation for majority feature. --- openslides/motions/config_variables.py | 4 +-- openslides/motions/static/js/motions/site.js | 6 ++++ .../templates/motions/motion-detail.html | 28 +++++++------------ openslides/poll/static/js/poll/majority.js | 4 +++ tests/integration/core/test_viewset.py | 2 +- 5 files changed, 23 insertions(+), 21 deletions(-) diff --git a/openslides/motions/config_variables.py b/openslides/motions/config_variables.py index 860c016e7..8c67dc4cf 100644 --- a/openslides/motions/config_variables.py +++ b/openslides/motions/config_variables.py @@ -191,8 +191,8 @@ def get_config_variables(): name='motions_poll_default_majority_method', default_value='simple_majority', input_type='majorityMethod', - label='Method for majority tests', - help_text='Default method to determine whether a motion is successful.', + label='Required majority', + help_text='Default method to check whether a motion has reached the required majority.', weight=357, group='Motions', subgroup='Voting and ballot papers') diff --git a/openslides/motions/static/js/motions/site.js b/openslides/motions/static/js/motions/site.js index fbea9ca2e..902db5685 100644 --- a/openslides/motions/static/js/motions/site.js +++ b/openslides/motions/static/js/motions/site.js @@ -1643,6 +1643,12 @@ angular.module('OpenSlidesApp.motions.site', [ gettext('All valid ballots'); gettext('All casted ballots'); gettext('Disabled (no percents)'); + gettext('Required majority'); + gettext('Default method to check whether a motion has reached the required majority.'); + gettext('Simple majority'); + gettext('Two-thirds majority'); + gettext('Three-quarters majority'); + gettext('Disabled'); gettext('Number of ballot papers (selection)'); gettext('Number of all delegates'); gettext('Number of all participants'); diff --git a/openslides/motions/static/templates/motions/motion-detail.html b/openslides/motions/static/templates/motions/motion-detail.html index 1b640c606..337b06c32 100644 --- a/openslides/motions/static/templates/motions/motion-detail.html +++ b/openslides/motions/static/templates/motions/motion-detail.html @@ -182,7 +182,7 @@ - @@ -191,17 +191,11 @@ -
- - Calculate majority - - - -
-
+
- Majority method: -
@@ -272,17 +266,15 @@ {{ votesCast.value }} {{ votesCast.percentStr }} - + Calculation impossible - - Quorum reached, - {{ isReached() }} votes more than needed. + + Quorum reached, {{ isReached() }} votes more than needed. - - Quorum not reached, - {{ -(isReached()) }} votes missing. + + Quorum not reached, {{ -(isReached()) }} votes missing. diff --git a/openslides/poll/static/js/poll/majority.js b/openslides/poll/static/js/poll/majority.js index 88c7da464..d2dd2e1e1 100644 --- a/openslides/poll/static/js/poll/majority.js +++ b/openslides/poll/static/js/poll/majority.js @@ -8,6 +8,7 @@ angular.module('OpenSlidesApp.poll.majority', []) {'value': 'simple_majority', 'display_name': 'Simple majority'}, {'value': 'two-thirds_majority', 'display_name': 'Two-thirds majority'}, {'value': 'three-quarters_majority', 'display_name': 'Three-quarters majority'}, + {'value': 'disabled', 'display_name': 'Disabled'}, ]) .factory('MajorityMethods', [ @@ -30,6 +31,9 @@ angular.module('OpenSlidesApp.poll.majority', []) } return result; }, + 'disabled': function () { + return undefined; + }, }; } ]) diff --git a/tests/integration/core/test_viewset.py b/tests/integration/core/test_viewset.py index c1a803fa6..918ea1846 100644 --- a/tests/integration/core/test_viewset.py +++ b/tests/integration/core/test_viewset.py @@ -143,5 +143,5 @@ class TestConfigDBQueries(TestCase): TODO: The last 57 requests are a bug. """ - with self.assertNumQueries(60): + with self.assertNumQueries(61): self.client.get(reverse('config-list'))