<th:block th:fragment="form">
    <form th:if="${sent}" method="get" action="/login" class="halo-form">
        <div class="form-item">
            <div class="alert" th:text="#{form.message.success}"></div>
        </div>
        <div class="form-item">
            <button type="submit" th:text="#{form.sent.submit}"></button>
        </div>
    </form>
    <form th:unless="${sent}" class="halo-form" th:action="@{/password-reset/email}" method="post" th:object="${form}">
        <div class="alert alert-error" th:if="${param.error.size() > 0}">
            <strong th:if="${param.error[0] == 'invalid_reset_token'}" th:text="#{error.invalid_reset_token}"></strong>
        </div>
        <div class="alert alert-error" th:if="${error}">
            <strong th:if="${error == 'rate_limit_exceeded'}" th:text="#{error.rate_limit_exceeded}"></strong>
        </div>
        <div class="form-item">
            <label for="email" th:text="#{form.email.label}"></label>
            <div class="form-input">
                <input type="email" id="email" name="email" autofocus required th:field="*{email}"/>
            </div>
            <p class="alert alert-error" role="alert" th:if="${#fields.hasErrors('email')}" th:errors="*{email}"></p>
        </div>
        <div class="form-item">
            <button type="submit" th:text="#{form.submit}"></button>
        </div>
    </form>
</th:block>
