finished settings edit page

This commit is contained in:
Artemis 2025-01-25 21:46:11 +01:00
parent 586abc90b8
commit 6652a35ae9

View file

@ -1,14 +1,29 @@
{% extends "base" %}
{% import "macros/form" as form %}
{% block title %}Settings - {% endblock title %}
{% block main %}
<h2>Your settings</h2>
<div class="fields raised">
<form method="post" action="/account/settings/common">
<input type="hidden" name="form" value="info">
{% if prev_common.form_errors | length > 0 %}
<div class="form-error">
<h4>Some errors were encountered...</h4>
<ul>
{% for err in prev_common.form_errors %}
<li>{{err}}</li>
{% endfor %}
</ul>
</div>
{% endif %}
<div>
<p class="heading"><label for="username">Username</label></p>
<input type="text" id="username" name="username" maxlength="256" placeholder="{{user.username}}">
<input type="text" id="username" name="username" maxlength="256" placeholder="{{user.username}}"
{{form::value(ctx=prev_common, name="username" )}}>
{{form::error(ctx=prev_common, name="username")}}
<p class="note">
Reminder: your username is your login ID.
If you change it, don't forget to use the new one to log in.
@ -17,7 +32,9 @@
<div>
<p class="heading"><label for="email">Recovery email</label></p>
<input type="email" id="email" name="email" maxlength="254" placeholder="{{user.email}}">
<input type="email" id="email" name="email" maxlength="254" placeholder="{{user.email}}"
{{form::value(ctx=prev_common, name="email" )}}>
{{form::error(ctx=prev_common, name="email")}}
</div>
<button type="submit">Save those changes</button>
@ -26,18 +43,23 @@
<div class="fields raised">
<form method="post" action="/account/settings/password">
<input type="hidden" name="form" value="password">
<div>
<p class="heading"><label for="old_password">Current password</label></p>
<input type="password" id="old_password" name="old_password" minlength="8">
<input type="password" id="old_password" name="old_password" minlength="8" {{form::value(ctx=prev_common,
name="old_password" )}}>
{{form::error(ctx=prev_password, name="old_password")}}
</div>
<div>
<p class="heading"><label for="password">New password</label></p>
<input type="password" id="password" name="password" minlength="8">
<input type="password" id="password" name="password" minlength="8" {{form::value(ctx=prev_common,
name="password" )}}>
{{form::error(ctx=prev_password, name="password")}}
</div>
<div>
<p class="heading"><label for="confirm_password">Confirm the password</label></p>
<input type="password" id="confirm_password" name="confirm_password" minlength="8">
<input type="password" id="confirm_password" name="confirm_password" minlength="8"
{{form::value(ctx=prev_common, name="confirm_password" )}}>
{{form::error(ctx=prev_password, name="confirm_password")}}
</div>
<button type="submit">Change your password</button>
@ -64,4 +86,5 @@
<p>This is not a recoverable operation.</p>
<a href="/account/terminate" class="error btn">Delete my account</a>
</section>
{% endblock main %}