aurweb/templates/requests/close.html
Kevin Morris f6141ff177
feat(FastAPI): add /requests/{id}/close (get, post)
Changes from PHP:

- If a user submits a POST request with an invalid reason,
  they are returned back to the closure form with a BAD_REQUEST status.
- Now, users which created a PackageRequest have the ability to close
  their own.
- Form action has been changed to `/requests/{id}/close`.

Closes https://gitlab.archlinux.org/archlinux/aurweb/-/issues/20

Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-10-02 22:47:05 -07:00

60 lines
2 KiB
HTML

{% extends "partials/layout.html" %}
{% block pageContent %}
<div class="box">
<h2>{{ "Close Request" | tr }}: {{ pkgreq.PackageBaseName }}</h2>
<p>
{{
"Use this form to close the request for package base %s%s%s."
| tr | format("<strong>", pkgreq.PackageBaseName, "</strong>")
| safe
}}
</p>
<p>
<em>{{ "Note" | tr }}:</em>
{{
"The comments field can be left empty. However, it is highly "
"recommended to add a comment when rejecting a request."
| tr
}}
</p>
<form action="/requests/{{ pkgreq.ID }}/close" method="post">
<fieldset>
<p>
<label for="id_reason">{{ "Reason" | tr }}:</label>
<select id="id_reason" name="reason">
{# Value 2 == "Accepted" status.
See aurweb.models.package_request. #}
{% if request.user.is_elevated() %}
<option value="2">
{{ "Accepted" | tr }}
</option>
{% endif %}
{# Value 3 == "Rejected" status.
See aurweb.models.package_request. #}
<option value="3">
{{ "Rejected" | tr }}
</option>
</select>
</p>
<p>
<label for="id_comments">{{ "Comments" | tr }}:</label>
<textarea id="id_comments" name="comments"
rows="5" cols="50"></textarea>
</p>
<p>
<button class="button" type="submit">
{{ "Close Request" | tr }}
</button>
</p>
</fieldset>
</form>
</div>
{% endblock %}