mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
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:
parent
d1a66a743e
commit
b994602abb
1 changed files with 38 additions and 0 deletions
|
@ -91,6 +91,44 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</li>
|
</li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% if request.user.is_authenticated() %}
|
||||||
|
<li>
|
||||||
|
{% if not voted %}
|
||||||
|
<form action="/pkgbase/{{ pkgbase.Name }}/vote" method="post">
|
||||||
|
<input type="submit"
|
||||||
|
class="button text-button"
|
||||||
|
name="do_Vote"
|
||||||
|
value="{{ 'Vote for this package' | tr }}" />
|
||||||
|
</form>
|
||||||
|
{% else %}
|
||||||
|
<form action="/pkgbase/{{ pkgbase.Name }}/unvote" method="post">
|
||||||
|
<input type="submit"
|
||||||
|
class="button text-button"
|
||||||
|
name="do_UnVote"
|
||||||
|
value="{{ 'Remove vote' | tr }}" />
|
||||||
|
</form>
|
||||||
|
{% endif %}
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
{% if notified %}
|
||||||
|
<form action="/pkgbase/{{ pkgbase.Name }}/unnotify" method="post">
|
||||||
|
<input type="submit"
|
||||||
|
class="button text-button"
|
||||||
|
name="do_UnNotify"
|
||||||
|
value="{{ 'Disable notifications' | tr }}"
|
||||||
|
/>
|
||||||
|
</form>
|
||||||
|
{% else %}
|
||||||
|
<form action="/pkgbase/{{ pkgbase.Name }}/notify" method="post">
|
||||||
|
<input type="submit"
|
||||||
|
class="button text-button"
|
||||||
|
name="do_Notify"
|
||||||
|
value="{{ 'Enable notifications' | tr }}"
|
||||||
|
/>
|
||||||
|
</form>
|
||||||
|
{% endif %}
|
||||||
|
</li>
|
||||||
|
{% endif %}
|
||||||
{% if request.user.has_credential(creds.PKGBASE_EDIT_COMAINTAINERS, approved=[pkgbase.Maintainer]) %}
|
{% if request.user.has_credential(creds.PKGBASE_EDIT_COMAINTAINERS, approved=[pkgbase.Maintainer]) %}
|
||||||
<li>
|
<li>
|
||||||
<a href="/pkgbase/{{ pkgbase.Name }}/comaintainers">
|
<a href="/pkgbase/{{ pkgbase.Name }}/comaintainers">
|
||||||
|
|
Loading…
Add table
Reference in a new issue