refactor: more logs, add english template

This commit is contained in:
Mysh! 2025-04-03 16:20:14 +02:00
parent 02a75b7d53
commit fda300e91d
No known key found for this signature in database
GPG key ID: 96739F8E0F9A0F2D
3 changed files with 375 additions and 113 deletions

62
templates/reset.en.gohtml Normal file
View file

@ -0,0 +1,62 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Password Reset</title>
<style>
body {
padding: 1rem;
font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
input {
margin-top: 1rem;
padding: 1rem;
background: transparent;
border: 1px solid black;
color: black;
}
label {
display: block;
}
@media (prefers-color-scheme: dark) {
body {
background-color: #222;
color: white;
}
input {
border: 1px solid #ffffff;
color: #ffffff;
}
}
</style>
</head>
<body>
<h1>Password Reset</h1>
{{ if .Error }}
{{ .Error }}
{{ else }}
{{ if .UniqueLinkTriggered }}
<p>Enter your new password below.</p>
<form action="" method="post">
<label for="password">Your new password</label>
<input type="password" name="password" id="password" placeholder="Enter your new password">
</form>
{{ else }}
{{ if .Sent }}
<p>A password reset email has been sent if that address exists.</p>
{{ else }}
<form action="/reset" method="post">
<label for="email">Email address</label>
<input type="email" name="email" id="email" placeholder="Enter your email address">
</form>
{{ end }}
{{ end }}
{{ end }}
</body>
</html>

View file

@ -38,20 +38,24 @@
</head>
<body>
<h1>Сброс пароля</h1>
{{ if .UniqueLinkTriggered }}
<p>Напишите здесь ваш новый пароль</p>
<form action="" method="post">
<label for="password">Ваш новый пароль</label>
<input type="password" name="password" id="password" placeholder="Введите свой новый пароль">
</form>
{{ if .Error }}
{{ .Error }}
{{ else }}
{{ if .Sent }}
<p>Сообщение о сбросе пароля было отправлено, если такой адрес существует.</p>
{{ else }}
<form action="/reset" method="post">
<label for="email">Email адрес</label>
<input type="email" name="email" id="email" placeholder="Введите свой email адрес">
{{ if .UniqueLinkTriggered }}
<p>Напишите здесь ваш новый пароль</p>
<form action="" method="post">
<label for="password">Ваш новый пароль</label>
<input type="password" name="password" id="password" placeholder="Введите свой новый пароль">
</form>
{{ else }}
{{ if .Sent }}
<p>Сообщение о сбросе пароля было отправлено, если такой адрес существует.</p>
{{ else }}
<form action="/reset" method="post">
<label for="email">Email адрес</label>
<input type="email" name="email" id="email" placeholder="Введите свой email адрес">
</form>
{{ end }}
{{ end }}
{{ end }}
</body>