removed ok button on revoked, see #9

This commit is contained in:
Jottyfan 2024-11-30 17:33:50 +01:00
parent 2abb937725
commit 31727e23ac

View File

@ -8,7 +8,7 @@
<th:block layout:fragment="content"> <th:block layout:fragment="content">
<div class="mainpage"> <div class="mainpage">
<div class="container" style="max-width: 100%" sec:authorize="hasRole('registrator')"> <div class="container" style="max-width: 100%" sec:authorize="hasRole('registrator')">
<form action="#" th:action="@{/confirmation/person/update}" th:object="${person}" method="post" th:if="${person != null}"> <form id="form" action="#" th:action="@{/confirmation/person/update}" th:object="${person}" method="post" th:if="${person != null}">
<div class="row mb-2"> <div class="row mb-2">
<label for="outputPk" class="col-sm-2 col-form-label">ID</label> <label for="outputPk" class="col-sm-2 col-form-label">ID</label>
<div class="col-sm-10"> <div class="col-sm-10">
@ -132,7 +132,7 @@
<div class="row mb-2"> <div class="row mb-2">
<label for="inputAccept" class="col-sm-2 col-form-label"></label> <label for="inputAccept" class="col-sm-2 col-form-label"></label>
<div class="col-sm-10"> <div class="col-sm-10">
<button type="submit" class="btn btn-primary" onclick="progress.start()">Ok</button> <button type="submit" class="btn btn-primary" onclick="progress.start()" th:if="${person.progress} != 'revoked'">Ok</button>
<a th:href="@{/confirmation}" class="btn btn-secondary">Abbrechen</a> <a th:href="@{/confirmation}" class="btn btn-secondary">Abbrechen</a>
</div> </div>
</div> </div>
@ -160,6 +160,17 @@
<div th:if="${person == null}" class="error">In der Datenbank wurde keine Person mit entsprechender ID gefunden.</div> <div th:if="${person == null}" class="error">In der Datenbank wurde keine Person mit entsprechender ID gefunden.</div>
</div> </div>
</div> </div>
<script type="text/javascript">
/**
* forbid enter in form to allow disabling the ok button for revoked bookings
*/
$(document).on('keyup keypress', 'form', function(e) {
if (e.keyCode == 13) {
e.preventDefault();
return false;
}
});
</script>
</th:block> </th:block>
</body> </body>
</html> </html>