housekeep: move pkgbase templates to their own dir

Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
Kevin Morris 2022-01-17 13:10:59 -08:00
parent 7f6c23d4cb
commit e1a87c3407
No known key found for this signature in database
GPG key ID: F7E46DED420788F3
9 changed files with 11 additions and 11 deletions

View file

@ -1,44 +0,0 @@
{% extends "partials/layout.html" %}
{% block pageContent %}
<div class="box">
<h2>{{ "Edit comment for: %s" | tr | format(comment.PackageBase.Name) }}</h2>
<form action="/pkgbase/{{ comment.PackageBase.Name }}/comments/{{ comment.ID }}"
method="post">
<fieldset>
<div>
<input type="hidden" name="next" value="{{ next }}" />
</div>
<p>
{{
"Git commit identifiers referencing commits in "
"the AUR package repository and URLs are converted "
"to links automatically." | tr
}}
{{
"%sMarkdown syntax%s is partiaully supported."
| tr | format(
'<a href="https://daringfireball.net/projects/markdown/syntax">',
"</a>"
) | safe
}}
</p>
<p>
<textarea id="id_comment"
name="comment"
cols="80"
rows="10">{{ comment.Comments }}</textarea>
</p>
<p>
<input type="submit" value="{{ 'Save' | tr }}" />
</p>
</fieldset>
</form>
</div>
{% endblock %}

View file

@ -1,74 +0,0 @@
{% extends "partials/layout.html" %}
{% block pageContent %}
{% if errors %}
<ul class="errorlist">
{% for error in errors %}
<li>{{ error | tr }}</li>
{% endfor %}
</ul>
{% endif %}
<div class="box">
<h2>{{ "Delete Package" | tr }}: {{ pkgbase.Name }}</h2>
<p>
{{
"Use this form to delete the package base %s%s%s and "
"the following packages from the AUR: "
| tr | format("<strong>", pkgbase.Name, "</strong>") | safe
}}
</p>
<ul>
{% for package in pkgbase.packages.all() %}
<li>{{ package.Name }}</li>
{% endfor %}
</ul>
<p>
{{
"This action will close any pending package requests "
"related to it. If %sComments%s are omitted, a closure "
"comment will be autogenerated."
| tr | format("<em>", "</em>") | safe
}}
</p>
<p>
{{
"Deletion of a package is permanent. "
"Select the checkbox to confirm action." | tr
}}
</p>
<form action="/pkgbase/{{ pkgbase.Name }}/delete" method="post">
<fieldset>
<p>
<label for="id_comments">{{ "Comments" | tr }}:</label>
<textarea id="id_comments" name="comments"
rows="5" cols="50"
placeholder="Related package request closure comments..."
></textarea>
</p>
<p>
<label class="confirmation">
<input type="checkbox" name="confirm" value="1" />
{{ "Confirm package deletion" | tr }}
</label>
</p>
<p>
<input class="button"
type="submit"
value="{{ 'Delete' | tr }}"
/>
</p>
</fieldset>
</form>
</div>
{% endblock %}

View file

@ -1,73 +0,0 @@
{% extends "partials/layout.html" %}
{% block pageContent %}
{% if errors %}
<ul class="errorlist">
{% for error in errors %}
<li>{{ error | tr }}</li>
{% endfor %}
</ul>
{% endif %}
<div class="box">
<h2>{{ "Disown Package" | tr }}: {{ pkgbase.Name }}</h2>
<p>
{{
"Use this form to disown the package base %s%s%s which "
"includes the following packages: "
| tr | format("<strong>", pkgbase.Name, "</strong>") | safe
}}
</p>
<ul>
{% for package in pkgbase.packages.all() %}
<li>{{ package.Name }}</li>
{% endfor %}
</ul>
<p>
{{
"This action will close any pending package requests "
"related to it. If %sComments%s are omitted, a closure "
"comment will be autogenerated."
| tr | format("<em>", "</em>") | safe
}}
</p>
<p>
{{
"By selecting the checkbox, you confirm that you want to "
"disown the package." | tr
}}
</p>
<form action="/pkgbase/{{ pkgbase.Name }}/disown" method="post">
<fieldset>
<p>
<label for="id_comments">{{ "Comments" | tr }}:</label>
<textarea id="id_comments"
name="comments"
rows="5" cols="50"
placeholder="Related package request closure comments..."
></textarea>
</p>
<p>
<label class="confirmation">
<input type="checkbox" name="confirm" value="1" />
{{ "Confirm to disown the package" | tr }}
</label>
</p>
<p>
<input class="button"
type="submit"
value="{{ 'Disown' | tr }}"
/>
</p>
</fieldset>
</form>
</div>
{% endblock %}

View file

@ -1,46 +0,0 @@
{% extends "partials/layout.html" %}
{% block pageContent %}
<div class="box">
<h2>{{ "Flagged Out-of-Date Comment: %s" | tr | format(pkgbase.Name) }}</h2>
{# Prepare wrapping for the username. #}
{% set wrap = ["", ""] %}
{% if request.user.is_authenticated() %}
{# When logged in, we wrap it with a link to the account. #}
{% set wrap = ['<a href="/account/%s">' | format(pkgbase.Flagger.Username), "</a>"] %}
{% endif %}
{# Prepare OutOfDateTS as a datetime object in the request user's timezone. #}
{% set flagged_at = pkgbase.OutOfDateTS | dt | as_timezone(timezone) %}
{% set username = "%s%s%s" | format(wrap[0], pkgbase.Flagger.Username, wrap[1]) %}
<p>
{{
"%s%s%s flagged %s%s%s out-of-date on %s%s%s for the "
"following reason:"
| tr | format("<strong>", username, "</strong>",
"<strong>", pkgbase.Name, "</strong>",
"<strong>", flagged_at.strftime("%Y-%m-%d"), "</strong>")
| safe
}}
</p>
{# Padding #}
<p></p>
<div class="article-content">
<blockquote>
<p>{{ pkgbase.FlaggerComment }}</p>
</blockquote>
</div>
<form action="/pkgbase/{{ pkgbase.Name }}">
<input type="submit" value="{{ 'Return to Details' | tr }}" />
</form>
{# Padding #}
<p></p>
</div>
{% endblock %}

View file

@ -1,71 +0,0 @@
{% extends "partials/layout.html" %}
{% block pageContent %}
<div class="box">
<h2>{{ "Flag Package Out-Of-Date" | tr }}: {{ pkgbase.Name }}</h2>
<p>
{{
"Use this form to flag the package base %s%s%s and "
"the following packages out-of-date: "
| tr | format("<strong>", pkgbase.Name, "</strong>") | safe
}}
</p>
<ul>
{% for package in pkgbase.packages.all() %}
<li>{{ package.Name }}</li>
{% endfor %}
</ul>
{% if pkgbase.Name.endswith(('-cvs', '-svn', '-git', '-hg', '-bzr', '-darcs')) %}
<p class="error">
{# TODO: This error is not yet translated. #}
{{
"This seems to be a VCS package. Please do %snot%s flag "
"it out-of-date if the package version in the AUR does "
"not match the most recent commit. Flagging this package "
"should only be done if the sources moved or changes in "
"the PKGBUILD are required because of recent upstream "
"changes." | tr | format("<strong>", "</strong>") | safe
}}
</p>
{% endif %}
<p>
{{
"Please do %snot%s use this form to report bugs. "
"Use the package comments instead."
| tr | format("<strong>", "</strong>") | safe
}}
{{
"Enter details on why the package is out-of-date below, "
"preferably including links to the release announcement "
"or the new release tarball." | tr
}}
</p>
{% if errors %}
<ul class="errorlist">
{% for error in errors %}
<li>{{ error | tr }}</li>
{% endfor %}
</ul>
{% endif %}
<form action="/pkgbase/{{ pkgbase.Name }}/flag" method="post">
<fieldset>
<p>
<label for="id_comments">{{ "Comments" | tr }}:</label>
<textarea id="id_comments"
name="comments"
rows="5"
cols="50"></textarea>
</p>
<p>
<input class="button" type="submit" value="{{ 'Flag' | tr }}" />
</p>
</fieldset>
</form>
</div>
{% endblock %}

View file

@ -0,0 +1,98 @@
{% extends "partials/layout.html" %}
{% block pageContent %}
{% if errors %}
<ul class="errorlist">
{% for error in errors %}
<li>{{ error | tr }}</li>
{% endfor %}
</ul>
{% include "partials/packages/search.html" %}
{% elif not packages_count %}
{% include "partials/packages/search.html" %}
<div id="pkglist-results" class="box">
<p>{{ "No packages matched your search criteria." | tr }}</p>
</div>
{% if success %}
<ul class="success">
{% for message in success %}
<li>{{ message | tr }}</li>
{% endfor %}
</ul>
{% endif %}
{% else %}
{% set pages = (packages_count / PP) | ceil %}
{% set page = O / PP %}
{% if success %}
<ul class="success">
{% for message in success %}
<li>{{ message | tr }}</li>
{% endfor %}
</ul>
{% endif %}
{# Search form #}
{% include "partials/packages/search.html" %}
<div id="pkglist-results" class="box">
{# /packages does things a bit roundabout-wise:
If SeB is not given, "nd" is the default.
If SB is not given, "p" is the default.
If SO is not given, "d" is the default.
However, we depend on flipping SO for column sorting.
This section sets those defaults for the context if
they are not already setup. #}
{% if not SeB %}
{% set SeB = "nd" %}
{% endif %}
{% if not SB %}
{% set SB = "p" %}
{% endif %}
{% if not SO %}
{% set SO = "d" %}
{% endif %}
{# Pagination widget #}
{% with total = packages_count,
singular = "%d package found.",
plural = "%d packages found.",
prefix = "/packages" %}
{% include "partials/widgets/pager.html" %}
{% endwith %}
{# Package action form: persists query parameters. #}
<form id="pkglist-results-form"
action="/packages?{{ q | urlencode }}" method="post"
>
{# Search results #}
{% with voted = packages_voted, notified = packages_notified %}
{% include "partials/packages/search_results.html" %}
{% endwith %}
{# Pagination widget #}
{% with total = packages_count,
singular = "%d package found.",
plural = "%d packages found.",
prefix = "/packages" %}
{% include "partials/widgets/pager.html" %}
{% endwith %}
{% if request.user.is_authenticated() %}
{# Package actions #}
{% include "partials/packages/search_actions.html" %}
{% endif %}
</form>
</div>
{% endif %}
{% endblock %}