LabWork04-05 / Translate to English language

This commit is contained in:
parent 6b5d17f0cb
commit 1c5ec72d08
16 changed files with 97 additions and 96 deletions

Binary file not shown.

View File

@ -41,10 +41,11 @@ td form {
.my-navbar { .my-navbar {
background-color: #2c2a2a !important; background-color: #2c2a2a !important;
color: white;
} }
.my-navbar .link a:hover { .my-navbar .link a:hover {
text-decoration: underline; color: #a721fa;
} }
.my-navbar .logo { .my-navbar .logo {

View File

@ -2,18 +2,18 @@
<html lang="ru" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" layout:decorate="~{default}"> <html lang="ru" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" layout:decorate="~{default}">
<head> <head>
<title>Корзина</title> <title>Cart</title>
</head> </head>
<body> <body>
<main layout:fragment="content"> <main layout:fragment="content">
<div class="d-flex flex-column align-items-center"> <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"> <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"> <form action="#" th:action="@{/cart/clear}" method="post">
<button type="submit" class="btn btn-danger button-fixed-width" <button type="submit" class="btn btn-danger button-fixed-width"
onclick="return confirm('Вы уверены?')"> onclick="return confirm('Вы уверены?')">
<i class="bi bi-x-lg"></i> Очистить <i class="bi bi-x-lg"></i> Clear
</button> </button>
</form> </form>
</div> </div>
@ -44,13 +44,13 @@
</div> </div>
</div> </div>
<div class=" mb-2 col-12 col-md-8 col-lg-6 d-flex justify-content-end"> <div class=" mb-2 col-12 col-md-8 col-lg-6 d-flex justify-content-end">
<strong>Итого: [[${#numbers.formatDecimal(totalCart, 1, 2)}]] &#8381;</strong> <strong>Total: [[${#numbers.formatDecimal(totalCart, 1, 2)}]] &#8381;</strong>
</div> </div>
<div class="mb-2 col-12 col-md-8 col-lg-6 d-flex justify-content-center" <div class="mb-2 col-12 col-md-8 col-lg-6 d-flex justify-content-center"
th:if="${not #lists.isEmpty(cart)}"> th:if="${not #lists.isEmpty(cart)}">
<form action="#" th:action="@{/cart/save}" method="post"> <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> </button>
</form> </form>
</div> </div>
@ -58,24 +58,24 @@
<div class="mb-2"> <div class="mb-2">
<form action=" #" th:action="@{/cart}" th:object="${order}" method="post"> <form action=" #" th:action="@{/cart}" th:object="${order}" method="post">
<div class="mb-2"> <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"> <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> <option th:each="type : ${types}" th:value="${type.id}">[[${type.name}]]</option>
</select> </select>
<div th:if="${#fields.hasErrors('type')}" th:errors="*{type}" class="invalid-feedback"></div> <div th:if="${#fields.hasErrors('type')}" th:errors="*{type}" class="invalid-feedback"></div>
</div> </div>
<div class="mb-2"> <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"> <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 th:if="${#fields.hasErrors('price')}" th:errors="*{price}" class="invalid-feedback"></div>
</div> </div>
<div class="mb-2"> <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"> <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 th:if="${#fields.hasErrors('count')}" th:errors="*{count}" class="invalid-feedback"></div>
</div> </div>
<button type="submit" class="btn btn-primary">Добавить в корзину</button> <button type="submit" class="btn btn-primary">Add to cart</button>
</form> </form>
</div> </div>
</main> </main>

View File

@ -32,23 +32,23 @@
<th:block sec:authorize="hasRole('ADMIN')"> <th:block sec:authorize="hasRole('ADMIN')">
<a class="nav-link" href="/admin/user" <a class="nav-link" href="/admin/user"
th:classappend="${activeLink.startsWith('/admin/user') ? 'active' : ''}"> th:classappend="${activeLink.startsWith('/admin/user') ? 'active' : ''}">
Пользователи Users
</a> </a>
<a class="nav-link" href="/admin/type" <a class="nav-link" href="/admin/type"
th:classappend="${activeLink.startsWith('/admin/type') ? 'active' : ''}"> th:classappend="${activeLink.startsWith('/admin/type') ? 'active' : ''}">
Типы заказов Types
</a> </a>
<a class="nav-link" href="/admin/message" <a class="nav-link" href="/admin/message"
th:classappend="${activeLink.startsWith('/admin/message') ? 'active' : ''}"> th:classappend="${activeLink.startsWith('/admin/message') ? 'active' : ''}">
Сообщения Messages
</a> </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> </th:block>
</ul> </ul>
<ul class="navbar-nav" th:if="${not #strings.isEmpty(userName)}"> <ul class="navbar-nav" th:if="${not #strings.isEmpty(userName)}">
<form th:action="@{/logout}" method="post"> <form th:action="@{/logout}" method="post">
<button type="submit" class="navbar-brand nav-link" onclick="return confirm('Вы уверены?')"> <button type="submit" class="navbar-brand nav-link" onclick="return confirm('Are you sure?')">
Выход ([[${userName}]]) Logout ([[${userName}]])
</button> </button>
</form> </form>
<a class="navbar-brand" href="/cart"> <a class="navbar-brand" href="/cart">

View File

@ -2,7 +2,7 @@
<html lang="ru" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" layout:decorate="~{default}"> <html lang="ru" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" layout:decorate="~{default}">
<head> <head>
<title>Ошибка</title> <title>Error</title>
</head> </head>
<body> <body>
@ -10,27 +10,27 @@
<ul class="list-group mb-2"> <ul class="list-group mb-2">
<th:block th:if="${#strings.isEmpty(message)}"> <th:block th:if="${#strings.isEmpty(message)}">
<li class="list-group-item"> <li class="list-group-item">
Неизвестная ошибка Unknown error
</li> </li>
</th:block> </th:block>
<th:block th:if="${not #strings.isEmpty(message)}"> <th:block th:if="${not #strings.isEmpty(message)}">
<li class="list-group-item"> <li class="list-group-item">
<strong>Ошибка:</strong> [[${message}]] <strong>Error:</strong> [[${message}]]
</li> </li>
</th:block> </th:block>
<th:block th:if="${not #strings.isEmpty(url)}"> <th:block th:if="${not #strings.isEmpty(url)}">
<li class="list-group-item"> <li class="list-group-item">
<strong>Адрес:</strong> [[${url}]] <strong>URL:</strong> [[${url}]]
</li> </li>
<li class="list-group-item"> <li class="list-group-item">
<strong>Класс исключения:</strong> [[${exception}]] <strong>Exception:</strong> [[${exception}]]
</li> </li>
<li class="list-group-item"> <li class="list-group-item">
[[${method}]] ([[${file}]]:[[${line}]]) [[${method}]] ([[${file}]]:[[${line}]])
</li> </li>
</th:block> </th:block>
</ul> </ul>
<a class="btn btn-primary button-fixed-width" href="/">На главную</a> <a class="btn btn-primary button-fixed-width" href="/">Home</a>
</main> </main>
</body> </body>

View File

@ -2,38 +2,38 @@
<html lang="ru" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" layout:decorate="~{default}"> <html lang="ru" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" layout:decorate="~{default}">
<head> <head>
<title>Вход</title> <title>Login</title>
</head> </head>
<body> <body>
<main layout:fragment="content"> <main layout:fragment="content">
<form action="#" th:action="@{/login}" method="post"> <form action="#" th:action="@{/login}" method="post">
<div th:if="${param.error}" class="alert alert-danger"> <div th:if="${param.error}" class="alert alert-danger">
Неверный логин или пароль Invalid login or password
</div> </div>
<div th:if="${param.logout}" class="alert alert-success"> <div th:if="${param.logout}" class="alert alert-success">
Выход успешно произведен The exit was successful
</div> </div>
<div th:if="${param.signup}" class="alert alert-success"> <div th:if="${param.signup}" class="alert alert-success">
Пользователь успешно создан User successfully created
</div> </div>
<div class="mb-3"> <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" <input type="text" id="username" name="username" class="form-control" required minlength="3"
maxlength="20"> maxlength="20">
</div> </div>
<div class="mb-3"> <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" <input type="password" id="password" name="password" class="form-control" required minlength="3"
maxlength="20"> maxlength="20">
</div> </div>
<div class="form-check mb-3"> <div class="form-check mb-3">
<input class="form-check-input" type="checkbox" id="remember-me" name="remember-me" checked> <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>
<div class="mb-3 d-flex flex-row"> <div class="mb-3 d-flex flex-row">
<button class="btn btn-primary me-2 button-fixed-width" type="submit">Войти</button> <button class="btn btn-primary me-2 button-fixed-width" type="submit">Login</button>
<a class="btn btn-secondary button-fixed-width" href="/signup">Регистрация</a> <a class="btn btn-secondary button-fixed-width" href="/signup">Sign up</a>
</div> </div>
</form> </form>
</main> </main>

View File

@ -2,20 +2,20 @@
<html lang="ru" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" layout:decorate="~{default}"> <html lang="ru" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" layout:decorate="~{default}">
<head> <head>
<title>Отправить сообщение</title> <title>Send message</title>
</head> </head>
<body> <body>
<main layout:fragment="content"> <main layout:fragment="content">
<form action="#" th:action="@{/message/send/}" th:object="${message}" method="post"> <form action="#" th:action="@{/message/send/}" th:object="${message}" method="post">
<div class="mb-3"> <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"> <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 th:if="${#fields.hasErrors('text')}" th:errors="*{text}" class="invalid-feedback"></div>
</div> </div>
<div class="mb-3 d-flex flex-row"> <div class="mb-3 d-flex flex-row">
<button class="btn btn-primary me-2 button-fixed-width" type="submit">Отправить</button> <button class="btn btn-primary me-2 button-fixed-width" type="submit">Send message</button>
<a class="btn btn-secondary button-fixed-width" href="/">Отмена</a> <a class="btn btn-secondary button-fixed-width" href="/">Cancel</a>
</div> </div>
</form> </form>
</main> </main>

View File

@ -2,24 +2,24 @@
<html lang="ru" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" layout:decorate="~{default}"> <html lang="ru" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" layout:decorate="~{default}">
<head> <head>
<title>Сообщения</title> <title>Messages</title>
</head> </head>
<body> <body>
<main layout:fragment="content"> <main layout:fragment="content">
<th:block th:switch="${messageItems.size()}"> <th:block th:switch="${messageItems.size()}">
<h2 th:case="0">Данные отсутствуют</h2> <h2 th:case="0">No data available</h2>
<th:block th:case="*"> <th:block th:case="*">
<h2>Сообщения</h2> <h2>Messages</h2>
<table class="table"> <table class="table">
<caption></caption> <caption></caption>
<thead> <thead>
<tr> <tr>
<th scope="col" class="w-10">ID</th> <th scope="col" class="w-10">ID</th>
<th scope="col" class="w-10">Отправитель</th> <th scope="col" class="w-10">Sender</th>
<th scope="col" class="w-auto">Сообщение</th> <th scope="col" class="w-auto">Message</th>
<th scope="col" class="w-10">Дата отправки</th> <th scope="col" class="w-10">Date</th>
<th scope="col" class="w-10">Опубликовано</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>
<th scope="col" class="w-10"></th> <th scope="col" class="w-10"></th>
</tr> </tr>
@ -37,14 +37,14 @@
<form th:action="@{/admin/message/publish/{id}(id=${message.id})}" method="post"> <form th:action="@{/admin/message/publish/{id}(id=${message.id})}" method="post">
<input type="hidden" th:name="page" th:value="${page}"> <input type="hidden" th:name="page" th:value="${page}">
<button type="submit" class="btn btn-link button-link" <button type="submit" class="btn btn-link button-link"
onclick="return confirm('Вы уверены?')">Опубликовать</button> onclick="return confirm('Are you sure?')">Publish</button>
</form> </form>
</td> </td>
<td> <td>
<form th:action="@{/admin/message/delete/{id}(id=${message.id})}" method="post"> <form th:action="@{/admin/message/delete/{id}(id=${message.id})}" method="post">
<input type="hidden" th:name="page" th:value="${page}"> <input type="hidden" th:name="page" th:value="${page}">
<button type="submit" class="btn btn-link button-link" <button type="submit" class="btn btn-link button-link"
onclick="return confirm('Вы уверены?')">Удалить</button> onclick="return confirm('Are you sure?')">Delete</button>
</form> </form>
</td> </td>
</tr> </tr>

View File

@ -4,29 +4,29 @@
<body> <body>
<th:block th:fragment="orders (items, totalPages, currentPage)"> <th:block th:fragment="orders (items, totalPages, currentPage)">
<th:block th:switch="${items.size()}"> <th:block th:switch="${items.size()}">
<h2 th:case="0">Данные отсутствуют</h2> <h2 th:case="0">No data available</h2>
<th:block th:case="*"> <th:block th:case="*">
<form th:action="@{/}" method="get" class="row mt-2"> <form th:action="@{/}" method="get" class="row mt-2">
<div class="col-sm-10"> <div class="col-sm-10">
<input type="hidden" th:name="page" th:value="${page}"> <input type="hidden" th:name="page" th:value="${page}">
<select th:name="typeId" id="typeId" class="form-select"> <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}"> <option th:each="type : ${types}" th:value="${type.id}" th:selected="${type.id==typeId}">
[[${type.name}]] [[${type.name}]]
</option> </option>
</select> </select>
</div> </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> </form>
<table class="table mt-2"> <table class="table mt-2">
<caption></caption> <caption></caption>
<thead> <thead>
<tr> <tr>
<th scope="col" class="w-10">ID</th> <th scope="col" class="w-10">ID</th>
<th scope="col" class="w-auto">Тип заказа</th> <th scope="col" class="w-auto">Type</th>
<th scope="col" class="w-10">Цена</th> <th scope="col" class="w-10">Price</th>
<th scope="col" class="w-10">Количество</th> <th scope="col" class="w-10">Count</th>
<th scope="col" class="w-10">Сумма</th> <th scope="col" class="w-10">Total</th>
<th scope="col" class="w-10"></th> <th scope="col" class="w-10"></th>
</tr> </tr>
</thead> </thead>
@ -42,7 +42,7 @@
<input type="hidden" th:name="page" th:value="${page}"> <input type="hidden" th:name="page" th:value="${page}">
<input type="hidden" th:name="typeId" th:value="${typeId}"> <input type="hidden" th:name="typeId" th:value="${typeId}">
<button type="submit" class="btn btn-link button-link" <button type="submit" class="btn btn-link button-link"
onclick="return confirm('Вы уверены?')">Удалить</button> onclick="return confirm('Are you sure?')">Delete</button>
</form> </form>
</td> </td>
</tr> </tr>
@ -54,7 +54,7 @@
totalPages=${totalPages}, totalPages=${totalPages},
currentPage=${currentPage}) }" /> currentPage=${currentPage}) }" />
<div class="mt-2 d-flex justify-content-center"> <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> </div>
</th:block> </th:block>
</th:block> </th:block>

View File

@ -2,20 +2,20 @@
<html lang="ru" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" layout:decorate="~{default}"> <html lang="ru" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" layout:decorate="~{default}">
<head> <head>
<title>Личный кабинет</title> <title>My account</title>
</head> </head>
<body> <body>
<main layout:fragment="content"> <main layout:fragment="content">
<ul class="nav nav-pills justify-content-center" role="tablist"> <ul class="nav nav-pills justify-content-center" role="tablist">
<li class="nav-item"> <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>
<li class="nav-item"> <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>
<li class="nav-item"> <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> </li>
</ul> </ul>

View File

@ -2,36 +2,36 @@
<html lang="ru" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" layout:decorate="~{default}"> <html lang="ru" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" layout:decorate="~{default}">
<head> <head>
<title>Вход</title> <title>Sign up</title>
</head> </head>
<body> <body>
<main layout:fragment="content"> <main layout:fragment="content">
<form action="#" th:action="@{/signup}" th:object="${user}" method="post"> <form action="#" th:action="@{/signup}" th:object="${user}" method="post">
<div class="mb-3"> <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"> <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 th:if="${#fields.hasErrors('username')}" th:errors="*{username}" class="invalid-feedback"></div>
</div> </div>
<div class="mb-3"> <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"> <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 th:if="${#fields.hasErrors('email')}" th:errors="*{email}" class="invalid-feedback"></div>
</div> </div>
<div class="mb-3"> <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"> <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 th:if="${#fields.hasErrors('password')}" th:errors="*{password}" class="invalid-feedback"></div>
</div> </div>
<div class="mb-3"> <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"> <input type="password" th:field="*{passwordConfirm}" id="passwordConfirm" class="form-control">
<div th:if="${#fields.hasErrors('passwordConfirm')}" th:errors="*{passwordConfirm}" <div th:if="${#fields.hasErrors('passwordConfirm')}" th:errors="*{passwordConfirm}"
class="invalid-feedback"></div> class="invalid-feedback"></div>
</div> </div>
<div class="mb-3 d-flex flex-row"> <div class="mb-3 d-flex flex-row">
<button class="btn btn-primary me-2 button-fixed-width" type="submit">Регистрация</button> <button class="btn btn-primary me-2 button-fixed-width" type="submit">Sign up</button>
<a class="btn btn-secondary button-fixed-width" href="/">Отмена</a> <a class="btn btn-secondary button-fixed-width" href="/">Cancel</a>
</div> </div>
</form> </form>
</main> </main>

View File

@ -2,7 +2,7 @@
<html lang="ru" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" layout:decorate="~{default}"> <html lang="ru" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" layout:decorate="~{default}">
<head> <head>
<title>Редактировать тип заказа</title> <title>Edit order type</title>
</head> </head>
<body> <body>
@ -13,13 +13,13 @@
<input type="text" th:value="*{id}" id="id" class="form-control" readonly disabled> <input type="text" th:value="*{id}" id="id" class="form-control" readonly disabled>
</div> </div>
<div class="mb-3"> <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"> <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 th:if="${#fields.hasErrors('name')}" th:errors="*{name}" class="invalid-feedback"></div>
</div> </div>
<div class="mb-3 d-flex flex-row"> <div class="mb-3 d-flex flex-row">
<button class="btn btn-primary me-2 button-fixed-width" type="submit">Сохранить</button> <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">Отмена</a> <a class="btn btn-secondary button-fixed-width" href="/admin/type">Cancel</a>
</div> </div>
</form> </form>
</main> </main>

View File

@ -2,24 +2,24 @@
<html lang="ru" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" layout:decorate="~{default}"> <html lang="ru" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" layout:decorate="~{default}">
<head> <head>
<title>Типы заказов</title> <title>Order types</title>
</head> </head>
<body> <body>
<main layout:fragment="content"> <main layout:fragment="content">
<th:block th:switch="${items.size()}"> <th:block th:switch="${items.size()}">
<h2 th:case="0">Данные отсутствуют</h2> <h2 th:case="0">No data available</h2>
<th:block th:case="*"> <th:block th:case="*">
<h2>Типы заказов</h2> <h2>Order types</h2>
<div> <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> </div>
<table class="table"> <table class="table">
<caption></caption> <caption></caption>
<thead> <thead>
<tr> <tr>
<th scope="col" class="w-10">ID</th> <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>
<th scope="col" class="w-10"></th> <th scope="col" class="w-10"></th>
</tr> </tr>
@ -30,13 +30,13 @@
<td th:text="${type.name}"></td> <td th:text="${type.name}"></td>
<td> <td>
<form th:action="@{/admin/type/edit/{id}(id=${type.id})}" method="get"> <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> </form>
</td> </td>
<td> <td>
<form th:action="@{/admin/type/delete/{id}(id=${type.id})}" method="post"> <form th:action="@{/admin/type/delete/{id}(id=${type.id})}" method="post">
<button type="submit" class="btn btn-link button-link" <button type="submit" class="btn btn-link button-link"
onclick="return confirm('Вы уверены?')">Удалить</button> onclick="return confirm('Are you sure?')">Delete</button>
</form> </form>
</td> </td>
</tr> </tr>

View File

@ -2,7 +2,7 @@
<html lang="ru" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" layout:decorate="~{default}"> <html lang="ru" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" layout:decorate="~{default}">
<head> <head>
<title>Редактировать пользователя</title> <title>Edit user</title>
</head> </head>
<body> <body>
@ -14,18 +14,18 @@
<input type="text" th:value="*{id}" id="id" class="form-control" readonly disabled> <input type="text" th:value="*{id}" id="id" class="form-control" readonly disabled>
</div> </div>
<div class="mb-3"> <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"> <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 th:if="${#fields.hasErrors('username')}" th:errors="*{username}" class="invalid-feedback"></div>
</div> </div>
<div class="mb-3"> <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"> <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 th:if="${#fields.hasErrors('email')}" th:errors="*{email}" class="invalid-feedback"></div>
</div> </div>
<div class="mb-3 d-flex flex-row"> <div class="mb-3 d-flex flex-row">
<button class="btn btn-primary me-2 button-fixed-width" type="submit">Сохранить</button> <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})}">Отмена</a> <a class="btn btn-secondary button-fixed-width" th:href="@{/admin/user(page=${page})}">Cancel</a>
</div> </div>
</form> </form>
</main> </main>

View File

@ -4,17 +4,17 @@
<body> <body>
<th:block th:fragment="messages (items, totalPages, currentPage)"> <th:block th:fragment="messages (items, totalPages, currentPage)">
<th:block th:switch="${items.size()}"> <th:block th:switch="${items.size()}">
<h2 th:case="0">Данные отсутствуют</h2> <h2 th:case="0">No data available</h2>
<th:block th:case="*"> <th:block th:case="*">
<table class="table mt-2"> <table class="table mt-2">
<caption></caption> <caption></caption>
<thead> <thead>
<tr> <tr>
<th scope="col" class="w-10">ID</th> <th scope="col" class="w-10">ID</th>
<th scope="col" class="w-10">Отправитель</th> <th scope="col" class="w-10">Sender</th>
<th scope="col" class="w-auto">Сообщение</th> <th scope="col" class="w-auto">Message</th>
<th scope="col" class="w-10">Дата отправки</th> <th scope="col" class="w-10">Date</th>
<th scope="col" class="w-10">Опубликовано</th> <th scope="col" class="w-4" style="text-align: center;">Published</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -35,7 +35,7 @@
totalPages=${totalPages}, totalPages=${totalPages},
currentPage=${currentPage}) }" /> currentPage=${currentPage}) }" />
<div class="mt-2 d-flex justify-content-center"> <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> </div>
</th:block> </th:block>
</th:block> </th:block>

View File

@ -2,25 +2,25 @@
<html lang="ru" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" layout:decorate="~{default}"> <html lang="ru" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" layout:decorate="~{default}">
<head> <head>
<title>Пользователи</title> <title>Users</title>
</head> </head>
<body> <body>
<main layout:fragment="content"> <main layout:fragment="content">
<th:block th:switch="${userItems.size()}"> <th:block th:switch="${userItems.size()}">
<h2 th:case="0">Данные отсутствуют</h2> <h2 th:case="0">No data available</h2>
<th:block th:case="*"> <th:block th:case="*">
<h2>Пользователи</h2> <h2>Users</h2>
<div> <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> </div>
<table class="table"> <table class="table">
<caption></caption> <caption></caption>
<thead> <thead>
<tr> <tr>
<th scope="col" class="w-10">ID</th> <th scope="col" class="w-10">ID</th>
<th scope="col" class="w-auto">Имя пользователя</th> <th scope="col" class="w-auto">Username</th>
<th scope="col" class="w-auto">Электронная почта</th> <th scope="col" class="w-auto">Email</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-10"></th>
</tr> </tr>
@ -33,14 +33,14 @@
<td> <td>
<form th:action="@{/admin/user/edit/{id}(id=${user.id})}" method="get"> <form th:action="@{/admin/user/edit/{id}(id=${user.id})}" method="get">
<input type="hidden" th:name="page" th:value="${page}"> <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> </form>
</td> </td>
<td> <td>
<form th:action="@{/admin/user/delete/{id}(id=${user.id})}" method="post"> <form th:action="@{/admin/user/delete/{id}(id=${user.id})}" method="post">
<input type="hidden" th:name="page" th:value="${page}"> <input type="hidden" th:name="page" th:value="${page}">
<button type="submit" class="btn btn-link button-link" <button type="submit" class="btn btn-link button-link"
onclick="return confirm('Вы уверены?')">Удалить</button> onclick="return confirm('Are you sure?')">Delete</button>
</form> </form>
</td> </td>
</tr> </tr>