From 92a9a361888b55af0a7e9f6f0956b40363ca1644 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emanuel=20Sch=C3=BCtze?= Date: Tue, 8 Nov 2016 12:12:17 +0100 Subject: [PATCH] Template fixes. - Improved motion majority calculation form. - Show special values without percentage. - Fix JS errors. --- openslides/motions/static/js/motions/base.js | 23 +++++++--- .../templates/motions/motion-detail.html | 44 +++++++++++-------- .../templates/motions/slide_motion.html | 4 +- openslides/users/static/js/users/base.js | 2 +- 4 files changed, 45 insertions(+), 28 deletions(-) diff --git a/openslides/motions/static/js/motions/base.js b/openslides/motions/static/js/motions/base.js index fbb818cf7..a16ecccce 100644 --- a/openslides/motions/static/js/motions/base.js +++ b/openslides/motions/static/js/motions/base.js @@ -102,6 +102,11 @@ angular.module('OpenSlidesApp.motions', [ } break; } + // 100% base impossible if at leat one value has set an + // speacial value (-1 or -2). + if (this.yes < 0 || this.no < 0 || this.abstain < 0) { + impossible = true; + } // calculate percent value var config = Config.get('motions_poll_100_percent_base').value; var percentStr; @@ -292,16 +297,20 @@ angular.module('OpenSlidesApp.motions', [ // full state name - optional with custom state name extension // depended by state and provided by a custom comment field getStateName: function () { + var name = ''; var additionalName = ''; - if (this.state.show_state_extension_field) { - // check motion comment fields for flag 'forState' - var fields = Config.get('motions_comments').value; - var index = _.findIndex(fields, ['forState', true]); - if (index > -1) { - additionalName = ' ' + this.comments[index]; + if (this.state) { + name = gettextCatalog.getString(this.state.name); + if (this.state.show_state_extension_field) { + // check motion comment fields for flag 'forState' + var fields = Config.get('motions_comments').value; + var index = _.findIndex(fields, ['forState', true]); + if (index > -1) { + additionalName = ' ' + this.comments[index]; + } } } - return gettextCatalog.getString(this.state.name) + additionalName; + return name + additionalName; }, // full recommendation string - optional with custom recommendationextension // depended by state and provided by a custom comment field diff --git a/openslides/motions/static/templates/motions/motion-detail.html b/openslides/motions/static/templates/motions/motion-detail.html index f60a4cf78..3b4465f47 100644 --- a/openslides/motions/static/templates/motions/motion-detail.html +++ b/openslides/motions/static/templates/motions/motion-detail.html @@ -221,15 +221,6 @@ - -
-
- Required majority: - +
+
+ + + +
+ + Quorum reached, {{ isReached() }} votes more than needed. + + + Quorum not reached, {{ -(isReached()) }} votes missing. + +
+ +