From 640ebd114e748b4668b412392abb417ecbc8a538 Mon Sep 17 00:00:00 2001 From: Jelle van der Waa Date: Fri, 9 Aug 2024 11:21:37 +0200 Subject: [PATCH] fix(templates): hide non-actionable links when not logged in A non-logged in user cannot vote/enable notifications or submit a request so hide these links. --- templates/partials/packages/actions.html | 78 +++++++++++++----------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/templates/partials/packages/actions.html b/templates/partials/packages/actions.html index ae8cf141..596e7ecf 100644 --- a/templates/partials/packages/actions.html +++ b/templates/partials/packages/actions.html @@ -53,42 +53,44 @@ {% endif %} {% endif %} -
  • - {% if not voted %} -
    - -
    - {% else %} -
    - -
    - {% endif %} -
  • -
  • - {% if notified %} -
    + {% if request.user.is_authenticated() %} +
  • + {% if not voted %} + + name="do_Vote" + value="{{ 'Vote for this package' | tr }}" />
  • - {% else %} -
    - + {% else %} + +
    - {% endif %} -
  • + {% endif %} + +
  • + {% if notified %} +
    + +
    + {% else %} +
    + +
    + {% endif %} +
  • + {% endif %} {% if request.user.has_credential(creds.PKGBASE_EDIT_COMAINTAINERS, approved=[pkgbase.Maintainer]) %}
  • @@ -111,11 +113,13 @@
  • {% endif %} {% endif %} -
  • - - {{ "Submit Request" | tr }} - -
  • + {% if request.user.is_authenticated() %} +
  • + + {{ "Submit Request" | tr }} + +
  • + {% endif %} {% if request.user.has_credential(creds.PKGBASE_DELETE) %}