feat: submit all modal forms without page reload
- add a generic AJAX submitter for forms inside dialogs - keep modal values and show field errors on server validation failure - soft-refresh the page content on success, preserving scroll, search and filters - share toast and re-init hooks for tables, markdown, sections and group page - require passwords and add minlength/match validation on auth forms
This commit is contained in:
@@ -278,7 +278,8 @@
|
||||
<p class="hint">Если студент уже в другой группе — он будет переведён в эту.</p>
|
||||
<button class="btn btn-secondary" type="submit" th:disabled="${#lists.isEmpty(candidates)}">Зачислить существующего</button>
|
||||
</form>
|
||||
<form class="form-stack mt-4" th:action="@{/admin/groups/{gid}/students/create(gid=${group.id})}" method="post">
|
||||
<form class="form-stack mt-4" th:action="@{/admin/groups/{gid}/students/create(gid=${group.id})}" method="post"
|
||||
data-success="Студент создан. Пароль показан ниже.">
|
||||
<input type="hidden" name="_csrf" th:value="${csrfToken}">
|
||||
<div class="row g-3">
|
||||
<div class="col-md-6"><label class="label" for="stNo">Студенческий номер (логин)</label>
|
||||
@@ -346,7 +347,7 @@
|
||||
<div class="dlg-body" id="assign-modal-body"></div>
|
||||
</dialog>
|
||||
|
||||
<script th:src="@{/js/admin-group.js(v='38')}" defer></script>
|
||||
<script th:src="@{/js/admin-group.js(v='39')}" defer></script>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user