File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -103,7 +103,6 @@ func GetPollById(c *gin.Context) {
103103 c .Redirect (http .StatusFound , "/results/" + poll .Id )
104104 return
105105 }
106-
107106 writeInAdj := 0
108107 if poll .AllowWriteIns {
109108 writeInAdj = 1
@@ -254,12 +253,15 @@ func GetPollResults(c *gin.Context) {
254253 })
255254 return
256255 }
256+
257+ fmt .Println (len (results ))
257258 c .HTML (http .StatusOK , "result.tmpl" , gin.H {
258259 "Id" : poll .Id ,
259260 "Title" : poll .Title ,
260261 "Description" : poll .Description ,
261262 "VoteType" : poll .VoteType ,
262263 "Results" : results ,
264+ "NumVotes" : len (results ),
263265 "IsOpen" : poll .Open ,
264266 "IsHidden" : poll .Hidden ,
265267 "CanModify" : canModify ,
Original file line number Diff line number Diff line change 11 {{ template " header.tmpl" . }}
22
33 <div class= " container main p-5" >
4- {{ if not .IsOpen }}
4+ {{ if .IsOpen }}
55 {{ if eq .CanVote 9 }}
66 <div id= " already-voted" class= " alert alert-info alert-dismissible fade show" role= " alert" >
77 <h5 class= " m-0" >You have already voted in this poll. </h5>
3939 {{/* This works currently because quorum type can only be set if gatekeep is required */ }}
4040 {{ if not .Gatekeep }}
4141 <h6>No quorum required for this poll. </h6>
42+ <h6>Votes Cast: {{ .NumVotes }}</h6>
4243 {{ else }}
4344 <h6>Quorum Type: {{ .Quorum }}%</h6>
4445 <h6>Votes Needed For Quorum: {{ .VotesNeededForQuorum }}</h6>
46+ <h6>Votes Cast: {{ .NumVotes }}</h6>
4547 {{ end }}
4648 <br/>
4749 <br/>
You can’t perform that action at this time.
0 commit comments