Add another aspirant fields

This commit is contained in:
Anton Romanov 2025-01-29 19:31:52 +04:00
parent a503a36e8b
commit 4d1844d256
3 changed files with 57 additions and 35 deletions

View File

@ -9,7 +9,7 @@
<ul> <ul>
<li th:each="a : ${aspirants}"> <li th:each="a : ${aspirants}">
<a th:href="@{'/admin/editAspirant/' + ${a.id}}"> <a th:href="@{'/admin/editAspirant/' + ${a.id}}">
<span th:text="{${a.surname} + ' '+ ${a.name} + ' ' + ${a.patronymic}}"></span> <span th:text="${a.surname} + ' '+ ${a.name} + ' ' + ${a.patronymic}"></span>
</a> </a>
</li> </li>
</ul> </ul>

View File

@ -3,20 +3,33 @@
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" xmlns:th="http://www.w3.org/1999/xhtml" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" xmlns:th="http://www.w3.org/1999/xhtml"
layout:decorate="~{default}"> layout:decorate="~{default}">
<div class="container" layout:fragment="content"> <div class="container" layout:fragment="content">
<h3>Редактирование показателя:</h3> <h3>Редактирование аспиранта:</h3>
<form action="#" th:action="@{/admin/saveIndicator}" <form action="#" th:action="@{/admin/saveAspirant}"
th:object="${indicator}" th:object="${aspirant}"
method="post" method="post">
enctype="multipart/form-data">
<input type="hidden" th:field="*{id}"> <input type="hidden" th:field="*{id}">
<div class="form-group"> <div class="form-group">
<label for="name">Название</label> <label for="surname">Фамилия</label>
<input th:field="*{surname}"
id="surname"
type="text"
required
class="form-control"
placeholder="Фамилия">
<p th:if="${#fields.hasErrors('surname')}"
th:class="${#fields.hasErrors('surname')}? error">
Не может быть пустым
</p>
</div>
<div class="form-group">
<label for="name">Имя</label>
<input th:field="*{name}" <input th:field="*{name}"
id="name" id="name"
type="text" type="text"
required required
class="form-control" class="form-control"
placeholder="Название показателя"> placeholder="Имя">
<p th:if="${#fields.hasErrors('name')}" <p th:if="${#fields.hasErrors('name')}"
th:class="${#fields.hasErrors('name')}? error"> th:class="${#fields.hasErrors('name')}? error">
Не может быть пустым Не может быть пустым
@ -24,36 +37,23 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="name">Максимальная сумма баллов</label> <label for="patronymic">Отчество</label>
<input th:field="*{max}" <input th:field="*{patronymic}"
required id="patronymic"
id="max" type="text"
type="number"
class="form-control" class="form-control"
min="0" placeholder="Отчество">
max="30"> <p th:if="${#fields.hasErrors('patronymic')}"
</div> th:class="${#fields.hasErrors('patronymic')}? error">
<div class="form-group">
<label for="name">Описание подтверждающих документов</label>
<textarea th:field="*{proofDocuments}"
required
id="proofDocuments"
class="form-control"
placeholder="Описание подтверждающих документов"
style="height: 100px">
</textarea>
<p th:if="${#fields.hasErrors('proofDocuments')}"
th:class="${#fields.hasErrors('proofDocuments')}? error">
Не может быть пустым Не может быть пустым
</p> </p>
</div> </div>
<div class="form-group">
<label for="courses">Для каких курсов применяется</label>
<select class="form-select form-control" id="courses" multiple aria-label="multiple select example" <div class="form-group">
th:field="*{courses}" <label for="course">Курс</label>
> <select class="form-select form-control"
id="course" aria-label="multiple select example"
th:field="*{course}">
<option th:each="c : ${courses}" <option th:each="c : ${courses}"
th:value="${c}" th:value="${c}"
th:text="${c.name}"> th:text="${c.name}">
@ -61,14 +61,35 @@
</select> </select>
</div> </div>
<div class="form-group">
<label for="theme">Тема</label>
<input th:field="*{theme}"
id="theme"
type="text"
class="form-control"
placeholder="Тема">
</div>
<div class="form-group">
<label for="manager">Научный руководитель</label>
<select class="form-select form-control"
id="manager" aria-label="select example"
th:field="*{manager}">
<option th:each="m : ${managers}"
th:value="${m}"
th:text="${m.name}">
</option>
</select>
</div>
<button name="save" type="submit" class="btn btn-outline-dark">Сохранить</button> <button name="save" type="submit" class="btn btn-outline-dark">Сохранить</button>
<button name="delete" <button name="delete"
type="submit" type="submit"
class="btn btn-outline-dark" class="btn btn-outline-dark"
onclick="return confirm('Удалить показатель?')"> onclick="return confirm('Удалить запись?')">
Удалить Удалить
</button> </button>
<a href="/admin/indicators" class="btn btn-outline-dark">Отмена</a> <a href="/admin/aspirants" class="btn btn-outline-dark">Отмена</a>
</form> </form>
<link rel="stylesheet" href="/webjars/font-awesome/4.7.0/css/font-awesome.min.css"/> <link rel="stylesheet" href="/webjars/font-awesome/4.7.0/css/font-awesome.min.css"/>
<link rel="stylesheet" href="/webjars/bootstrap-glyphicons/bdd2cbfba0/css/bootstrap-glyphicons.css"/> <link rel="stylesheet" href="/webjars/bootstrap-glyphicons/bdd2cbfba0/css/bootstrap-glyphicons.css"/>

View File

@ -60,6 +60,7 @@
aria-haspopup="true" aria-expanded="false">Администратору</a> aria-haspopup="true" aria-expanded="false">Администратору</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown"> <div class="dropdown-menu" aria-labelledby="navbarDropdown">
<a class="dropdown-item" href="/admin/indicators">Список показателей</a> <a class="dropdown-item" href="/admin/indicators">Список показателей</a>
<a class="dropdown-item" href="/admin/aspirants">Список аспирантов</a>
<a class="dropdown-item" href="/admin">Новости и заседания</a> <a class="dropdown-item" href="/admin">Новости и заседания</a>
</div> </div>
</li> </li>