fix(ui): add project and task error summaries

This commit is contained in:
sechmachine
2026-08-15 01:46:23 +07:00
parent cbdbd8ee13
commit c5c143c3cd
9 changed files with 71 additions and 14 deletions
@@ -10,6 +10,10 @@
<main>
<p class="page-description">Define the initial Project window and Leader. Membership changes remain server-authorized.</p>
<form class="panel form-panel form-grid" method="post" th:action="@{/projects}" th:object="${projectForm}">
<div class="alert alert-error" role="alert" th:if="${#fields.hasAnyErrors()}">
<strong>Please correct the highlighted fields.</strong>
<ul><li th:each="error : ${#fields.allErrors()}" th:text="${error}">Validation error</li></ul>
</div>
<div class="field">
<label class="field-label" for="name">Name</label>
<input class="control" id="name" th:field="*{name}" required maxlength="160" th:attr="aria-invalid=${#fields.hasErrors('name')}">
@@ -20,8 +24,8 @@
<textarea class="control" id="description" rows="5" th:field="*{description}"></textarea>
</div>
<div class="form-grid form-grid-three">
<div class="field"><label class="field-label" for="startDate">Start date</label><input class="control" id="startDate" type="date" th:field="*{startDate}" required></div>
<div class="field"><label class="field-label" for="endDate">End date</label><input class="control" id="endDate" type="date" th:field="*{endDate}" required></div>
<div class="field"><label class="field-label" for="startDate">Start date</label><input class="control" id="startDate" type="date" th:field="*{startDate}" required th:attr="aria-invalid=${#fields.hasErrors('startDate')}"><p class="field-error" role="alert" th:if="${#fields.hasErrors('startDate')}" th:errors="*{startDate}">Start date error</p></div>
<div class="field"><label class="field-label" for="endDate">End date</label><input class="control" id="endDate" type="date" th:field="*{endDate}" required th:attr="aria-invalid=${#fields.hasErrors('endDate') or #fields.hasErrors('dateRangeValid')}"><p class="field-error" role="alert" th:if="${#fields.hasErrors('endDate')}" th:errors="*{endDate}">End date error</p><p class="field-error" role="alert" th:if="${#fields.hasErrors('dateRangeValid')}" th:errors="*{dateRangeValid}">Date range error</p></div>
<div class="field">
<label class="field-label" for="leader">Initial Leader user ID</label>
<input class="control" id="leader" type="number" min="1" th:field="*{initialLeaderUserId}" required th:attr="aria-invalid=${#fields.hasErrors('initialLeaderUserId')}">