From 5af466e8b8ff7788ab0b90ecd20a8246aa7b400a Mon Sep 17 00:00:00 2001 From: Liam Burnand Date: Wed, 8 May 2024 01:38:07 +0100 Subject: [PATCH] Adding in the number of seats, showing the results in the correct format and also adding a search feature to the exclusion list --- templates/election.tmpl | 692 +++++++++++++++++++++++----------------- 1 file changed, 405 insertions(+), 287 deletions(-) diff --git a/templates/election.tmpl b/templates/election.tmpl index 30a8f91..ba84aa8 100644 --- a/templates/election.tmpl +++ b/templates/election.tmpl @@ -6,93 +6,105 @@ Return to list

{{with .Election}}

You are viewing ({{.Name}})
- Name: {{.Name}}
- Description: {{.Description}}
- Is R.O.N. enabled: {{if .Ron}}enabled{{else}}disabled{{end}}

- {{if and (not .Open) (not .Closed)}} + Name: {{.Name}}
+ Description: {{.Description}}
+ Is R.O.N. enabled: {{if .Ron}}enabled{{else}}disabled{{end}}
+ Number of seats: {{.Seats}}

+ {{if and (not .Open) (not .Closed)}} Current state: Yet to be opened, can still edit this election

- Next action to take:
Open election


- Edit Election:
Edit election


+ Next action to take:
Open election +


+ Edit Election:
Edit election
+

Remove Election:
Remove Election - {{else if and .Open (not .Closed)}} + {{else if and .Open (not .Closed)}} Click the button below to refresh ballots
Current ballots (ballots / voters): {{$.Ballots}}/{{.Voters}} ({{divPercent $.Ballots .Voters}})
Refresh

Current state: Open

Next action to take: Close election - {{else if and (not .Open) .Closed}} - Voting stats (ballots / voters): {{$.Ballots}}/{{.Voters}} ({{divPercent $.Ballots .Voters}}%)

+ {{else if and (not .Open) .Closed}} + Voting stats (ballots / voters): {{$.Ballots}}/{{.Voters}} ({{divPercent $.Ballots .Voters}} + %)

Current state: Closed

{{with .Result}} - Winner: {{.Winner}}

- Number or rounds: {{.Rounds}}
-

- - - - - - - - - - {{range .Round}} + {{if eq (len .Winners) 1}} + Winner: {{index .Winners 0}} + {{else}} + Winners:
+ {{range .Winners}} +   • {{.}}
+ {{end}} +
+ {{end}}

+ Number or rounds: {{.Rounds}}
+

+
Round No.No. of blank votesCandidate Status
+ + + + + + + + + {{range .Round}} + + + +
Round No.No. of blank votesCandidate Status
{{incUInt64 .Round}}{{.Blanks}} + + - - - + {{end}} + + + + {{end}} + + + + + + + - {{end}} - - - - - - - - -
{{incUInt64 .Round}}{{.Blanks}} - - - - - - - - - - - {{range .CandidateStatus}} - - - {{if eq .Id "R.O.N."}} - - {{else}} - {{ $candidateId := .Id }} - {{range $.Candidates}} - {{if eq .Id $candidateId}} - - {{end}} - {{end}} - {{end}} - - - + + + + + + + + {{range .CandidateStatus}} + + + {{if eq .Id "R.O.N."}} + + {{else}} + {{ $candidateId := .Id }} + {{range $.Candidates}} + {{if eq .Id $candidateId}} + + {{end}} {{end}} - - - - - - - - - -
Candidate RankCandidateNo. of votesStatus
{{incUInt64 .CandidateRank}}R.O.N.{{.Name}}{{.NoOfVotes}}{{.Status}}
Candidate RankCandidateNo. of votesStatus
{{incUInt64 .CandidateRank}}R.O.N.{{.Name}}
Candidate RankCandidateNo. of votesStatus
-
{{.NoOfVotes}}{{.Status}}
Candidate RankCandidateNo. of votesStatus
Round No.No. of blank votesCandidate Status
- {{end}} -

Remove Election:
Remove Election + +

+ + + {{end}} + + + + Round No. + No. of blank votes + Candidate Status + + + {{end}} +

Remove Election:
Remove Election + {{end}}

@@ -107,30 +119,31 @@ {{end}} + + + {{if and (and (not $.Election.Open) (not $.Election.Closed)) (ne (len .Candidates) 0)}} + + {{end}} + + + + {{range .Candidates}} - - {{if and (and (not $.Election.Open) (not $.Election.Closed)) (ne (len .Candidates) 0)}} - + + {{if and (not $.Election.Open) (not $.Election.Closed)}} + {{end}} - - - {{range .Candidates}} - - - {{if and (not $.Election.Open) (not $.Election.Closed)}} - - {{end}} - - {{end}} - {{if .Election.Ron}} - - - {{if and (not .Election.Open) (not .Election.Closed)}} - - {{end}} - - {{end}} + {{end}} + {{if .Election.Ron}} + + + {{if and (not .Election.Open) (not .Election.Closed)}} + + {{end}} + + {{end}} @@ -138,12 +151,12 @@ {{if and (and (not $.Election.Open) (not $.Election.Closed)) (ne (len .Candidates) 0)}} {{end}} - +
CandidateRemove
CandidateRemove{{.Name}}Remove +
{{.Name}}Remove
R.O.N.
R.O.N.
Remove
- {{with .Election}} - {{if and (not .Open) (not .Closed)}} -

+ {{with .Election}} + {{if and (not .Open) (not .Closed)}} +

Enter the name of the candidate.


Below is the list of excluded voters from this election, use this to exclude candidates from running.
- This is manual in case of pairs running.

+ This is manual in case of pairs running.



@@ -173,7 +186,7 @@ {{if and (not .Open) (not .Closed)}} - + {{end}} @@ -183,8 +196,11 @@ {{if and (not $.Election.Open) (not $.Election.Closed)}} - + {{end}} {{end}} @@ -194,7 +210,7 @@ {{if and (not .Open) (not .Closed)}} - + {{end}} @@ -204,233 +220,335 @@
-
- -
-
- -
+ +
Please select

+ + +

Exclude voter -
-
-
- {{end}} - {{if not .Open}} - {{end}} \ No newline at end of file
Voter EmailInclude againInclude again
{{.Name}} {{.Email}} - Include again +
+ Include again
+
Voter EmailInclude againInclude again