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.
This commit is contained in:
Jelle van der Waa 2024-08-09 11:21:37 +02:00
parent a16fac9b95
commit 640ebd114e
No known key found for this signature in database
GPG key ID: C06086337C50773E

View file

@ -53,6 +53,7 @@
</li>
{% endif %}
{% endif %}
{% if request.user.is_authenticated() %}
<li>
{% if not voted %}
<form action="/pkgbase/{{ pkgbase.Name }}/vote" method="post">
@ -89,6 +90,7 @@
</form>
{% endif %}
</li>
{% endif %}
{% if request.user.has_credential(creds.PKGBASE_EDIT_COMAINTAINERS, approved=[pkgbase.Maintainer]) %}
<li>
<a href="/pkgbase/{{ pkgbase.Name }}/comaintainers">
@ -111,11 +113,13 @@
</li>
{% endif %}
{% endif %}
{% if request.user.is_authenticated() %}
<li>
<a href="/pkgbase/{{ pkgbase.Name }}/request?{{ {'next': '/pkgbase/%s' | format(pkgbase.Name)} | urlencode }}">
{{ "Submit Request" | tr }}
</a>
</li>
{% endif %}
{% if request.user.has_credential(creds.PKGBASE_DELETE) %}
<li>
<a href="/pkgbase/{{ pkgbase.Name }}/delete?next=/packages">