{{ define "voting" }} {{ template "head" . }}

{{ .Voting.Referendum }}

{{ .Voting.Deadline }}

{{ if .Voting.IsOpen }} {{ template "vote_form" . }} {{ else }} {{ template "voting_result" . }} {{ end }}
{{ template "tail" . }} {{ end }} {{ define "vote_form" }}
Quorum Threshold Anonymous
{{ .Voting.Quorum }} {{ .Voting.Threshold }} {{ if .Voting.Anonymous }} YES {{ else }} NO {{ end }}
{{ end }} {{ define "voting_result" }}
{{ .Voting.Result.Yes }} {{ .Voting.Result.No }} {{ .Voting.Result.Abstain }}
{{ if and .Voting.Result.Quorum .Voting.Result.Threshold }}

ACCEPTED

{{ else }}

REJECTED

{{ end }} {{ if .Voting.Result.Quorum }}

Quorum: REACHED

{{ else }}

Quorum: FAILED

{{ end }}

VOTES

{{ range $vote := .Voting.Votes }} {{ end }}
{{ $vote.Choice }} {{ $vote.Elector }} {{ $vote.Id }}
{{ end }}