[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
parent ac48192562
commit d0bb8f0973
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 }}