From 35531834b5a0ed2a451dedf20ed41f7d4ef4c8fd Mon Sep 17 00:00:00 2001 From: Oscar Date: Thu, 4 Nov 2021 14:25:34 +0100 Subject: [PATCH 1/3] if the vote is unanimous don't show the text related to positive negative and abstention voterss --- models/vote.js | 4 +- support/templates/partials/mandatee-list.hbs | 59 +++++++++++++------- support/templates/partials/treatment.hbs | 51 ++++++++++------- 3 files changed, 73 insertions(+), 41 deletions(-) diff --git a/models/vote.js b/models/vote.js index a82eece..eecdf66 100644 --- a/models/vote.js +++ b/models/vote.js @@ -44,6 +44,7 @@ export default class Vote { subject: subject.value, result: result.value, isSecret: isSecret.value === "true", + isUnanimous: (Number(positiveVotes.value) === 0 || Number(negativeVotes.value) === 0) && Number(abstentionVotes.value) === 0, positiveVotes: positiveVotes.value, negativeVotes: negativeVotes.value, abstentionVotes: abstentionVotes.value, @@ -52,11 +53,12 @@ export default class Vote { }); } - constructor({uri, subject, result, isSecret, positiveVotes, negativeVotes, abstentionVotes, position, adminBodyClassification}) { + constructor({uri, subject, result, isSecret, isUnanimous, positiveVotes, negativeVotes, abstentionVotes, position, adminBodyClassification}) { this.uri = uri; this.subject = subject; this.result = result; this.isSecret = isSecret; + this.isUnanimous = isUnanimous; this.positiveVotes = positiveVotes; this.negativeVotes = negativeVotes; this.abstentionVotes = abstentionVotes; diff --git a/support/templates/partials/mandatee-list.hbs b/support/templates/partials/mandatee-list.hbs index 550a7a1..4cf9b8e 100644 --- a/support/templates/partials/mandatee-list.hbs +++ b/support/templates/partials/mandatee-list.hbs @@ -1,29 +1,48 @@ {{#if mandatees}} {{#if mandatees.length}} -
-

- {{title}} -

- -
+ {{/if}} + + {{/each}} + {{else}} +
+

+ {{title}} +

+ +
+ {{/if}} {{/if}} {{/if}} diff --git a/support/templates/partials/treatment.hbs b/support/templates/partials/treatment.hbs index 5a81e5e..56d0f2b 100644 --- a/support/templates/partials/treatment.hbs +++ b/support/templates/partials/treatment.hbs @@ -56,26 +56,37 @@

{{this.subject}}

{{> mandateeList mandatees=this.attendees property="besluit:heeftAanwezige" title="Aanwezigen tijdens de stemming" includeRole=false}} {{> mandateeList mandatees=this.voters property="besluit:heeftStemmer" title="Effectieve stemmers" includeRole=false}} -

- Totaal aantal voorstanders: - {{this.positiveVotes}} -

-

- Totaal aantal tegenstanders: - {{this.negativeVotes}} -

-

- Totaal aantal onthoudingen, blanco of ongeldig: - {{this.abstentionVotes}} -

- {{#unless this.geheim}} - {{> mandateeList mandatees=this.positiveVoters property="besluit:heeftVoorstander" title="Voorstanders" includeRole=false}} - {{> mandateeList mandatees=this.negativeVoters property="besluit:heeftTegenstander" title="Tegenstanders" includeRole=false}} - {{> mandateeList mandatees=this.abstentionVoters property="besluit:heeftOnthouders" title="Onthoudingen, blanco of ongeldig" includeRole=false}} - {{/unless}} -

- Met als gevolg, -

+ {{#if this.isUnanimous}} + + + + {{#unless this.geheim}} + {{> mandateeList mandatees=this.positiveVoters property="besluit:heeftVoorstander" title="Voorstanders" includeRole=false hideText=true}} + {{> mandateeList mandatees=this.negativeVoters property="besluit:heeftTegenstander" title="Tegenstanders" includeRole=false hideText=true}} + {{> mandateeList mandatees=this.abstentionVoters property="besluit:heeftOnthouders" title="Onthoudingen, blanco of ongeldig" includeRole=false hideText=true}} + {{/unless}} +

Met eenparigheid van stemmen,

+ {{else}} +

+ Totaal aantal voorstanders: + {{this.positiveVotes}} +

+

+ Totaal aantal tegenstanders: + {{this.negativeVotes}} +

+

+ Totaal aantal onthoudingen, blanco of ongeldig: + {{this.abstentionVotes}} +

+ {{#unless this.geheim}} + {{> mandateeList mandatees=this.positiveVoters property="besluit:heeftVoorstander" title="Voorstanders" includeRole=false}} + {{> mandateeList mandatees=this.negativeVoters property="besluit:heeftTegenstander" title="Tegenstanders" includeRole=false}} + {{> mandateeList mandatees=this.abstentionVoters property="besluit:heeftOnthouders" title="Onthoudingen, blanco of ongeldig" includeRole=false}} + {{/unless}} +

Met als gevolg,

+ {{/if}} +

{{this.result}}

{{/each}} From 6d04008efaa327c902ed129833ad8ae39c9b1bb4 Mon Sep 17 00:00:00 2001 From: Oscar Date: Mon, 8 Nov 2021 14:54:11 +0100 Subject: [PATCH 2/3] Implemented suggestions by niels --- support/templates/partials/treatment.hbs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/support/templates/partials/treatment.hbs b/support/templates/partials/treatment.hbs index 56d0f2b..52334b0 100644 --- a/support/templates/partials/treatment.hbs +++ b/support/templates/partials/treatment.hbs @@ -65,7 +65,8 @@ {{> mandateeList mandatees=this.negativeVoters property="besluit:heeftTegenstander" title="Tegenstanders" includeRole=false hideText=true}} {{> mandateeList mandatees=this.abstentionVoters property="besluit:heeftOnthouders" title="Onthoudingen, blanco of ongeldig" includeRole=false hideText=true}} {{/unless}} -

Met eenparigheid van stemmen,

+

{{this.result}}

+

,met eenparigheid van stemmen

{{else}}

Totaal aantal voorstanders: @@ -85,9 +86,9 @@ {{> mandateeList mandatees=this.abstentionVoters property="besluit:heeftOnthouders" title="Onthoudingen, blanco of ongeldig" includeRole=false}} {{/unless}}

Met als gevolg,

+

{{this.result}}

{{/if}} -

{{this.result}}

{{/each}} From a2b5d312b7834e53c3836842cb066d2c929ad134 Mon Sep 17 00:00:00 2001 From: Niels V Date: Mon, 8 Nov 2021 15:08:47 +0100 Subject: [PATCH 3/3] merge paragraphs into one --- support/templates/partials/treatment.hbs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/support/templates/partials/treatment.hbs b/support/templates/partials/treatment.hbs index 52334b0..2b9a6ba 100644 --- a/support/templates/partials/treatment.hbs +++ b/support/templates/partials/treatment.hbs @@ -65,8 +65,7 @@ {{> mandateeList mandatees=this.negativeVoters property="besluit:heeftTegenstander" title="Tegenstanders" includeRole=false hideText=true}} {{> mandateeList mandatees=this.abstentionVoters property="besluit:heeftOnthouders" title="Onthoudingen, blanco of ongeldig" includeRole=false hideText=true}} {{/unless}} -

{{this.result}}

-

,met eenparigheid van stemmen

+

{{this.result}}, met eenparigheid van stemmen

{{else}}

Totaal aantal voorstanders: