✨ Better voting result
This commit is contained in:
parent
7d34b00955
commit
a25380193f
2 changed files with 29 additions and 24 deletions
|
@ -122,28 +122,26 @@
|
|||
Quorum: FAILED
|
||||
</p>
|
||||
{{ end }}
|
||||
{{ if not .Voting.Anonymous }}
|
||||
<div class="relative overflow-x-auto py-4">
|
||||
<table class="w-full text-sm text-left rtl:text-right text-gray-400 text-center mt-4">
|
||||
<thead cols=3>
|
||||
<h1 class="text-center text-4xl border-t border-gray-700 pt-4 text-gray-400">VOTES</h1>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{ range $vote := .Voting.Votes }}
|
||||
<tr class="border-b border-t bg-gray-800 border-gray-700" id="$vote.Id">
|
||||
<td class="px-2 py-2">
|
||||
{{ $vote.Choice }}
|
||||
</td>
|
||||
<td class="px-2 py-2 semibold">
|
||||
{{ $vote.Elector }}
|
||||
</td>
|
||||
<td class="px-2 py-2">
|
||||
{{ $vote.Id }}
|
||||
</td>
|
||||
</tr>
|
||||
{{ end }}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{{ end }}
|
||||
<div class="relative overflow-x-auto py-4">
|
||||
<table class="w-full text-sm text-left rtl:text-right text-gray-400 text-center mt-4">
|
||||
<thead cols=3>
|
||||
<h1 class="text-center text-4xl border-t border-gray-700 pt-4 text-gray-400">VOTES</h1>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{ range $vote := .Voting.Votes }}
|
||||
<tr class="border-b border-t bg-gray-800 border-gray-700" id="$vote.Id">
|
||||
<td class="px-2 py-2">
|
||||
{{ $vote.Choice }}
|
||||
</td>
|
||||
<td class="px-2 py-2 semibold">
|
||||
{{ $vote.Elector }}
|
||||
</td>
|
||||
<td class="px-2 py-2">
|
||||
{{ $vote.Id }}
|
||||
</td>
|
||||
</tr>
|
||||
{{ end }}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{{ end }}
|
||||
|
|
|
@ -187,6 +187,13 @@ nextVote:
|
|||
}
|
||||
votes = append(votes, v.votes[i])
|
||||
}
|
||||
|
||||
// anonymize
|
||||
if v.annonymous {
|
||||
for i := range votes {
|
||||
votes[i].Elector = ""
|
||||
}
|
||||
}
|
||||
return votes
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue