User profile edit page

This commit is contained in:
Greg Burri 2024-12-17 21:28:47 +01:00
parent 38c286e860
commit 4248d11aa9
15 changed files with 450 additions and 175 deletions

View file

@ -7,7 +7,13 @@
{% match user %}
{% when Some with (user) %}
<a class="create-recipe" href="/recipe/new" >Create a new recipe</a>
<span><a href="/user/edit">{{ user.email }}</a> / <a href="/signout" />Sign out</a></span>
<span><a href="/user/edit">
{% if user.name == "" %}
{{ user.email }}
{% else %}
{{ user.name }}
{% endif %}
</a> / <a href="/signout" />Sign out</a></span>
{% when None %}
<span>
<a href="/signin" >Sign in</a>/<a href="/signup">Sign up</a>/<a href="/ask_reset_password">Lost password</a>

View file

@ -9,28 +9,34 @@
<h1>Profile</h1>
<form id="user-edit">
<form action="/user/edit" method="post">
<label for="input-name">Name</label>
<input
id="input-name"
type="text"
name="name"
value="{{ user.name }}"
value="{{ username }}"
autocapitalize="none"
autocomplete="title"
autofocus="autofocus" />
<label for="input-email">Email (need to be revalidated if changed)</label>
<input id="input-email" type="email" name="email" value="{{ email }}" autocapitalize="none" autocomplete="email" autofocus="autofocus" />
{{ message_email }}
<label for="input-password-1">New password (minimum 8 characters)</label>
<input id="input-password-1" type="password" name="password_1" />
<input id="input-password-1" type="password" name="password_1" autocomplete="new-password" />
<label for="input-password-2">Re-enter password</label>
<input id="input-password-2" type="password" name="password_2" />
<input id="input-password-2" type="password" name="password_2" autocomplete="new-password" />
<input type="button" value="Save" />
{{ message_password }}
<input type="submit" name="commit" value="Save" />
</form>
{{ message }}
</div>
{% when None %}

View file

@ -8,6 +8,7 @@
<form action="/signup" method="post">
<label for="input-email">Your email address</label>
<input id="input-email" type="email" name="email" value="{{ email }}" autocapitalize="none" autocomplete="email" autofocus="autofocus" />
{{ message_email }}
<label for="input-password-1">Choose a password (minimum 8 characters)</label>