/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. """ """ Render a single TU proposal. """
context["proposal"] = proposal context["proposal"] = proposal
context["voteinfo"] = voteinfo context["voteinfo"] = voteinfo
context["voters"] = voters context["voters"] = voters.all()
participation = voteinfo.ActiveTUs / voteinfo.total_votes() \ participation = voteinfo.ActiveTUs / voteinfo.total_votes() \
if voteinfo.total_votes() else 0 if voteinfo.total_votes() else 0

View file

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