aurweb/templates/partials/packages/actions.html
Kevin Morris 267f2cb2c4
fix(fastapi): remove trailing slashes from fastapi-driven links
With our FastAPI server, trailing slashes causes a 307 redirect
which ends up redirecting users to routes which do not contain
trailing slashes. This removes trailing slashes from our templates
where FastAPI is concerned to avoid unnecessary redirects.

There may still be links or usages around which have unnecessary
usages of a trailing slash; please keep a look out for these and
remove them where possible.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-10-18 22:42:40 -07:00

140 lines
5.5 KiB
HTML

<!--
This partial requires pkgbase.Name to render
-->
<div id="detailslinks" class="listing">
<div id="actionlist">
<h4>{{ "Package Actions" | tr }}</h4>
<ul class="small">
<li>
<a href="/cgit/aur.git/tree/PKGBUILD?h={{ pkgbase.Name }}">
{{ "View PKGBUILD" | tr }}
</a>
/
<a href="/cgit/aur.git/log/?h={{ pkgbase.Name }}">
{{ "View Changes" | tr }}
</a>
</li>
<li>
<a href="/cgit/aur.git/snapshot/{{ pkgbase.Name }}.tar.gz">
{{ "Download snapshot" | tr }}
</a>
</li>
<li>
<a href="https://wiki.archlinux.org/title/Special:Search?search={{ pkgbase.Name }}">
{{ "Search wiki" | tr }}
</a>
</li>
{% if not out_of_date %}
<li>
<a href="/pkgbase/{{ pkgbase.Name }}/flag">
{{ "Flag package out-of-date" | tr }}
</a>
</li>
{% else %}
<li>
<span class="flagged">
{% set ood_ts = pkgbase.OutOfDateTS | dt | as_timezone(timezone) %}
{{
"Flagged out-of-date (%s)"
| tr | format(ood_ts.strftime("%Y-%m-%d"))
}}
</span>
</li>
<li>
<form action="/pkgbase/{{ pkgbase.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/{{ 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>
{% if request.user.has_credential('CRED_PKGBASE_EDIT_COMAINTAINERS', approved=[pkgbase.Maintainer]) %}
<li>
<a href="/pkgbase/{{ pkgbase.Name }}/comaintainers">
{{ "Manage Co-Maintainers" | tr }}
</a>
</li>
{% endif %}
{% if requests %}
<li>
<span class="flagged">
{{ requests | tn("%d pending request", "%d pending requests") | format(requests) }}
</span>
</li>
{% endif %}
<li>
<a href="/pkgbase/{{ pkgbase.Name }}/request">
{{ "Submit Request" | tr }}
</a>
</li>
{% if request.user.has_credential("CRED_PKGBASE_DELETE") %}
<li>
<a href="/pkgbase/{{ pkgbase.Name }}/delete">
{{ "Delete Package" | tr }}
</a>
</li>
{% endif %}
{% if request.user.has_credential("CRED_PKGBASE_MERGE") %}
<li>
<a href="/pkgbase/{{ pkgbase.Name }}/merge">
{{ "Merge Package" | tr }}
</a>
</li>
{% endif %}
{% if not pkgbase.Maintainer %}
<li>
<form action="/pkgbase/{{ pkgbase.Name }}/adopt" method="post">
<input type="submit"
class="button text-button"
value="{{ 'Adopt Package' | tr }}"
/>
</form>
</li>
{% elif request.user.has_credential("CRED_PKGBASE_DISOWN", approved=[pkgbase.Maintainer]) %}
<li>
<a href="/pkgbase/{{ pkgbase.Name }}/disown">
{{ "Disown Package" | tr }}
</a>
</li>
{% endif %}
</ul>
</div>
</div>