From 20f5519b99a29dc376a6d8a2325f58ca9305380c Mon Sep 17 00:00:00 2001 From: Kevin Morris Date: Thu, 11 Nov 2021 18:13:21 -0800 Subject: [PATCH] fix(fastapi): hide keywords when there are none or they can't be edited Signed-off-by: Kevin Morris --- templates/partials/packages/details.html | 56 ++++++++++++------------ 1 file changed, 29 insertions(+), 27 deletions(-) diff --git a/templates/partials/packages/details.html b/templates/partials/packages/details.html index d525f63b..00859068 100644 --- a/templates/partials/packages/details.html +++ b/templates/partials/packages/details.html @@ -33,34 +33,36 @@ {% endif %} - - {{ "Keywords" | tr }}: - {% if request.user.has_credential("CRED_PKGBASE_SET_KEYWORDS", approved=[pkgbase.Maintainer]) %} - -
-
- - -
-
- - {% else %} - - {% for keyword in pkgbase.keywords.all() %} - + {{ "Keywords" | tr }}: + {% if request.user.has_credential("CRED_PKGBASE_SET_KEYWORDS", approved=[pkgbase.Maintainer]) %} + +
- {{ keyword.Keyword }} - - {% endfor %} - - {% endif %} - +
+ + +
+
+ + {% else %} + + {% for keyword in pkgbase.keywords.all() %} + + {{ keyword.Keyword }} + + {% endfor %} + + {% endif %} + + {% endif %} {% if licenses and licenses.count() and show_package_details %} {{ "Licenses" | tr }}: