Add a toggle between dark and light theme

This commit is contained in:
Greg Burri 2025-03-31 15:31:06 +02:00
parent d22617538e
commit 559ed139aa
34 changed files with 640 additions and 469 deletions

View file

@ -2,14 +2,14 @@
{% block main_container %}
{% if let Some(user) = user %}
{% if let Some(user) = context.user %}
<div class="content" id="user-edit">
<h1>{{ tr.t(Sentence::ProfileTitle) }}</h1>
<h1>{{ context.tr.t(Sentence::ProfileTitle) }}</h1>
<form action="/{{ tr.current_lang_code() }}/user/edit" method="post">
<form action="/{{ context.tr.current_lang_code() }}/user/edit" method="post">
<label for="input-name">{{ tr.t(Sentence::Name) }}</label>
<label for="input-name">{{ context.tr.t(Sentence::Name) }}</label>
<input
id="input-name"
type="text"
@ -20,13 +20,13 @@
autofocus="autofocus">
<span></span>
<label for="input-email">{{ tr.t(Sentence::ProfileEmail) }}</label>
<label for="input-email">{{ context.tr.t(Sentence::ProfileEmail) }}</label>
<input id="input-email" type="email"
name="email" value="{{ email }}"
autocapitalize="none" autocomplete="email" autofocus="autofocus">
<span class="user-message">{{ message_email }}</span>
<label for="input-servings">{{ tr.t(Sentence::ProfileDefaultServings) }}</label>
<label for="input-servings">{{ context.tr.t(Sentence::ProfileDefaultServings) }}</label>
<input
id="input-servings"
type="number"
@ -35,15 +35,15 @@
value="{{ default_servings }}">
<span></span>
<label for="input-password-1">{{ tr.tp(Sentence::ProfileNewPassword, [Box::new(common::consts::MIN_PASSWORD_SIZE)]) }}</label>
<label for="input-password-1">{{ context.tr.tp(Sentence::ProfileNewPassword, [Box::new(common::consts::MIN_PASSWORD_SIZE)]) }}</label>
<input id="input-password-1" type="password" name="password_1" autocomplete="new-password">
<span></span>
<label for="input-password-2">{{ tr.t(Sentence::ReEnterPassword) }}</label>
<label for="input-password-2">{{ context.tr.t(Sentence::ReEnterPassword) }}</label>
<input id="input-password-2" type="password" name="password_2" autocomplete="new-password">
<span class="user-message">{{ message_password }}</span>
<input type="submit" name="commit" value="{{ tr.t(Sentence::Save) }}">
<input type="submit" name="commit" value="{{ context.tr.t(Sentence::Save) }}">
</form>
<span class="user-message">{{ message }}</span>