feat: allow TUs to change their votes on running proposals

In addition, this patch brings in display for the vote decision
you cast on it. This is only viewable by the request user; your
vote is not being shared with others.

Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
Kevin Morris 2022-03-07 23:13:08 -08:00
parent cf4ab696d0
commit 9e3c2e15ea
No known key found for this signature in database
GPG key ID: F7E46DED420788F3
5 changed files with 150 additions and 73 deletions

View file

@ -2,7 +2,11 @@
{% if voteinfo.is_running() %}
<p class="vote-running" style="font-weight: bold; color: red">
{% trans %}This vote is still running.{% endtrans %}
{% trans %}This vote is still running.{% endtrans %}<br />
{% if vote %}
{{ "You've already voted for this proposal." | tr }}
{{ "You can change your vote while the proposal is still running." | tr }}
{% endif %}
</p>
{% endif %}
@ -39,6 +43,13 @@
</strong>
</div>
{% if vote and vote.Decision %}
<div class="field">
{{ "Your vote" | tr }}:
<strong>{{ vote.display() }}</strong>
</div>
{% endif %}
{% if not voteinfo.is_running() %}
<div class="field result">
{{ "Result" | tr }}: