LabWork04-05 / Translate to English language
This commit is contained in:
parent
6b5d17f0cb
commit
1c5ec72d08
BIN
demo/data.mv.db
BIN
demo/data.mv.db
Binary file not shown.
@ -41,10 +41,11 @@ td form {
|
||||
|
||||
.my-navbar {
|
||||
background-color: #2c2a2a !important;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.my-navbar .link a:hover {
|
||||
text-decoration: underline;
|
||||
color: #a721fa;
|
||||
}
|
||||
|
||||
.my-navbar .logo {
|
||||
|
@ -2,18 +2,18 @@
|
||||
<html lang="ru" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" layout:decorate="~{default}">
|
||||
|
||||
<head>
|
||||
<title>Корзина</title>
|
||||
<title>Cart</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<main layout:fragment="content">
|
||||
<div class="d-flex flex-column align-items-center">
|
||||
<div class="mb-2 col-12 col-md-8 col-lg-6 d-flex align-items-center">
|
||||
<strong class="flex-fill">Корзина</strong>
|
||||
<strong class="flex-fill">Cart</strong>
|
||||
<form action="#" th:action="@{/cart/clear}" method="post">
|
||||
<button type="submit" class="btn btn-danger button-fixed-width"
|
||||
onclick="return confirm('Вы уверены?')">
|
||||
<i class="bi bi-x-lg"></i> Очистить
|
||||
<i class="bi bi-x-lg"></i> Clear
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
@ -44,13 +44,13 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class=" mb-2 col-12 col-md-8 col-lg-6 d-flex justify-content-end">
|
||||
<strong>Итого: [[${#numbers.formatDecimal(totalCart, 1, 2)}]] ₽</strong>
|
||||
<strong>Total: [[${#numbers.formatDecimal(totalCart, 1, 2)}]] ₽</strong>
|
||||
</div>
|
||||
<div class="mb-2 col-12 col-md-8 col-lg-6 d-flex justify-content-center"
|
||||
th:if="${not #lists.isEmpty(cart)}">
|
||||
<form action="#" th:action="@{/cart/save}" method="post">
|
||||
<button type="submit" class="btn btn-primary" onclick="return confirm('Вы уверены?')">
|
||||
Оформить заказ
|
||||
<button type="submit" class="btn btn-primary" onclick="return confirm('Are you sure?')">
|
||||
Place order
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
@ -58,24 +58,24 @@
|
||||
<div class="mb-2">
|
||||
<form action=" #" th:action="@{/cart}" th:object="${order}" method="post">
|
||||
<div class="mb-2">
|
||||
<label for="type" class="form-label">Товары</label>
|
||||
<label for="type" class="form-label">Products</label>
|
||||
<select th:field="*{type}" id="type" class="form-select">
|
||||
<option selected value="">Укажите тип товара</option>
|
||||
<option selected value="">Select product type</option>
|
||||
<option th:each="type : ${types}" th:value="${type.id}">[[${type.name}]]</option>
|
||||
</select>
|
||||
<div th:if="${#fields.hasErrors('type')}" th:errors="*{type}" class="invalid-feedback"></div>
|
||||
</div>
|
||||
<div class="mb-2">
|
||||
<label for="price" class="form-label">Цена</label>
|
||||
<label for="price" class="form-label">Price</label>
|
||||
<input type="number" th:field="*{price}" id="price" class="form-control" step="0.50">
|
||||
<div th:if="${#fields.hasErrors('price')}" th:errors="*{price}" class="invalid-feedback"></div>
|
||||
</div>
|
||||
<div class="mb-2">
|
||||
<label for="count" class="form-label">Количество</label>
|
||||
<label for="count" class="form-label">Count</label>
|
||||
<input type="number" th:field="*{count}" id="count" class="form-control" value="0" step="1">
|
||||
<div th:if="${#fields.hasErrors('count')}" th:errors="*{count}" class="invalid-feedback"></div>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">Добавить в корзину</button>
|
||||
<button type="submit" class="btn btn-primary">Add to cart</button>
|
||||
</form>
|
||||
</div>
|
||||
</main>
|
||||
|
@ -32,23 +32,23 @@
|
||||
<th:block sec:authorize="hasRole('ADMIN')">
|
||||
<a class="nav-link" href="/admin/user"
|
||||
th:classappend="${activeLink.startsWith('/admin/user') ? 'active' : ''}">
|
||||
Пользователи
|
||||
Users
|
||||
</a>
|
||||
<a class="nav-link" href="/admin/type"
|
||||
th:classappend="${activeLink.startsWith('/admin/type') ? 'active' : ''}">
|
||||
Типы заказов
|
||||
Types
|
||||
</a>
|
||||
<a class="nav-link" href="/admin/message"
|
||||
th:classappend="${activeLink.startsWith('/admin/message') ? 'active' : ''}">
|
||||
Сообщения
|
||||
Messages
|
||||
</a>
|
||||
<a class="nav-link" href="/h2-console/" target="_blank">Консоль H2</a>
|
||||
<a class="nav-link" href="/h2-console/" target="_blank">Console H2</a>
|
||||
</th:block>
|
||||
</ul>
|
||||
<ul class="navbar-nav" th:if="${not #strings.isEmpty(userName)}">
|
||||
<form th:action="@{/logout}" method="post">
|
||||
<button type="submit" class="navbar-brand nav-link" onclick="return confirm('Вы уверены?')">
|
||||
Выход ([[${userName}]])
|
||||
<button type="submit" class="navbar-brand nav-link" onclick="return confirm('Are you sure?')">
|
||||
Logout ([[${userName}]])
|
||||
</button>
|
||||
</form>
|
||||
<a class="navbar-brand" href="/cart">
|
||||
|
@ -2,7 +2,7 @@
|
||||
<html lang="ru" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" layout:decorate="~{default}">
|
||||
|
||||
<head>
|
||||
<title>Ошибка</title>
|
||||
<title>Error</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
@ -10,27 +10,27 @@
|
||||
<ul class="list-group mb-2">
|
||||
<th:block th:if="${#strings.isEmpty(message)}">
|
||||
<li class="list-group-item">
|
||||
Неизвестная ошибка
|
||||
Unknown error
|
||||
</li>
|
||||
</th:block>
|
||||
<th:block th:if="${not #strings.isEmpty(message)}">
|
||||
<li class="list-group-item">
|
||||
<strong>Ошибка:</strong> [[${message}]]
|
||||
<strong>Error:</strong> [[${message}]]
|
||||
</li>
|
||||
</th:block>
|
||||
<th:block th:if="${not #strings.isEmpty(url)}">
|
||||
<li class="list-group-item">
|
||||
<strong>Адрес:</strong> [[${url}]]
|
||||
<strong>URL:</strong> [[${url}]]
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
<strong>Класс исключения:</strong> [[${exception}]]
|
||||
<strong>Exception:</strong> [[${exception}]]
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
[[${method}]] ([[${file}]]:[[${line}]])
|
||||
</li>
|
||||
</th:block>
|
||||
</ul>
|
||||
<a class="btn btn-primary button-fixed-width" href="/">На главную</a>
|
||||
<a class="btn btn-primary button-fixed-width" href="/">Home</a>
|
||||
</main>
|
||||
</body>
|
||||
|
||||
|
@ -2,38 +2,38 @@
|
||||
<html lang="ru" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" layout:decorate="~{default}">
|
||||
|
||||
<head>
|
||||
<title>Вход</title>
|
||||
<title>Login</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<main layout:fragment="content">
|
||||
<form action="#" th:action="@{/login}" method="post">
|
||||
<div th:if="${param.error}" class="alert alert-danger">
|
||||
Неверный логин или пароль
|
||||
Invalid login or password
|
||||
</div>
|
||||
<div th:if="${param.logout}" class="alert alert-success">
|
||||
Выход успешно произведен
|
||||
The exit was successful
|
||||
</div>
|
||||
<div th:if="${param.signup}" class="alert alert-success">
|
||||
Пользователь успешно создан
|
||||
User successfully created
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="username" class="form-label">Имя пользователя</label>
|
||||
<label for="username" class="form-label">Username</label>
|
||||
<input type="text" id="username" name="username" class="form-control" required minlength="3"
|
||||
maxlength="20">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="password" class="form-label">Пароль</label>
|
||||
<label for="password" class="form-label">Password</label>
|
||||
<input type="password" id="password" name="password" class="form-control" required minlength="3"
|
||||
maxlength="20">
|
||||
</div>
|
||||
<div class="form-check mb-3">
|
||||
<input class="form-check-input" type="checkbox" id="remember-me" name="remember-me" checked>
|
||||
<label class="form-check-label" for="remember-me">Запомнить меня</label>
|
||||
<label class="form-check-label" for="remember-me">Remember me</label>
|
||||
</div>
|
||||
<div class="mb-3 d-flex flex-row">
|
||||
<button class="btn btn-primary me-2 button-fixed-width" type="submit">Войти</button>
|
||||
<a class="btn btn-secondary button-fixed-width" href="/signup">Регистрация</a>
|
||||
<button class="btn btn-primary me-2 button-fixed-width" type="submit">Login</button>
|
||||
<a class="btn btn-secondary button-fixed-width" href="/signup">Sign up</a>
|
||||
</div>
|
||||
</form>
|
||||
</main>
|
||||
|
@ -2,20 +2,20 @@
|
||||
<html lang="ru" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" layout:decorate="~{default}">
|
||||
|
||||
<head>
|
||||
<title>Отправить сообщение</title>
|
||||
<title>Send message</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<main layout:fragment="content">
|
||||
<form action="#" th:action="@{/message/send/}" th:object="${message}" method="post">
|
||||
<div class="mb-3">
|
||||
<label for="text" class="form-label">Текст</label>
|
||||
<label for="text" class="form-label">Text</label>
|
||||
<input type="text" th:field="*{text}" id="text" class="form-control">
|
||||
<div th:if="${#fields.hasErrors('text')}" th:errors="*{text}" class="invalid-feedback"></div>
|
||||
</div>
|
||||
<div class="mb-3 d-flex flex-row">
|
||||
<button class="btn btn-primary me-2 button-fixed-width" type="submit">Отправить</button>
|
||||
<a class="btn btn-secondary button-fixed-width" href="/">Отмена</a>
|
||||
<button class="btn btn-primary me-2 button-fixed-width" type="submit">Send message</button>
|
||||
<a class="btn btn-secondary button-fixed-width" href="/">Cancel</a>
|
||||
</div>
|
||||
</form>
|
||||
</main>
|
||||
|
@ -2,24 +2,24 @@
|
||||
<html lang="ru" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" layout:decorate="~{default}">
|
||||
|
||||
<head>
|
||||
<title>Сообщения</title>
|
||||
<title>Messages</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<main layout:fragment="content">
|
||||
<th:block th:switch="${messageItems.size()}">
|
||||
<h2 th:case="0">Данные отсутствуют</h2>
|
||||
<h2 th:case="0">No data available</h2>
|
||||
<th:block th:case="*">
|
||||
<h2>Сообщения</h2>
|
||||
<h2>Messages</h2>
|
||||
<table class="table">
|
||||
<caption></caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" class="w-10">ID</th>
|
||||
<th scope="col" class="w-10">Отправитель</th>
|
||||
<th scope="col" class="w-auto">Сообщение</th>
|
||||
<th scope="col" class="w-10">Дата отправки</th>
|
||||
<th scope="col" class="w-10">Опубликовано</th>
|
||||
<th scope="col" class="w-10">Sender</th>
|
||||
<th scope="col" class="w-auto">Message</th>
|
||||
<th scope="col" class="w-10">Date</th>
|
||||
<th scope="col" class="w-4" style="text-align: center;">Published</th>
|
||||
<th scope="col" class="w-10"></th>
|
||||
<th scope="col" class="w-10"></th>
|
||||
</tr>
|
||||
@ -37,14 +37,14 @@
|
||||
<form th:action="@{/admin/message/publish/{id}(id=${message.id})}" method="post">
|
||||
<input type="hidden" th:name="page" th:value="${page}">
|
||||
<button type="submit" class="btn btn-link button-link"
|
||||
onclick="return confirm('Вы уверены?')">Опубликовать</button>
|
||||
onclick="return confirm('Are you sure?')">Publish</button>
|
||||
</form>
|
||||
</td>
|
||||
<td>
|
||||
<form th:action="@{/admin/message/delete/{id}(id=${message.id})}" method="post">
|
||||
<input type="hidden" th:name="page" th:value="${page}">
|
||||
<button type="submit" class="btn btn-link button-link"
|
||||
onclick="return confirm('Вы уверены?')">Удалить</button>
|
||||
onclick="return confirm('Are you sure?')">Delete</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -4,29 +4,29 @@
|
||||
<body>
|
||||
<th:block th:fragment="orders (items, totalPages, currentPage)">
|
||||
<th:block th:switch="${items.size()}">
|
||||
<h2 th:case="0">Данные отсутствуют</h2>
|
||||
<h2 th:case="0">No data available</h2>
|
||||
<th:block th:case="*">
|
||||
<form th:action="@{/}" method="get" class="row mt-2">
|
||||
<div class="col-sm-10">
|
||||
<input type="hidden" th:name="page" th:value="${page}">
|
||||
<select th:name="typeId" id="typeId" class="form-select">
|
||||
<option selected value="">Фильтр по типу товара</option>
|
||||
<option selected value="">Type filter</option>
|
||||
<option th:each="type : ${types}" th:value="${type.id}" th:selected="${type.id==typeId}">
|
||||
[[${type.name}]]
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary col-sm-2">Показать</button>
|
||||
<button type="submit" class="btn btn-primary col-sm-2">Submit</button>
|
||||
</form>
|
||||
<table class="table mt-2">
|
||||
<caption></caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" class="w-10">ID</th>
|
||||
<th scope="col" class="w-auto">Тип заказа</th>
|
||||
<th scope="col" class="w-10">Цена</th>
|
||||
<th scope="col" class="w-10">Количество</th>
|
||||
<th scope="col" class="w-10">Сумма</th>
|
||||
<th scope="col" class="w-auto">Type</th>
|
||||
<th scope="col" class="w-10">Price</th>
|
||||
<th scope="col" class="w-10">Count</th>
|
||||
<th scope="col" class="w-10">Total</th>
|
||||
<th scope="col" class="w-10"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
@ -42,7 +42,7 @@
|
||||
<input type="hidden" th:name="page" th:value="${page}">
|
||||
<input type="hidden" th:name="typeId" th:value="${typeId}">
|
||||
<button type="submit" class="btn btn-link button-link"
|
||||
onclick="return confirm('Вы уверены?')">Удалить</button>
|
||||
onclick="return confirm('Are you sure?')">Delete</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
@ -54,7 +54,7 @@
|
||||
totalPages=${totalPages},
|
||||
currentPage=${currentPage}) }" />
|
||||
<div class="mt-2 d-flex justify-content-center">
|
||||
<a class="btn btn-primary" href="/cart">Создать заказ</a>
|
||||
<a class="btn btn-primary" href="/cart">Place order</a>
|
||||
</div>
|
||||
</th:block>
|
||||
</th:block>
|
||||
|
@ -2,20 +2,20 @@
|
||||
<html lang="ru" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" layout:decorate="~{default}">
|
||||
|
||||
<head>
|
||||
<title>Личный кабинет</title>
|
||||
<title>My account</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<main layout:fragment="content">
|
||||
<ul class="nav nav-pills justify-content-center" role="tablist">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" data-bs-toggle="pill" href="#orders">Заказы</a>
|
||||
<a class="nav-link active" data-bs-toggle="pill" href="#orders">Orders</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-bs-toggle="pill" href="#stats">Статистика</a>
|
||||
<a class="nav-link" data-bs-toggle="pill" href="#stats">Statistics</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-bs-toggle="pill" href="#messages">Сообщения</a>
|
||||
<a class="nav-link" data-bs-toggle="pill" href="#messages">Messages</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
@ -2,36 +2,36 @@
|
||||
<html lang="ru" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" layout:decorate="~{default}">
|
||||
|
||||
<head>
|
||||
<title>Вход</title>
|
||||
<title>Sign up</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<main layout:fragment="content">
|
||||
<form action="#" th:action="@{/signup}" th:object="${user}" method="post">
|
||||
<div class="mb-3">
|
||||
<label for="username" class="form-label">Имя пользователя</label>
|
||||
<label for="username" class="form-label">Username</label>
|
||||
<input type="text" th:field="*{username}" id="username" class="form-control">
|
||||
<div th:if="${#fields.hasErrors('username')}" th:errors="*{username}" class="invalid-feedback"></div>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="email" class="form-label">Электронная почта</label>
|
||||
<label for="email" class="form-label">Email</label>
|
||||
<input type="email" th:field="*{email}" id="email" class="form-control">
|
||||
<div th:if="${#fields.hasErrors('email')}" th:errors="*{email}" class="invalid-feedback"></div>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="password" class="form-label">Пароль</label>
|
||||
<label for="password" class="form-label">Password</label>
|
||||
<input type="password" th:field="*{password}" id="password" class="form-control">
|
||||
<div th:if="${#fields.hasErrors('password')}" th:errors="*{password}" class="invalid-feedback"></div>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="passwordConfirm" class="form-label">Пароль (подтверждение)</label>
|
||||
<label for="passwordConfirm" class="form-label">Password confirm</label>
|
||||
<input type="password" th:field="*{passwordConfirm}" id="passwordConfirm" class="form-control">
|
||||
<div th:if="${#fields.hasErrors('passwordConfirm')}" th:errors="*{passwordConfirm}"
|
||||
class="invalid-feedback"></div>
|
||||
</div>
|
||||
<div class="mb-3 d-flex flex-row">
|
||||
<button class="btn btn-primary me-2 button-fixed-width" type="submit">Регистрация</button>
|
||||
<a class="btn btn-secondary button-fixed-width" href="/">Отмена</a>
|
||||
<button class="btn btn-primary me-2 button-fixed-width" type="submit">Sign up</button>
|
||||
<a class="btn btn-secondary button-fixed-width" href="/">Cancel</a>
|
||||
</div>
|
||||
</form>
|
||||
</main>
|
||||
|
@ -2,7 +2,7 @@
|
||||
<html lang="ru" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" layout:decorate="~{default}">
|
||||
|
||||
<head>
|
||||
<title>Редактировать тип заказа</title>
|
||||
<title>Edit order type</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
@ -13,13 +13,13 @@
|
||||
<input type="text" th:value="*{id}" id="id" class="form-control" readonly disabled>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="name" class="form-label">Тип заказа</label>
|
||||
<label for="name" class="form-label">Type name</label>
|
||||
<input type="text" th:field="*{name}" id="name" class="form-control">
|
||||
<div th:if="${#fields.hasErrors('name')}" th:errors="*{name}" class="invalid-feedback"></div>
|
||||
</div>
|
||||
<div class="mb-3 d-flex flex-row">
|
||||
<button class="btn btn-primary me-2 button-fixed-width" type="submit">Сохранить</button>
|
||||
<a class="btn btn-secondary button-fixed-width" href="/admin/type">Отмена</a>
|
||||
<button class="btn btn-primary me-2 button-fixed-width" type="submit">Save</button>
|
||||
<a class="btn btn-secondary button-fixed-width" href="/admin/type">Cancel</a>
|
||||
</div>
|
||||
</form>
|
||||
</main>
|
||||
|
@ -2,24 +2,24 @@
|
||||
<html lang="ru" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" layout:decorate="~{default}">
|
||||
|
||||
<head>
|
||||
<title>Типы заказов</title>
|
||||
<title>Order types</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<main layout:fragment="content">
|
||||
<th:block th:switch="${items.size()}">
|
||||
<h2 th:case="0">Данные отсутствуют</h2>
|
||||
<h2 th:case="0">No data available</h2>
|
||||
<th:block th:case="*">
|
||||
<h2>Типы заказов</h2>
|
||||
<h2>Order types</h2>
|
||||
<div>
|
||||
<a href="/admin/type/edit/" class="btn btn-primary">Добавить тип заказа</a>
|
||||
<a href="/admin/type/edit/" class="btn btn-primary">Create order type</a>
|
||||
</div>
|
||||
<table class="table">
|
||||
<caption></caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" class="w-10">ID</th>
|
||||
<th scope="col" class="w-auto">Тип заказа</th>
|
||||
<th scope="col" class="w-auto">Type name</th>
|
||||
<th scope="col" class="w-10"></th>
|
||||
<th scope="col" class="w-10"></th>
|
||||
</tr>
|
||||
@ -30,13 +30,13 @@
|
||||
<td th:text="${type.name}"></td>
|
||||
<td>
|
||||
<form th:action="@{/admin/type/edit/{id}(id=${type.id})}" method="get">
|
||||
<button type="submit" class="btn btn-link button-link">Редактировать</button>
|
||||
<button type="submit" class="btn btn-link button-link">Edit</button>
|
||||
</form>
|
||||
</td>
|
||||
<td>
|
||||
<form th:action="@{/admin/type/delete/{id}(id=${type.id})}" method="post">
|
||||
<button type="submit" class="btn btn-link button-link"
|
||||
onclick="return confirm('Вы уверены?')">Удалить</button>
|
||||
onclick="return confirm('Are you sure?')">Delete</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -2,7 +2,7 @@
|
||||
<html lang="ru" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" layout:decorate="~{default}">
|
||||
|
||||
<head>
|
||||
<title>Редактировать пользователя</title>
|
||||
<title>Edit user</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
@ -14,18 +14,18 @@
|
||||
<input type="text" th:value="*{id}" id="id" class="form-control" readonly disabled>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="username" class="form-label">Имя пользователя</label>
|
||||
<label for="username" class="form-label">Username</label>
|
||||
<input type="text" th:field="*{username}" id="username" class="form-control">
|
||||
<div th:if="${#fields.hasErrors('username')}" th:errors="*{username}" class="invalid-feedback"></div>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="email" class="form-label">Электронная почта</label>
|
||||
<label for="email" class="form-label">Email</label>
|
||||
<input type="email" th:field="*{email}" id="email" class="form-control">
|
||||
<div th:if="${#fields.hasErrors('email')}" th:errors="*{email}" class="invalid-feedback"></div>
|
||||
</div>
|
||||
<div class="mb-3 d-flex flex-row">
|
||||
<button class="btn btn-primary me-2 button-fixed-width" type="submit">Сохранить</button>
|
||||
<a class="btn btn-secondary button-fixed-width" th:href="@{/admin/user(page=${page})}">Отмена</a>
|
||||
<button class="btn btn-primary me-2 button-fixed-width" type="submit">Save</button>
|
||||
<a class="btn btn-secondary button-fixed-width" th:href="@{/admin/user(page=${page})}">Cancel</a>
|
||||
</div>
|
||||
</form>
|
||||
</main>
|
||||
|
@ -4,17 +4,17 @@
|
||||
<body>
|
||||
<th:block th:fragment="messages (items, totalPages, currentPage)">
|
||||
<th:block th:switch="${items.size()}">
|
||||
<h2 th:case="0">Данные отсутствуют</h2>
|
||||
<h2 th:case="0">No data available</h2>
|
||||
<th:block th:case="*">
|
||||
<table class="table mt-2">
|
||||
<caption></caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" class="w-10">ID</th>
|
||||
<th scope="col" class="w-10">Отправитель</th>
|
||||
<th scope="col" class="w-auto">Сообщение</th>
|
||||
<th scope="col" class="w-10">Дата отправки</th>
|
||||
<th scope="col" class="w-10">Опубликовано</th>
|
||||
<th scope="col" class="w-10">Sender</th>
|
||||
<th scope="col" class="w-auto">Message</th>
|
||||
<th scope="col" class="w-10">Date</th>
|
||||
<th scope="col" class="w-4" style="text-align: center;">Published</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@ -35,7 +35,7 @@
|
||||
totalPages=${totalPages},
|
||||
currentPage=${currentPage}) }" />
|
||||
<div class="mt-2 d-flex justify-content-center">
|
||||
<a class="btn btn-primary" href="/message/send/">Написать сообщение</a>
|
||||
<a class="btn btn-primary" href="/message/send/">Send message</a>
|
||||
</div>
|
||||
</th:block>
|
||||
</th:block>
|
||||
|
@ -2,25 +2,25 @@
|
||||
<html lang="ru" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" layout:decorate="~{default}">
|
||||
|
||||
<head>
|
||||
<title>Пользователи</title>
|
||||
<title>Users</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<main layout:fragment="content">
|
||||
<th:block th:switch="${userItems.size()}">
|
||||
<h2 th:case="0">Данные отсутствуют</h2>
|
||||
<h2 th:case="0">No data available</h2>
|
||||
<th:block th:case="*">
|
||||
<h2>Пользователи</h2>
|
||||
<h2>Users</h2>
|
||||
<div>
|
||||
<a th:href="@{/admin/user/edit/(page=${page})}" class="btn btn-primary">Добавить пользователя</a>
|
||||
<a th:href="@{/admin/user/edit/(page=${page})}" class="btn btn-primary">Create user</a>
|
||||
</div>
|
||||
<table class="table">
|
||||
<caption></caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" class="w-10">ID</th>
|
||||
<th scope="col" class="w-auto">Имя пользователя</th>
|
||||
<th scope="col" class="w-auto">Электронная почта</th>
|
||||
<th scope="col" class="w-auto">Username</th>
|
||||
<th scope="col" class="w-auto">Email</th>
|
||||
<th scope="col" class="w-10"></th>
|
||||
<th scope="col" class="w-10"></th>
|
||||
</tr>
|
||||
@ -33,14 +33,14 @@
|
||||
<td>
|
||||
<form th:action="@{/admin/user/edit/{id}(id=${user.id})}" method="get">
|
||||
<input type="hidden" th:name="page" th:value="${page}">
|
||||
<button type="submit" class="btn btn-link button-link">Редактировать</button>
|
||||
<button type="submit" class="btn btn-link button-link">Edit</button>
|
||||
</form>
|
||||
</td>
|
||||
<td>
|
||||
<form th:action="@{/admin/user/delete/{id}(id=${user.id})}" method="post">
|
||||
<input type="hidden" th:name="page" th:value="${page}">
|
||||
<button type="submit" class="btn btn-link button-link"
|
||||
onclick="return confirm('Вы уверены?')">Удалить</button>
|
||||
onclick="return confirm('Are you sure?')">Delete</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
|
Loading…
Reference in New Issue
Block a user