чуть визуала

This commit is contained in:
Максим Яковлев 2024-05-13 15:27:47 +04:00
parent 17214648a2
commit e60943d591
18 changed files with 48 additions and 56 deletions

Binary file not shown.

View File

@ -50,34 +50,34 @@ public class DemoApplication implements CommandLineRunner {
public void run(String... args) throws Exception { public void run(String... args) throws Exception {
log.info("start"); log.info("start");
// log.info("Create default user values"); log.info("Create default user values");
// final var admin = new UserEntity("admin", "admin@mail.com", "admin"); final var admin = new UserEntity("admin", "admin@mail.com", "admin");
// admin.setRole(UserRole.ADMIN); admin.setRole(UserRole.ADMIN);
// userService.create(admin); userService.create(admin);
// final var user1 = userService.create(new UserEntity("user", "user@gmail.com", final var user1 = userService.create(new UserEntity("user", "user@gmail.com",
// Constants.DEFAULT_PASSWORD)); Constants.DEFAULT_PASSWORD));
// final var type1 = typeService.create(new TypeEntity("ААА")); final var type1 = typeService.create(new TypeEntity("ААА"));
// final var type2 = typeService.create(new TypeEntity("АА")); final var type2 = typeService.create(new TypeEntity("АА"));
// final var genre1 = genreService.create(new GenreEntity("Приключения")); final var genre1 = genreService.create(new GenreEntity("Приключения"));
// final var genre2 = genreService.create(new GenreEntity("Симулятор")); final var genre2 = genreService.create(new GenreEntity("Симулятор"));
// final List<GenreEntity> genres1 = new ArrayList<GenreEntity>(); final List<GenreEntity> genres1 = new ArrayList<GenreEntity>();
// genres1.add(genre1); genres1.add(genre1);
// genres1.add(genre2); genres1.add(genre2);
// final List<GenreEntity> genres2 = new ArrayList<GenreEntity>(); final List<GenreEntity> genres2 = new ArrayList<GenreEntity>();
// genres2.add(genre2); genres2.add(genre2);
// final var game1 = gameService.create(new GameEntity(type1, "Game1", 2100.0, final var game1 = gameService.create(new GameEntity(type1, "Game1", 2100.0,
// "good game", genres1)); "good game", genres1));
// final var game2 = gameService.create(new GameEntity(type2, "Game2", 1200.0, final var game2 = gameService.create(new GameEntity(type2, "Game2", 1200.0,
// "bad game", genres2)); "bad game", genres2));
// final List<GameEntity> games = new ArrayList<GameEntity>(); final List<GameEntity> games = new ArrayList<GameEntity>();
// games.add(game1); games.add(game1);
// games.add(game2); games.add(game2);
// orderService.create(user1.getId(), new OrderEntity(games)); orderService.create(user1.getId(), new OrderEntity(games));
} }
} }

View File

@ -1,6 +1,7 @@
html, html,
body { body {
height: 100%; height: 100%;
background-color: #252A34;
} }
h1 { h1 {
@ -38,7 +39,7 @@ td form {
} }
.my-navbar { .my-navbar {
background-color: #3c3c3c !important; background-color: #08D9D6 !important;
} }
.my-navbar .link a:hover { .my-navbar .link a:hover {
@ -51,7 +52,7 @@ td form {
} }
.my-footer { .my-footer {
background-color: #2c2c2c; background-color: #FF2E63;
height: 32px; height: 32px;
color: rgba(255, 255, 255, 0.5); color: rgba(255, 255, 255, 0.5);
} }

View File

@ -6,7 +6,7 @@
</head> </head>
<body> <body>
<main layout:fragment="content"> <main layout:fragment="content" class="w-50 mx-auto">
<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">Корзина</strong>
@ -17,7 +17,7 @@
</button> </button>
</form> </form>
</div> </div>
<div class="card col-12 col-md-8 col-lg-6 w-25 align-items-center" th:each="cartItem : ${cart}"> <div class="card col-12 col-md-8 col-lg-6 w-75 align-items-center" th:each="cartItem : ${cart}">
<div class="card-body col-12 p-2 d-flex flex-row align-items-center justify-content-center"> <div class="card-body col-12 p-2 d-flex flex-row align-items-center justify-content-center">
<div class="col-5"> <div class="col-5">
Название: [[${cartItem.gameName}]] Название: [[${cartItem.gameName}]]
@ -50,16 +50,6 @@
</select> </select>
<div th:if="${#fields.hasErrors('game')}" th:errors="*{game}" class="invalid-feedback"></div> <div th:if="${#fields.hasErrors('game')}" th:errors="*{game}" class="invalid-feedback"></div>
</div> </div>
<!-- <div class="mb-2">
<label for="price" class="form-label">Цена</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>
<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">Добавить в корзину</button>
</form> </form>
</div> </div>

View File

@ -7,7 +7,7 @@
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" /> <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title layout:title-pattern="$LAYOUT_TITLE - $CONTENT_TITLE">My shop</title> <title layout:title-pattern="$LAYOUT_TITLE - $CONTENT_TITLE">Gamepad.ru</title>
<script type="text/javascript" src="/webjars/bootstrap/5.3.3/dist/js/bootstrap.bundle.min.js"></script> <script type="text/javascript" src="/webjars/bootstrap/5.3.3/dist/js/bootstrap.bundle.min.js"></script>
<link rel="stylesheet" href="/webjars/bootstrap/5.3.3/dist/css/bootstrap.min.css" /> <link rel="stylesheet" href="/webjars/bootstrap/5.3.3/dist/css/bootstrap.min.css" />
<link rel="stylesheet" href="/webjars/bootstrap-icons/1.11.3/font/bootstrap-icons.min.css" /> <link rel="stylesheet" href="/webjars/bootstrap-icons/1.11.3/font/bootstrap-icons.min.css" />
@ -18,8 +18,8 @@
<nav class="navbar navbar-expand-md my-navbar" data-bs-theme="dark"> <nav class="navbar navbar-expand-md my-navbar" data-bs-theme="dark">
<div class="container-fluid"> <div class="container-fluid">
<a class="navbar-brand" href="/"> <a class="navbar-brand" href="/">
<i class="bi bi-cart2 d-inline-block align-top me-1 logo"></i> <i class="bi-controller d-inline-block align-top me-1 logo"></i>
MyShop Gamepad.ru
</a> </a>
<th:block sec:authorize="isAuthenticated()" th:with="userName=${#authentication.name}"> <th:block sec:authorize="isAuthenticated()" th:with="userName=${#authentication.name}">
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#main-navbar" <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#main-navbar"

View File

@ -6,7 +6,7 @@
</head> </head>
<body> <body>
<main layout:fragment="content"> <main layout:fragment="content" class="w-50 mx-auto">
<form action="#" th:action="@{/admin/game/edit/{id}(id=${game.id})}" th:object="${game}" method="post"> <form action="#" th:action="@{/admin/game/edit/{id}(id=${game.id})}" th:object="${game}" method="post">
<div class="mb-3"> <div class="mb-3">
<label for="id" class="form-label">ID</label> <label for="id" class="form-label">ID</label>

View File

@ -6,11 +6,11 @@
</head> </head>
<body> <body>
<main layout:fragment="content"> <main layout:fragment="content" class="w-50 mx-auto">
<th:block th:switch="${items.size()}"> <th:block th:switch="${items.size()}">
<h2 th:case="0">Данные отсутствуют</h2> <h2 th:case="0">Данные отсутствуют</h2>
<th:block th:case="*"> <th:block th:case="*">
<h2>Игры</h2> <h2 class="text-center">Игры</h2>
<div> <div>
<a href="/admin/game/edit/" class="btn btn-primary">Добавить игру</a> <a href="/admin/game/edit/" class="btn btn-primary">Добавить игру</a>
</div> </div>

View File

@ -6,7 +6,7 @@
</head> </head>
<body> <body>
<main layout:fragment="content"> <main layout:fragment="content" class="w-50 mx-auto">
<form action="#" th:action="@{/admin/genre/edit/{id}(id=${genre.id})}" th:object="${genre}" method="post"> <form action="#" th:action="@{/admin/genre/edit/{id}(id=${genre.id})}" th:object="${genre}" method="post">
<div class="mb-3"> <div class="mb-3">
<label for="id" class="form-label">ID</label> <label for="id" class="form-label">ID</label>

View File

@ -6,11 +6,11 @@
</head> </head>
<body> <body>
<main layout:fragment="content"> <main layout:fragment="content" class="w-50 mx-auto">
<th:block th:switch="${items.size()}"> <th:block th:switch="${items.size()}">
<h2 th:case="0">Данные отсутствуют</h2> <h2 th:case="0">Данные отсутствуют</h2>
<th:block th:case="*"> <th:block th:case="*">
<h2>Жанры игр</h2> <h2 class="text-center">Жанры игр</h2>
<div> <div>
<a href="/admin/genre/edit/" class="btn btn-primary">Добавить жанр игры</a> <a href="/admin/genre/edit/" class="btn btn-primary">Добавить жанр игры</a>
</div> </div>

View File

@ -7,7 +7,7 @@
<body> <body>
<main layout:fragment="content"> <main layout:fragment="content">
<form action="#" th:action="@{/login}" method="post"> <form action="#" th:action="@{/login}" method="post" class="w-25 mx-auto">
<div th:if="${param.error}" class="alert alert-danger"> <div th:if="${param.error}" class="alert alert-danger">
Неверный логин или пароль Неверный логин или пароль
</div> </div>

View File

@ -5,7 +5,7 @@
<th:block th:fragment="orders (items, totalPages, currentPage, games)"> <th:block th:fragment="orders (items, totalPages, currentPage, games)">
<th:block th:switch="${items.size()}"> <th:block th:switch="${items.size()}">
<h2 th:case="0">Данные отсутствуют</h2> <h2 th:case="0">Данные отсутствуют</h2>
<th:block th:case="*"> <th:block th:case="*" class="w-50 mx-auto">
<table class="table mt-2"> <table class="table mt-2">
<caption></caption> <caption></caption>

View File

@ -6,7 +6,7 @@
</head> </head>
<body> <body>
<main layout:fragment="content"> <main layout:fragment="content" class="w-50 mx-auto">
<!-- <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">Заказы</a>
@ -14,6 +14,7 @@
</ul> --> </ul> -->
<div class="tab-content mt-2"> <div class="tab-content mt-2">
<h2 class="text-center">Заказы</h2>
<div class="tab-pane container active" id="orders"> <div class="tab-pane container active" id="orders">
<th:block <th:block
th:replace="~{ orders :: orders (items=${items}, totalPages=${totalPages}, currentPage=${currentPage}, games=${games})}" /> th:replace="~{ orders :: orders (items=${items}, totalPages=${totalPages}, currentPage=${currentPage}, games=${games})}" />

View File

@ -6,7 +6,7 @@
</head> </head>
<body> <body>
<main layout:fragment="content"> <main layout:fragment="content" class="w-25 mx-auto">
<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="login" class="form-label">Имя пользователя</label> <label for="login" class="form-label">Имя пользователя</label>

View File

@ -6,7 +6,7 @@
</head> </head>
<body> <body>
<main layout:fragment="content"> <main layout:fragment="content" class="w-50 mx-auto">
<form action="#" th:action="@{/admin/type/edit/{id}(id=${type.id})}" th:object="${type}" method="post"> <form action="#" th:action="@{/admin/type/edit/{id}(id=${type.id})}" th:object="${type}" method="post">
<div class="mb-3"> <div class="mb-3">
<label for="id" class="form-label">ID</label> <label for="id" class="form-label">ID</label>

View File

@ -6,11 +6,11 @@
</head> </head>
<body> <body>
<main layout:fragment="content"> <main layout:fragment="content" class="w-50 mx-auto">
<th:block th:switch="${items.size()}"> <th:block th:switch="${items.size()}">
<h2 th:case="0">Данные отсутствуют</h2> <h2 th:case="0">Данные отсутствуют</h2>
<th:block th:case="*"> <th:block th:case="*">
<h2>Типы игр</h2> <h2 class="text-center">Типы игр</h2>
<div> <div>
<a href="/admin/type/edit/" class="btn btn-primary">Добавить тип игры</a> <a href="/admin/type/edit/" class="btn btn-primary">Добавить тип игры</a>
</div> </div>

View File

@ -6,7 +6,7 @@
</head> </head>
<body> <body>
<main layout:fragment="content"> <main layout:fragment="content" class="w-50 mx-auto">
<form action="#" th:action="@{/admin/user/edit/{id}(id=${user.id},page=${page})}" th:object="${user}" <form action="#" th:action="@{/admin/user/edit/{id}(id=${user.id},page=${page})}" th:object="${user}"
method="post"> method="post">
<div class="mb-3"> <div class="mb-3">

View File

@ -6,11 +6,11 @@
</head> </head>
<body> <body>
<main layout:fragment="content"> <main layout:fragment="content" class="w-50 mx-auto">
<th:block th:switch="${items.size()}"> <th:block th:switch="${items.size()}">
<h2 th:case="0">Данные отсутствуют</h2> <h2 th:case="0">Данные отсутствуют</h2>
<th:block th:case="*"> <th:block th:case="*">
<h2>Пользователи</h2> <h2 class=" text-center">Пользователи</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">Добавить пользователя</a>
</div> </div>