File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed
Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -23,12 +23,16 @@ func HandleGetEboardVote(c *gin.Context) {
2323 if votes == nil {
2424 votes = make (map [string ]float32 )
2525 }
26+ if voters == nil {
27+ voters = []string {}
28+ }
2629 fmt .Println (votes )
2730 c .HTML (http .StatusOK , "eboard.tmpl" , gin.H {
28- "Username" : user ,
29- "Voted" : slices .Contains (voters , user .Username ),
30- "Results" : votes ,
31- "Options" : OPTIONS ,
31+ "Username" : user ,
32+ "Voted" : slices .Contains (voters , user .Username ),
33+ "Results" : votes ,
34+ "VoteCount" : len (voters ),
35+ "Options" : OPTIONS ,
3236 })
3337}
3438
Original file line number Diff line number Diff line change 1414{{ template " nav" . }}
1515<div class= " container main p-5" >
1616 <h2>E-Board Vote</h2>
17+ <span>Current Votes Submitted: {{ .VoteCount }}</span>
1718 <div class= " row" >
1819 <div class= " col-md-8" >
1920 {{ if .Voted }}
You can’t perform that action at this time.
0 commit comments