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

@ -0,0 +1,44 @@
{% 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

@ -0,0 +1,74 @@
{% 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

@ -0,0 +1,73 @@
{% 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

@ -0,0 +1,46 @@
{% 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

@ -0,0 +1,71 @@
{% 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,23 @@
{% extends "partials/layout.html" %}
{% block pageContent %}
{% include "partials/packages/search.html" %}
<div id="pkgdetails" class="box">
<h2>{{ 'Package Base Details' | tr }}: {{ pkgbase.Name }}</h2>
{% set result = pkgbase %}
{% include "partials/packages/actions.html" %}
{% include "partials/packages/details.html" %}
<div id="metadata">
{% include "partials/packages/pkgbase_metadata.html" %}
</div>
</div>
<!-- On-the-fly comment editing functions -->
<script type="text/javascript" src="/static/js/comment-edit.js"></script>
{% set pkgname = result.Name %}
{% set pkgbase_id = result.ID %}
{% include "partials/packages/comments.html" %}
{% endblock %}