mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
add account edit (settings) routes
* Added account_url filter to jinja2 environment. This produces a path to the user's account url (/account/{username}). * Updated archdev-navbar to link to new edit route. + Added migrate_cookies(request, response) to aurweb.util, a function that simply migrates the request cookies to response and returns it. + Added account_edit tests to test_accounts_routes.py. Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
parent
d323c1f95b
commit
4e9ef6fb00
7 changed files with 522 additions and 5 deletions
46
templates/account/edit.html
Normal file
46
templates/account/edit.html
Normal file
|
@ -0,0 +1,46 @@
|
|||
{% extends "partials/layout.html" %}
|
||||
|
||||
{% block pageContent %}
|
||||
<div class="box">
|
||||
<h2>{% trans %}Accounts{% endtrans %}</h2>
|
||||
|
||||
{% if complete %}
|
||||
|
||||
{{
|
||||
"The account, %s%s%s, has been successfully modified."
|
||||
| tr
|
||||
| format("<strong>", user.Username, "</strong>")
|
||||
| safe
|
||||
}}
|
||||
|
||||
{% else %}
|
||||
{% if errors %}
|
||||
{% include "partials/error.html" %}
|
||||
{% else %}
|
||||
<p>
|
||||
{{ "Click %shere%s if you want to permanently delete this account."
|
||||
| tr
|
||||
| format('<a href="%s/delete">' | format(user | account_url),
|
||||
"</a>")
|
||||
| safe
|
||||
}}
|
||||
{{ "Click %shere%s for user details."
|
||||
| tr
|
||||
| format('<a href="%s">' | format(user | account_url),
|
||||
"</a>")
|
||||
| safe
|
||||
}}
|
||||
{{ "Click %shere%s to list the comments made by this account."
|
||||
| tr
|
||||
| format('<a href="%s/comments">' | format(user | account_url),
|
||||
"</a>")
|
||||
| safe
|
||||
}}
|
||||
</p>
|
||||
{% endif %}
|
||||
|
||||
{% set form_type = "UpdateAccount" %}
|
||||
{% include "partials/account_form.html" %}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
|
@ -42,6 +42,15 @@
|
|||
"account is inactive." | tr }}</em>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<label for="id_inactive">{% trans %}Inactive{% endtrans %}:</label>
|
||||
<input id="id_inactive" type="checkbox" name="J"
|
||||
{% if inactive %}
|
||||
checked="checked"
|
||||
{% endif %}
|
||||
>
|
||||
</p>
|
||||
|
||||
{% if request.user.has_credential("CRED_ACCOUNT_CHANGE_TYPE") %}
|
||||
<p>
|
||||
<label for="id_type">
|
||||
|
|
|
@ -6,16 +6,28 @@
|
|||
<li><a href="/">AUR {% trans %}Home{% endtrans %}</a></li>
|
||||
{% endif %}
|
||||
<li><a href="/packages/">{% trans %}Packages{% endtrans %}</a></li>
|
||||
<li><a href="/register/">{% trans %}Register{% endtrans %}</a></li>
|
||||
<li>
|
||||
{% if request.user.is_authenticated() %}
|
||||
{% if request.user.is_authenticated() %}
|
||||
<li>
|
||||
<a href="/account/{{ request.user.Username }}/edit">
|
||||
{% trans %} My Account{% endtrans %}
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="/logout/?next={{ next }}">
|
||||
{% trans %}Logout{% endtrans %}
|
||||
</a>
|
||||
{% else %}
|
||||
</li>
|
||||
{% else %}
|
||||
<li>
|
||||
<a href="/register">
|
||||
{% trans %}Register{% endtrans %}
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="/login/?next={{ next }}">
|
||||
{% trans %}Login{% endtrans %}
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
</li>
|
||||
</ul>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue