Skip to content

Commit 6bd4691

Browse files
committed
Fixed vote count on eboard votes
1 parent 0f6c8b8 commit 6bd4691

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

eboard.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,12 @@ func HandleGetEboardVote(c *gin.Context) {
2525
}
2626
fmt.Println(user)
2727
c.HTML(http.StatusOK, "eboard.tmpl", gin.H{
28-
"Username": user.Username,
29-
"EBoard": IsEboard(user),
30-
"Voted": slices.Contains(voters, user.Username),
31-
"Results": votes,
32-
"Options": OPTIONS,
28+
"Username": user.Username,
29+
"EBoard": IsEboard(user),
30+
"Voted": slices.Contains(voters, user.Username),
31+
"Results": votes,
32+
"VoteCount": len(voters),
33+
"Options": OPTIONS,
3334
})
3435
}
3536

templates/eboard.tmpl

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,23 @@
33
<div class="container main p-5">
44
<h2>E-Board Vote</h2>
55
<span>Current Votes Submitted: {{ .VoteCount }}</span>
6-
<div class="row">
6+
<div class="row mt-3">
77
<div class="col-md-8">
88
{{ if .Voted }}
99
{{ range $option, $count := .Results }}
10-
<div id="{{ $option }}" style="font-size: 1.25rem; line-height: 1.25">
10+
<div id="{{ $option }}" class="fs-4">
1111
{{ $option }}: {{ $count }}
1212
</div>
1313
<br/>
1414
{{ end }}
1515
{{ else }}
1616
<form method="POST">
1717
{{ range $i, $option := .Options }}
18-
<div class="form-check">
18+
<div class="form-check fs-4">
1919
<input class="form-check-input" type="radio" name="option"
2020
id="{{ $option }}"
2121
value="{{ $option }}" required/>
22-
<label style="font-size: 1.25rem; line-height: 1.25; padding-left: 4px;"
23-
class="form-check-label"
22+
<label class="form-check-label"
2423
for="{{ $option }}">{{ $option }}</label>
2524
</div>
2625
<br/>

0 commit comments

Comments
 (0)