From a72ab61902961562048f487c2e102249b4a33964 Mon Sep 17 00:00:00 2001 From: Kevin Morris Date: Wed, 25 Aug 2021 16:34:37 -0700 Subject: [PATCH] [FastAPI] fix dashboard template Some columns should only be shown when a user is authenticated. Signed-off-by: Kevin Morris --- templates/partials/packages/results.html | 52 ++++++++++++------------ 1 file changed, 27 insertions(+), 25 deletions(-) diff --git a/templates/partials/packages/results.html b/templates/partials/packages/results.html index 005bd5a9..80029d10 100644 --- a/templates/partials/packages/results.html +++ b/templates/partials/packages/results.html @@ -6,8 +6,10 @@ {{ "Version" | tr }} {{ "Votes" | tr }} {{ "Popularity" | tr }} - {{ "Voted" | tr }} - {{ "Notify" | tr }} + {% if request.user.is_authenticated() %} + {{ "Voted" | tr }} + {{ "Notify" | tr }} + {% endif %} {{ "Description" | tr }} {{ "Maintainer" | tr }} @@ -21,33 +23,33 @@ {{ pkg.Name }} - {% if flagged %} - {{ pkg.Version }} - {% else %} - {{ pkg.Version }} - {% endif %} + {{ pkg.Version }} {{ pkg.PackageBase.NumVotes }} - - {{ pkg.PackageBase.Popularity | number_format(2) }} - - - - {% if request.user.voted_for(pkg) %} - {{ "Yes" | tr }} - {% endif %} - - - - {% if request.user.notified(pkg) %} - {{ "Yes" | tr }} - {% endif %} - + {{ pkg.PackageBase.Popularity | number_format(2) }} + {% if request.user.is_authenticated() %} + + + {% if request.user.voted_for(pkg) %} + {{ "Yes" | tr }} + {% endif %} + + + + {% if request.user.notified(pkg) %} + {{ "Yes" | tr }} + {% endif %} + + {% endif %} {{ pkg.Description or '' }} {% set maintainer = pkg.PackageBase.Maintainer %} - - {{ maintainer.Username }} - + {% if maintainer %} + + {{ maintainer.Username }} + + {% else %} + {{ "orphan" | tr }} + {% endif %} {% endfor %}