/tu/{proposal_id}: Do not show voters if there are none

This was different than PHP.

Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
Kevin Morris 2021-06-26 04:43:00 -07:00
parent 04ab98907a
commit 97c1247b57
2 changed files with 7 additions and 5 deletions

View file

@ -111,7 +111,7 @@ def render_proposal(request: Request,
""" Render a single TU proposal. """
context["proposal"] = proposal
context["voteinfo"] = voteinfo
context["voters"] = voters
context["voters"] = voters.all()
participation = voteinfo.ActiveTUs / voteinfo.total_votes() \
if voteinfo.total_votes() else 0

View file

@ -4,10 +4,12 @@
<div class="box">
{% include "partials/tu/proposal/details.html" %}
</div>
<div class="box">
{% include "partials/tu/proposal/voters.html" %}
</div>
{% if voters %}
<div class="box">
{% include "partials/tu/proposal/voters.html" %}
</div>
{% endif %}
<div class="box">
{% if error %}