fix account and SMTP onboarding workflows

This commit is contained in:
sechmachine
2026-08-15 02:29:41 +07:00
parent 6181984cf8
commit 17fa25bb09
20 changed files with 988 additions and 85 deletions
+15 -8
View File
@@ -4,25 +4,32 @@
<body>
<main>
<h1>Create account</h1>
<p th:if="${smtpRestricted}" role="alert">This is a restricted installation until tested SMTP is active.</p>
<p th:if="${param.created}" role="status">Account created and activation email sent.</p>
<p th:if="${param.deliveryFailed}" role="alert">Account created, but activation delivery failed.</p>
<p th:if="${error}" th:text="${error}" role="alert"></p>
<form method="post" th:action="@{/admin/accounts}">
<label>Email <input name="email" type="email" required autocomplete="off"></label>
<label>Display name <input name="displayName" required autocomplete="off"></label>
<form method="post" th:action="@{/admin/accounts}" th:object="${accountForm}">
<div th:if="${#fields.hasGlobalErrors()}" role="alert">
<p th:each="error : ${#fields.globalErrors()}" th:text="${error}"></p>
</div>
<label>Email <input th:field="*{email}" type="email" required autocomplete="off"></label>
<p th:if="${#fields.hasErrors('email')}" th:errors="*{email}" role="alert"></p>
<label>Display name <input th:field="*{displayName}" required autocomplete="off"></label>
<p th:if="${#fields.hasErrors('displayName')}" th:errors="*{displayName}" role="alert"></p>
<label>Role
<select name="role" required>
<select th:field="*{role}" required>
<option value="ADMIN">Admin</option>
<option value="MENTOR">Mentor</option>
<option value="INTERN">Intern</option>
</select>
</label>
<p th:if="${#fields.hasErrors('role')}" th:errors="*{role}" role="alert"></p>
<fieldset>
<legend>Intern details</legend>
<label>Student code <input name="studentCode" autocomplete="off"></label>
<label>Internship start <input name="internshipStart" type="date"></label>
<label>Internship end <input name="internshipEnd" type="date"></label>
<label>Student code <input th:field="*{studentCode}" autocomplete="off"></label>
<label>Internship start <input th:field="*{internshipStart}" type="date"></label>
<label>Internship end <input th:field="*{internshipEnd}" type="date"></label>
</fieldset>
<p th:if="${#fields.hasErrors('internDetailsValid')}" th:errors="*{internDetailsValid}" role="alert"></p>
<button type="submit">Create account</button>
</form>
</main>