mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
This clones the end goal behavior of PHP, but it does not concern itself with the revision form array at all. Since this page on PHP renders out the entire list of terms that a user needs to accept, we can treat a POST request with the "accept" checkbox enabled as a request to accept all unaccepted (or outdated revision) terms. This commit also adds in a new http middleware used to redirect authenticated users to '/tos' if they have not yet accepted all terms. Signed-off-by: Kevin Morris <kevr@0cost.org>
46 lines
1.7 KiB
HTML
46 lines
1.7 KiB
HTML
{% extends "partials/layout.html" %}
|
|
|
|
{% block pageContent %}
|
|
<div id="dev-login" class="box">
|
|
<h2>AUR {% trans %}Terms of Service{% endtrans %}</h2>
|
|
<form method="post" action="/tos">
|
|
<fieldset>
|
|
<p>
|
|
{{
|
|
"Logged-in as: %s"
|
|
| tr | format(
|
|
"<strong>" + request.user.Username + "</strong>")
|
|
| safe
|
|
}}
|
|
</p>
|
|
<p>
|
|
{{
|
|
"The following documents have been updated. "
|
|
"Please review them carefully:" | tr
|
|
}}
|
|
</p>
|
|
<ul>
|
|
{% for term in unaccepted_terms %}
|
|
<li>
|
|
<a href="{{ term.URL }}">{{ term.Description }}</a>
|
|
(revision {{ term.Revision }})
|
|
</li>
|
|
{% endfor %}
|
|
</ul>
|
|
<p>
|
|
{% for term in unaccepted_terms %}
|
|
<input type="hidden"
|
|
name="rev[{{ loop.index }}]"
|
|
value="{{ term.Revision }}" />
|
|
{% endfor %}
|
|
<input type="checkbox" name="accept" />
|
|
{{ "I accept the terms and conditions above." | tr }}
|
|
</p>
|
|
<p>
|
|
<input type="submit" name="submit"
|
|
value="{{ 'Continue' | tr }}" />
|
|
</p>
|
|
</fieldset>
|
|
</form>
|
|
</div>
|
|
{% endblock %}
|