Отчёт.

This commit is contained in:
Programmist73 2023-05-26 19:14:00 +04:00
parent 43cba17b94
commit bc4df5b1da
5 changed files with 129 additions and 149 deletions

View File

@ -7,28 +7,28 @@
<script type="text/javascript" src="/webjars/jquery/3.6.0/jquery.min.js"></script>
</head>
<body>
<div class="container" layout:fragment="content">
<div th:if="${param.error}" class="alert alert-danger margin-bottom">
Пользователь не найден или пароль указан не верно
</div>
<div th:if="${param.logout}" class="alert alert-success margin-bottom">
Выход успешно произведен
</div>
<div th:if="${param.created}" class="alert alert-success margin-bottom">
Пользователь '<span th:text="${param.created}"></span>' успешно создан
</div>
<form th:action="@{/login}" method="post" class="container-padding">
<div class="mb-3">
<input type="text" name="username" id="username" class="form-control"
placeholder="Логин" required="true" autofocus="true"/>
<div class="container" layout:fragment="content">
<div th:if="${param.error}" class="alert alert-danger margin-bottom">
Пользователь не найден или пароль указан не верно
</div>
<div class="mb-3">
<input type="password" name="password" id="password" class="form-control"
placeholder="Пароль" required="true"/>
<div th:if="${param.logout}" class="alert alert-success margin-bottom">
Выход успешно произведен
</div>
<button type="submit" class="btn btn-success button-fixed">Войти</button>
<a class="btn btn-primary button-fixed" href="/signup">Регистрация</a>
</form>
</div>
<div th:if="${param.created}" class="alert alert-success margin-bottom">
Пользователь '<span th:text="${param.created}"></span>' успешно создан
</div>
<form th:action="@{/login}" method="post" class="container-padding">
<div class="mb-3">
<input type="text" name="username" id="username" class="form-control"
placeholder="Логин" required="true" autofocus="true"/>
</div>
<div class="mb-3">
<input type="password" name="password" id="password" class="form-control"
placeholder="Пароль" required="true"/>
</div>
<button type="submit" class="btn btn-success button-fixed">Войти</button>
<a class="btn btn-primary button-fixed" href="/signup">Регистрация</a>
</form>
</div>
</body>
</html>

View File

@ -8,18 +8,18 @@
<link rel="stylesheet" href="/css/modal-nation.css"/>
</head>
<body>
<div layout:fragment="content">
<form action="#" th:action="@{/nation/{id}(id=${id})}" th:object="${fullNationDTO}" method="get">
<div th:each="tank, iterator: ${fullNationDTO.tanks}">
<div class="nation-card">
<p class="nation-attribute" th:text="'Номер: ' + ${tank.id}"/>
<p class="nation-attribute" th:text="'Название: ' + ${tank.name}"/>
<p class="nation-attribute" th:text="'Стоимость: ' + ${tank.cost}"/>
<p class="nation-attribute" th:text="'Уровень: ' + ${tank.level.level}"/>
<div layout:fragment="content">
<form action="#" th:action="@{/nation/{id}(id=${id})}" th:object="${fullNationDTO}" method="get">
<div th:each="tank, iterator: ${fullNationDTO.tanks}">
<div class="nation-card">
<p class="nation-attribute" th:text="'Номер: ' + ${tank.id}"/>
<p class="nation-attribute" th:text="'Название: ' + ${tank.name}"/>
<p class="nation-attribute" th:text="'Стоимость: ' + ${tank.cost}"/>
<p class="nation-attribute" th:text="'Уровень: ' + ${tank.level.level}"/>
</div>
</div>
</div>
</form>
</div>
</form>
</div>
<!--<div layout:fragment="content">
<div th:text="${errors}" class="margin-bottom alert-danger"></div>
<form action="#" th:action="@{/student/{id}(id=${id})}" th:object="${studentDto}" method="post">

View File

@ -7,34 +7,34 @@
<script type="text/javascript" src="/webjars/jquery/3.6.0/jquery.min.js"></script>
</head>
<body>
<div class="container container-padding" layout:fragment="content">
<div th:if="${errors}" th:text="${errors}" class="margin-bottom alert alert-danger"></div>
<form action="#" th:action="@{/signup}" th:object="${clientDTO}" method="post">
<div class="mb-3">
<input type="text" class="form-control" th:field="${clientDTO.login}"
placeholder="Логин" required="true" autofocus="true" maxlength="64"/>
</div>
<div class="mb-3">
<input type="text" class="form-control" th:field="${clientDTO.email}"
placeholder="Почта" required="true" autofocus="true" maxlength="64"/>
</div>
<div class="mb-3">
<input type="text" class="form-control" th:field="${clientDTO.balance}"
placeholder="Балланс" maxlength="64"/>
</div>
<div class="mb-3">
<input type="password" class="form-control" th:field="${clientDTO.password}"
placeholder="Пароль" required="true" minlength="6" maxlength="64"/>
</div>
<div class="mb-3">
<input type="password" class="form-control" th:field="${clientDTO.passwordConfirm}"
placeholder="Пароль (подтверждение)" required="true" minlength="6" maxlength="64"/>
</div>
<div class="mb-3">
<button type="submit" class="btn btn-success button-fixed">Создать</button>
<a class="btn btn-primary button-fixed" href="/login">Назад</a>
</div>
</form>
</div>
<div class="container container-padding" layout:fragment="content">
<div th:if="${errors}" th:text="${errors}" class="margin-bottom alert alert-danger"></div>
<form action="#" th:action="@{/signup}" th:object="${clientDTO}" method="post">
<div class="mb-3">
<input type="text" class="form-control" th:field="${clientDTO.login}"
placeholder="Логин" required="true" autofocus="true" maxlength="64"/>
</div>
<div class="mb-3">
<input type="text" class="form-control" th:field="${clientDTO.email}"
placeholder="Почта" required="true" autofocus="true" maxlength="64"/>
</div>
<div class="mb-3">
<input type="text" class="form-control" th:field="${clientDTO.balance}"
placeholder="Балланс" maxlength="64"/>
</div>
<div class="mb-3">
<input type="password" class="form-control" th:field="${clientDTO.password}"
placeholder="Пароль" required="true" minlength="6" maxlength="64"/>
</div>
<div class="mb-3">
<input type="password" class="form-control" th:field="${clientDTO.passwordConfirm}"
placeholder="Пароль (подтверждение)" required="true" minlength="6" maxlength="64"/>
</div>
<div class="mb-3">
<button type="submit" class="btn btn-success button-fixed">Создать</button>
<a class="btn btn-primary button-fixed" href="/login">Назад</a>
</div>
</form>
</div>
</body>
</html>

View File

@ -9,96 +9,76 @@
<script type="text/javascript" src="/webjars/jquery/3.6.0/jquery.min.js"></script>
</head>
<body>
<div layout:fragment="content">
<div class="Group_create_level">
<h1>Генератор танков</h1>
<h2>
<a class="add-tank-button text-dark" type="button"
th:href="@{/tank/edit/}"
sec:authorize="hasRole('ROLE_ADMIN')"
<div layout:fragment="content">
<div class="Group_create_level">
<h1>Генератор танков</h1>
<h2>
<a class="add-tank-button text-dark" type="button"
th:href="@{/tank/edit/}"
sec:authorize="hasRole('ROLE_ADMIN')"
>
Создать танк
</a>
</h2>
<h2
sec:authorize="hasRole('ROLE_USER')"
>
Создать танк
</a>
</h2>
<h2
sec:authorize="hasRole('ROLE_USER')"
>
Режим просмотра
</h2>
<form id="filterForm" th:action="@{/tank/filteredList}" th:object="${sortDTO}" method="get">
<button class="tank-button" type="submit"
th:id="filterStart"
>
Фильтрация
</button>
<select id="nation" class="form-select" required="true" th:field="*{nation}">
<option th:each="value: ${nations}"
th:value="${value.nation}"
th:text="${value.nation}">
</option>
</select>
<select id="firstLevel" class="form-select" required="true" th:field="*{firstLevel}">
<option th:each="value: ${levels}"
th:value="${value.level}"
th:text="${value.level}">
</option>
</select>
<select id="secondLevel" class="form-select" required="true" th:field="*{secondLevel}">
<option th:each="value: ${levels}"
th:value="${value.level}"
th:text="${value.level}">
</option>
</select>
</form>
</div>
<div>
<h1 style="text-align: center; font-family: courier, monospace; background: #FF652F; border-radius: 10px">
Список существующих танков:
</h1>
</div>
<div th:each="tank, iterator: ${tanks}">
<div class="tank-card">
<p class="tank-attribute" th:text="'Номер: ' + ${tank.id}"/>
<p class="tank-attribute" th:text="'Название: ' + ${tank.name}"/>
<p class="tank-attribute" th:text="'Нация: ' + ${tank.nation.getNation()}"/>
<p class="tank-attribute" th:text="'Уровень: ' + ${tank.level.getLevel()}"/>
<p class="tank-attribute" th:text="'Стоимость: ' + ${tank.cost}"/>
<div class='tank-button-group' sec:authorize="hasRole('ROLE_ADMIN')">
<form th:action="@{/tank/edit/{id}(id=${tank.id})}" method="get">
<button class="tank-button" type="submit"
th:id="'edit-' + ${tank.id}"
>
Редактировать
</button>
</form>
<form th:action="@{/tank/delete/{id}(id=${tank.id})}" method="post">
<button th:id="'remove-' + ${tank.id}" class="tank-button" type="submit">
Удалить
</button>
</form>
Режим просмотра
</h2>
<form id="filterForm" th:action="@{/tank/filteredList}" th:object="${sortDTO}" method="get">
<button class="tank-button" type="submit"
th:id="filterStart"
>
Фильтрация
</button>
<select id="nation" class="form-select" required="true" th:field="*{nation}">
<option th:each="value: ${nations}"
th:value="${value.nation}"
th:text="${value.nation}">
</option>
</select>
<select id="firstLevel" class="form-select" required="true" th:field="*{firstLevel}">
<option th:each="value: ${levels}"
th:value="${value.level}"
th:text="${value.level}">
</option>
</select>
<select id="secondLevel" class="form-select" required="true" th:field="*{secondLevel}">
<option th:each="value: ${levels}"
th:value="${value.level}"
th:text="${value.level}">
</option>
</select>
</form>
</div>
<div>
<h1 style="text-align: center; font-family: courier, monospace; background: #FF652F; border-radius: 10px">
Список существующих танков:
</h1>
</div>
<div th:each="tank, iterator: ${tanks}">
<div class="tank-card">
<p class="tank-attribute" th:text="'Номер: ' + ${tank.id}"/>
<p class="tank-attribute" th:text="'Название: ' + ${tank.name}"/>
<p class="tank-attribute" th:text="'Нация: ' + ${tank.nation.getNation()}"/>
<p class="tank-attribute" th:text="'Уровень: ' + ${tank.level.getLevel()}"/>
<p class="tank-attribute" th:text="'Стоимость: ' + ${tank.cost}"/>
<div class='tank-button-group' sec:authorize="hasRole('ROLE_ADMIN')">
<form th:action="@{/tank/edit/{id}(id=${tank.id})}" method="get">
<button class="tank-button" type="submit"
th:id="'edit-' + ${tank.id}"
>
Редактировать
</button>
</form>
<form th:action="@{/tank/delete/{id}(id=${tank.id})}" method="post">
<button th:id="'remove-' + ${tank.id}" class="tank-button" type="submit">
Удалить
</button>
</form>
</div>
</div>
</div>
</div>
</div>
</body>
<script>
$(document).ready(function() {
$('#filterStart').on('click', function() {
$.ajax({
url: "http://localhost:8080/api/tank/filteredList/?nation='
+escape(document.forms['filterForm'].elements['nation'].value)&
+escape(document.forms['filterForm'].elements['firstLevel'].value)&
+escape(document.forms['filterForm'].elements['secondLevel'].value)"
}).then(function (data) {
});
});
});
</script>
</html>
<!--
-->
<!--th:action="@{/tank/filteredList/{nation}(nation=${document.elements['nation'].value}){firstLevel}(firstLevel=${document.elements['firstLevel'].value}){secondLevel}(secondLevel=${document.elements['secondLevel'].value})}"-->
</html>