From 97c1247b577adb13fac793577d411f0f2be9274a Mon Sep 17 00:00:00 2001 From: Kevin Morris Date: Sat, 26 Jun 2021 04:43:00 -0700 Subject: [PATCH] /tu/{proposal_id}: Do not show voters if there are none This was different than PHP. Signed-off-by: Kevin Morris --- aurweb/routers/trusted_user.py | 2 +- templates/tu/show.html | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/aurweb/routers/trusted_user.py b/aurweb/routers/trusted_user.py index efdcfc73..55f7b7e1 100644 --- a/aurweb/routers/trusted_user.py +++ b/aurweb/routers/trusted_user.py @@ -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 diff --git a/templates/tu/show.html b/templates/tu/show.html index ca5cbe63..ff2d4bb6 100644 --- a/templates/tu/show.html +++ b/templates/tu/show.html @@ -4,10 +4,12 @@
{% include "partials/tu/proposal/details.html" %}
- -
- {% include "partials/tu/proposal/voters.html" %} -
+ + {% if voters %} +
+ {% include "partials/tu/proposal/voters.html" %} +
+ {% endif %}
{% if error %}