mirror of
https://git.imnavajas.es/jjimenez/erp-imprimelibros.git
synced 2026-01-18 23:00:21 +00:00
trabajando en el signup. problema con el mismo username aunque este delete at
This commit is contained in:
@ -1,6 +1,8 @@
|
||||
email.resetPassword.title=Restablecer contraseña
|
||||
email.greeting=Hola
|
||||
email.resetPassword.body=Hemos recibido una solicitud para restablecer tu contraseña. Haz clic en el siguiente botón:
|
||||
email.resetPassword.button=Restablecer contraseña
|
||||
email.resetPassword.ignoreMessage=Si no solicitaste este cambio, puedes ignorar este mensaje.
|
||||
email.verify.title=Verifica tu correo
|
||||
email.verify.body=Haz clic en el siguiente botón para verificar tu correo electrónico:
|
||||
email.verify.button=Verificar cuenta
|
||||
email.verify.link-instruction=Si no funciona, copia y pega esta URL en tu navegador:
|
||||
email.verify.expiration=Este enlace caduca en {0} minutos.
|
||||
email.verify.ignoreMessage=Si no solicitaste este cambio, puedes ignorar este mensaje.
|
||||
email.footer=Imprimelibros - Todos los derechos reservados.
|
||||
|
||||
@ -15,5 +15,7 @@ login.password-placeholder=Introduce tu contraseña
|
||||
login.new-account=¿No tienes una cuenta?
|
||||
login.sign-up=Regístrate
|
||||
login.sign-up-button=Crear cuenta
|
||||
login.sign-up.title=Crear una cuenta
|
||||
login.sign-up.name=Nombre completo
|
||||
|
||||
login.error=Credenciales inválidas
|
||||
@ -1,35 +1,59 @@
|
||||
/* Email base */
|
||||
body {
|
||||
font-family: Arial, sans-serif;
|
||||
background: #f8f9fa;
|
||||
padding: 20px;
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
background-color: #f5f7fb;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.container {
|
||||
background: #fff;
|
||||
border-radius: 8px;
|
||||
padding: 20px;
|
||||
max-width: 600px;
|
||||
margin: auto;
|
||||
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
|
||||
.email-wrapper {
|
||||
width: 100%;
|
||||
background: #f5f7fb;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.header {
|
||||
text-align: center;
|
||||
margin-bottom: 20px;
|
||||
.email-body {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.email-container {
|
||||
max-width: 600px;
|
||||
width: 100%;
|
||||
background: #ffffff;
|
||||
margin: 0 auto;
|
||||
border-radius: 8px;
|
||||
overflow: hidden;
|
||||
box-shadow: 0 2px 6px rgba(0,0,0,0.08);
|
||||
}
|
||||
|
||||
.email-header {
|
||||
background: #f0f0f0;
|
||||
padding: 20px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.email-content {
|
||||
padding: 24px;
|
||||
font-size: 14px;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
.email-footer {
|
||||
background: #f9f9f9;
|
||||
padding: 12px;
|
||||
text-align: center;
|
||||
font-size: 12px;
|
||||
color: #777;
|
||||
}
|
||||
|
||||
/* Botones */
|
||||
.btn {
|
||||
display: inline-block;
|
||||
padding: 10px 20px;
|
||||
background: #0d6efd;
|
||||
color: #fff;
|
||||
text-decoration: none;
|
||||
border-radius: 5px;
|
||||
display: inline-block;
|
||||
padding: 12px 20px;
|
||||
border-radius: 6px;
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
text-decoration: none;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.footer {
|
||||
margin-top: 20px;
|
||||
font-size: 12px;
|
||||
color: #6c757d;
|
||||
text-align: center;
|
||||
}
|
||||
52
src/main/resources/templates/imprimelibros/email/layout.html
Normal file
52
src/main/resources/templates/imprimelibros/email/layout.html
Normal file
@ -0,0 +1,52 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="es" xmlns:th="http://www.thymeleaf.org">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<title th:text="${subject} ?: 'Notificación'">Notificación</title>
|
||||
<link rel="stylesheet" th:href="@{/css/email.css}">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table role="presentation" class="email-wrapper">
|
||||
<tr>
|
||||
<td align="center" class="email-body">
|
||||
<table role="presentation" class="email-container">
|
||||
<!-- Header -->
|
||||
<tr>
|
||||
<td class="email-header">
|
||||
<h2>
|
||||
<img src="/assets/images/logo-light.png" alt="" height="45">
|
||||
</h2>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<!-- Content (fragmento) -->
|
||||
<tr>
|
||||
<td class="email-content">
|
||||
<div th:replace="~{::bodyContent}"></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<!-- Footer -->
|
||||
<tr>
|
||||
<td class="email-footer">
|
||||
<p>
|
||||
<strong th:text="${companyName} ?: 'ImprimeLibros'">ImprimeLibros</strong><br>
|
||||
Calle José Picón, Nº 28 Local A, 28028, Madrid<br>
|
||||
91 005 25 74 -
|
||||
<a href="mailto:contacto@imprimelibros.com" style="color:#2563eb;">
|
||||
contacto@imprimelibros.com
|
||||
</a><br>
|
||||
© <span th:text="${year} ?: ${#dates.year(#dates.createNow())}">2025</span>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
25
src/main/resources/templates/imprimelibros/email/verify.html
Normal file
25
src/main/resources/templates/imprimelibros/email/verify.html
Normal file
@ -0,0 +1,25 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="es" xmlns:th="http://www.thymeleaf.org" th:replace="emails/layout :: bodyContent">
|
||||
|
||||
<body>
|
||||
<p><span th:text="#{email.greeting}">Hola</span> <span th:text="${fullName}">usuario</span>,</p>
|
||||
<p><span th:text="#{email.verify.body}">Haz clic en el siguiente botón para verificar tu correo electrónico:</span>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<a th:href="${verifyUrl}" class="btn btn-secondary" target="_blank">
|
||||
<span th:text="#{email.verify.button}">Verificar cuenta</span>
|
||||
</a>
|
||||
</p>
|
||||
|
||||
<p><span th:text="#{email.verify.link-instruction}">Si no funciona, copia y pega esta URL en tu navegador:</span>
|
||||
</p>
|
||||
<p><span th:text="${verifyUrl}">https://...</span></p>
|
||||
|
||||
<p><span th:text="#{email.verify.expiration(${minutes} ?: 60)}">Este enlace caduca en 60 minutos.</span></p>
|
||||
|
||||
<p><span th:text="#{email.verify.ignoreMessage}">Si no solicitaste este cambio, puedes ignorar este mensaje.</span>
|
||||
</p>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@ -1,53 +1,56 @@
|
||||
<div th:fragment="_signup">
|
||||
|
||||
<div class="p-lg-5 p-4">
|
||||
<div>
|
||||
<h5 class="text-primary" th:text="#{login.welcome}">¡Bienvenido!</h5>
|
||||
<p class="text-muted" th:text="#{login.signup-subtitle}">Regístrate para continuar:</p>
|
||||
<p class="text-muted" th:text="#{login.sign-up.title}">Crear cuenta</p>
|
||||
</div>
|
||||
|
||||
<div class="mt-4">
|
||||
<form th:action="@{/signup}" method="post">
|
||||
<!-- CSRF obligatorio -->
|
||||
<input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}" />
|
||||
<div th:if="${info}" class="alert alert-info" th:text="${info}"></div>
|
||||
<div th:if="${danger}" class="alert alert-danger" th:text="${danger}"></div>
|
||||
<div th:if="${signup_error}" class="alert alert-danger" th:text="${signup_error}"></div>
|
||||
|
||||
<div th:if="${param.error}" class="alert alert-danger"
|
||||
th:text="#{login.error}">
|
||||
Credenciales inválidas
|
||||
<!-- En el caso del formulario de signup, asegúrate de bindear el DTO -->
|
||||
<form th:if="${form == '_signup'}" th:action="@{/signup}" method="post" th:object="${signupForm}">
|
||||
|
||||
|
||||
|
||||
<input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}" />
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="username" class="form-label" th:text="#{login.email}">Correo electrónico</label>
|
||||
<input type="email" class="form-control" id="username" th:field="*{username}"
|
||||
th:placeholder="#{login.email-placeholder}">
|
||||
<div class="text-danger" th:if="${#fields.hasErrors('username')}" th:errors="*{username}"></div>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="form-label" for="name" th:text="#{login.sign-up.name}">Nombre completo</label>
|
||||
<input type="text" class="form-control" id="name" th:field="*{name}"
|
||||
th:placeholder="#{login.sign-up.name}">
|
||||
<div class="text-danger" th:if="${#fields.hasErrors('name')}" th:errors="*{name}"></div>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="form-label" for="password-input" th:text="#{login.password}">Contraseña</label>
|
||||
<input type="password" class="form-control" id="password-input" th:field="*{password}"
|
||||
th:placeholder="#{login.password-placeholder}">
|
||||
<div class="text-danger" th:if="${#fields.hasErrors('password')}" th:errors="*{password}"></div>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="form-label" for="password-confirm-input" th:text="#{login.confirm-password}">Confirmar
|
||||
contraseña</label>
|
||||
<input type="password" class="form-control" id="password-confirm-input" th:field="*{passwordConfirm}"
|
||||
th:placeholder="#{login.password-placeholder}">
|
||||
<div class="text-danger" th:if="${#fields.hasErrors('passwordConfirm')}" th:errors="*{passwordConfirm}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="username" class="form-label" th:text="#{login.email}">Correo electrónico</label>
|
||||
<input type="email" class="form-control" id="username" th:placeholder="#{login.email-placeholder}"
|
||||
name="username">
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="form-label" for="password-input" th:text="#{login.password}">Contraseña</label>
|
||||
<div class="position-relative auth-pass-inputgroup mb-3">
|
||||
<input type="password" class="form-control pe-5 password-input"
|
||||
th:placeholder="#{login.password-placeholder}" id="password-input" name="password">
|
||||
<button
|
||||
class="btn btn-link position-absolute end-0 top-0 text-decoration-none text-muted password-addon"
|
||||
type="button" id="password-addon"><i class="ri-eye-fill align-middle"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="form-label" for="password-confirm-input" th:text="#{login.confirm-password}">Confirmar contraseña</label>
|
||||
<div class="position-relative auth-pass-inputgroup mb-3">
|
||||
<input type="password" class="form-control pe-5 password-input"
|
||||
th:placeholder="#{login.password-placeholder}" id="password-confirm-input" name="password-confirm">
|
||||
<button
|
||||
class="btn btn-link position-absolute end-0 top-0 text-decoration-none text-muted password-addon"
|
||||
type="button" id="password-addon"><i class="ri-eye-fill align-middle"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-4">
|
||||
<button class="btn btn-secondary w-100" type="submit" th:text="#{login.sign-up-button}">Crear cuenta</button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
<div class="mt-4">
|
||||
<button class="btn btn-secondary w-100" type="submit" th:text="#{login.sign-up-button}">Crear
|
||||
cuenta</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user