File tree Expand file tree Collapse file tree 4 files changed +15
-8
lines changed
Expand file tree Collapse file tree 4 files changed +15
-8
lines changed Original file line number Diff line number Diff line change @@ -254,14 +254,21 @@ func GetPollResults(c *gin.Context) {
254254 return
255255 }
256256
257- fmt .Println (len (results ))
257+ numVotes := 0
258+
259+ for _ , v := range results {
260+ for key := range v {
261+ numVotes += v [key ]
262+ }
263+ }
264+
258265 c .HTML (http .StatusOK , "result.tmpl" , gin.H {
259266 "Id" : poll .Id ,
260267 "Title" : poll .Title ,
261268 "Description" : poll .Description ,
262269 "VoteType" : poll .VoteType ,
263270 "Results" : results ,
264- "NumVotes" : len ( results ) ,
271+ "NumVotes" : numVotes ,
265272 "IsOpen" : poll .Open ,
266273 "IsHidden" : poll .Hidden ,
267274 "CanModify" : canModify ,
Original file line number Diff line number Diff line change 3434 </select>
3535 </div>
3636 <div id= " customOptions" class= " input-group d-none my-3" >
37- <label for= " customOptions" class= " input-group-text" >Custom Options</label>
37+ <label for= " customOptions" class= " input-group-text" >Custom Vote Options</label>
3838 <input
3939 type= " text"
4040 name= " customOptions"
4141 class= " form-control"
42- placeholder= " Enter a comma separated list of custom options"
42+ placeholder= " Enter a comma separated list of custom vote options"
4343 >
4444 </div>
4545
112112 </div>
113113 {{ end }}
114114
115- <input type= " submit" class= " btn btn-primary" value= " Create" >
115+ <input type= " submit" class= " btn btn-primary my-2 " value= " Create" >
116116 </form>
117117 </div>
118118
Original file line number Diff line number Diff line change 1616 <form action= " /poll/{{ .Id }}" method= " POST" >
1717 {{ if eq .PollType " simple" }}
1818 {{ range $i , $option := .Options }}
19- <div class= " form-check fs-4" >
19+ <div class= " form-check fs-4 lh-sm " >
2020 <input class= " form-check-input" type= " radio" name= " option" id= " {{ $option }}" value= " {{ $option }}" />
2121 <label class= " form-check-label" for= " {{ $option }}" >{{ $option }}</label>
2222 </div>
2323 <br />
2424 {{ end }}
2525 {{ if .AllowWriteIns }}
26- <div class= " form-check fs-4" >
26+ <div class= " form-check fs-4 lh-sm " >
2727 <input class= " form-check-input" type= " radio" name= " option" value= " writein" />
2828 <input
2929 type= " text"
Original file line number Diff line number Diff line change 2424 {{ end }}
2525 {{ end }}
2626
27- <h2>{{ .Title }}</h2>
27+ <h2 class = " text-break " >{{ .Title }}</h2>
2828 {{ if .Description }}
2929 <h4>{{ .Description | MakeLinks }}</h4>
3030 {{ end }}
You can’t perform that action at this time.
0 commit comments