[bugfix] Let templates deref pointers, as a treat (#2448)

This commit is contained in:
tobi 2023-12-12 15:44:54 +01:00 committed by GitHub
commit d0bb8f0973
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 3 deletions

View file

@ -50,15 +50,17 @@
{{- if isNil $pollOption.VotesCount }}
Results not yet published.
{{- else -}}
{{- with deref $pollOption.VotesCount }}
<span class="poll-vote-share">{{- $pollOption.VoteShareStr -}}&#37;</span>
<span class="poll-vote-count">
{{- if eq $pollOption.VotesCount 1 -}}
{{- $pollOption.VotesCount }} vote
{{- if eq . 1 -}}
{{- . }} vote
{{- else -}}
{{- $pollOption.VotesCount }} votes
{{- . }} votes
{{- end -}}
</span>
{{- end -}}
{{- end }}
</div>
</li>
{{- end }}