mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
change(FastAPI): depend on auth_required redirect for pkgbase actions
Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
parent
8bc1fab74d
commit
dc11a88ed3
1 changed files with 51 additions and 82 deletions
|
@ -23,99 +23,68 @@
|
|||
{{ "Search wiki" | tr }}
|
||||
</a>
|
||||
</li>
|
||||
{% if not request.user.is_authenticated() %}
|
||||
{% if not out_of_date %}
|
||||
{% if not out_of_date %}
|
||||
<li>
|
||||
<a href="/pkgbase/{{ result.Name }}/flag/">
|
||||
{{ "Flag package out-of-date" | tr }}
|
||||
</a>
|
||||
</li>
|
||||
{% else %}
|
||||
<li>
|
||||
<span class="flagged">
|
||||
{% set ood_ts = result.OutOfDateTS | dt | as_timezone(timezone) %}
|
||||
{{
|
||||
"Flagged out-of-date (%s)"
|
||||
| tr | format(ood_ts.strftime("%Y-%m-%d"))
|
||||
}}
|
||||
</span>
|
||||
</li>
|
||||
{% endif %}
|
||||
<li>
|
||||
<a href="/login?next={{ request.url.path | quote_plus }}">
|
||||
{{ "Vote for this package" | tr }}
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="/login?next={{ request.url.path | quote_plus }}">
|
||||
{{ "Enable notifications" | tr }}
|
||||
</a>
|
||||
</li>
|
||||
{% else %}
|
||||
{% if not out_of_date %}
|
||||
<li>
|
||||
<a href="/pkgbase/{{ result.Name }}/flag/">
|
||||
{{ "Flag package out-of-date" | tr }}
|
||||
</a>
|
||||
</li>
|
||||
{% else %}
|
||||
<li>
|
||||
<span class="flagged">
|
||||
{% set ood_ts = result.OutOfDateTS | dt | as_timezone(timezone) %}
|
||||
{{
|
||||
"Flagged out-of-date (%s)"
|
||||
| tr | format(ood_ts.strftime("%Y-%m-%d"))
|
||||
}}
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<form action="/pkgbase/{{ result.Name }}/unflag" method="post">
|
||||
<input class="button text-button"
|
||||
type="submit"
|
||||
name="do_UnFlag"
|
||||
value="{{ 'Unflag package' | tr }}"
|
||||
<li>
|
||||
<span class="flagged">
|
||||
{% set ood_ts = result.OutOfDateTS | dt | as_timezone(timezone) %}
|
||||
{{
|
||||
"Flagged out-of-date (%s)"
|
||||
| tr | format(ood_ts.strftime("%Y-%m-%d"))
|
||||
}}
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<form action="/pkgbase/{{ result.Name }}/unflag" method="post">
|
||||
<input class="button text-button"
|
||||
type="submit"
|
||||
name="do_UnFlag"
|
||||
value="{{ 'Unflag package' | tr }}"
|
||||
/>
|
||||
</form>
|
||||
</li>
|
||||
{% endif %}
|
||||
<li>
|
||||
{% if not voted %}
|
||||
<form action="/pkgbase/{{ result.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/{{ result.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/{{ result.Name }}/unnotify/" method="post">
|
||||
<input type="submit"
|
||||
class="button text-button"
|
||||
name="do_UnNotify"
|
||||
value="{{ 'Disable notifications' | tr }}"
|
||||
/>
|
||||
</form>
|
||||
</li>
|
||||
{% endif %}
|
||||
<li>
|
||||
{% if not voted %}
|
||||
<form action="/pkgbase/{{ result.Name }}/vote/" method="post">
|
||||
{% else %}
|
||||
<form action="/pkgbase/{{ result.Name }}/notify/" method="post">
|
||||
<input type="submit"
|
||||
class="button text-button"
|
||||
name="do_Vote"
|
||||
value="{{ 'Vote for this package' | tr }}" />
|
||||
name="do_Notify"
|
||||
value="{{ 'Enable notifications' | tr }}"
|
||||
/>
|
||||
</form>
|
||||
{% else %}
|
||||
<form action="/pkgbase/{{ result.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/{{ result.Name }}/unnotify/" method="post">
|
||||
<input type="submit"
|
||||
class="button text-button"
|
||||
name="do_UnNotify"
|
||||
value="{{ 'Disable notifications' | tr }}"
|
||||
/>
|
||||
</form>
|
||||
{% else %}
|
||||
<form action="/pkgbase/{{ result.Name }}/notify/" method="post">
|
||||
<input type="submit"
|
||||
class="button text-button"
|
||||
name="do_Notify"
|
||||
value="{{ 'Enable notifications' | tr }}"
|
||||
/>
|
||||
</form>
|
||||
{% endif %}
|
||||
</li>
|
||||
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</li>
|
||||
</form>
|
||||
{% if request.user.has_credential('CRED_PKGBASE_EDIT_COMAINTAINERS', approved=[pkgbase.Maintainer]) %}
|
||||
<li>
|
||||
|
|
Loading…
Add table
Reference in a new issue