aurweb/templates/partials/packages/details.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

143 lines
5 KiB
HTML

{% set pkg = pkgbase.packages.first() %}
<table id="pkginfo">
<tr>
<th>{{ "Git Clone URL" | tr }}:</th>
<td>
<a class="copy" href="{{ git_clone_uri_anon | format(pkgbase.Name) }}">{{ git_clone_uri_anon | format(pkgbase.Name) }}</a> ({{ "read-only" | tr }}, {{ "click to copy" | tr }})
{% if is_maintainer %}
<br /> <a class="copy" href="{{ git_clone_uri_priv | format(pkgbase.Name) }}">{{ git_clone_uri_priv | format(pkgbase.Name) }}</a> ({{ "click to copy" | tr }})
{% endif %}
</td>
</tr>
{% if show_package_details | default(False) %}
<tr>
<th>{{ "Package Base" | tr }}:</th>
<td class="wrap">
<a href="/pkgbase/{{ pkgbase.Name }}">
{{ pkgbase.Name }}
</a>
</td>
</tr>
<tr>
<th>{{ "Description" | tr }}:</th>
<td class="wrap">{{ pkg.Description }}</td>
</tr>
<tr>
<th>{{ "Upstream URL" | tr }}:</th>
<td class="wrap">
{% if pkg.URL %}
<a href="{{ pkg.URL }}">{{ pkg.URL }}</a>
{% else %}
{{ "None" | tr }}
{% endif %}
</td>
</tr>
{% endif %}
<tr>
<th>{{ "Keywords" | tr }}:</th>
{% if request.user.has_credential("CRED_PKGBASE_SET_KEYWORDS", approved=[pkgbase.Maintainer]) %}
<td>
<form method="update"
action="/pkgbase/{{ pkgbase.Name }}/keywords"
>
<div>
<input type="text"
name="keywords"
value="{{ pkgbase.keywords | join(' ', attribute='Keyword') }}"
/>
<input type="submit" value="{{ 'Update' | tr }}"/>
</div>
</form>
</td>
{% else %}
<td>
{% for keyword in pkgbase.keywords %}
<a class="keyword"
href="/packages/?K={{ keyword.Keyword }}&amp;SB=p"
>
{{ keyword.Keyword }}
</a>
{% endfor %}
</td>
{% endif %}
</tr>
{% if licenses and licenses.scalar() and show_package_details %}
<tr>
<th>{{ "Licenses" | tr }}:</th>
<td>{{ licenses | join(', ', attribute='Name') | default('None' | tr) }} </td>
</tr>
{% endif %}
{% if show_package_details %}
<tr>
<th>{{ "Conflicts" | tr }}:</th>
<td class="wrap">
{{ conflicts | join(', ', attribute='RelName') }}
</td>
</tr>
{% endif %}
<tr>
<th>{{ "Submitter" | tr }}:</th>
<td>
{% if request.user.is_authenticated() %}
<a href="/account/{{ pkgbase.Submitter.Username }}">
{{ pkgbase.Submitter.Username | default("None" | tr) }}
</a>
{% else %}
{{ pkgbase.Submitter.Username | default("None" | tr) }}
{% endif %}
</td>
</tr>
<tr>
<th>{{ "Maintainer" | tr }}:</th>
<td>
{% if request.user.is_authenticated() %}
<a href="/account/{{ pkgbase.Maintainer.Username }}">
{{ pkgbase.Maintainer.Username | default("None" | tr) }}
</a>
{% else %}
{{ pkgbase.Maintainer.Username | default("None" | tr) }}
{% endif %}
</td>
</tr>
<tr>
<th>{{ "Last Packager" | tr }}:</th>
<td>
{% if request.user.is_authenticated() %}
<a href="/account/{{ pkgbase.Packager.Username }}">
{{ pkgbase.Packager.Username | default("None" | tr) }}
</a>
{% else %}
{{ pkgbase.Packager.Username | default("None" | tr) }}
{% endif %}
</td>
</tr>
<tr>
<th>{{ "Votes" | tr }}:</th>
{% if not is_maintainer %}
<td>{{ pkgbase.package_votes.count() }}</td>
{% else %}
<td>
<a href="/pkgbase/{{ pkgbase.Name }}/voters">
{{ pkgbase.package_votes.count() }}
</a>
</td>
{% endif %}
</tr>
<tr>
<th>{{ "Popularity" | tr }}:</th>
<td>{{ pkgbase.Popularity | number_format(6 if pkgbase.Popularity <= 0.2 else 2) }}</td>
</tr>
<tr>
{% set submitted = pkgbase.SubmittedTS | dt | as_timezone(timezone) %}
<th>{{ "First Submitted" | tr }}:</th>
<td>{{ "%s" | format(submitted.strftime("%Y-%m-%d %H:%M")) }}</td>
</tr>
<tr>
<th>{{ "Last Updated" | tr }}:</th>
{% set updated = pkgbase.ModifiedTS | dt | as_timezone(timezone) %}
<td>{{ "%s" | format(updated.strftime("%Y-%m-%d %H:%M")) }}</td>
</tr>
</table>
<script type="text/javascript" src="/static/js/copy.js"></script>