спасибо коля за картинку

This commit is contained in:
dasha 2023-04-22 13:53:26 +04:00
parent 2d2394bce5
commit 9ce26952ae
16 changed files with 191 additions and 233 deletions

View File

@ -62,11 +62,11 @@ public class CinemaMvcController {
return "cinema-edit";
}
if (id == null || id <= 0) {
cinemaDto.setImage("data:image/jpeg;base64," + Base64.getEncoder().encodeToString(multipartFile.getBytes()));
cinemaDto.setImage("data:" + multipartFile.getContentType() + ";base64," + Base64.getEncoder().encodeToString(multipartFile.getBytes()));
cinemaService.addCinema(cinemaDto);
} else {
cinemaDto.setId(id);
cinemaDto.setImage("data:image/jpeg;base64," + Base64.getEncoder().encodeToString(multipartFile.getBytes()));
cinemaDto.setImage("data:" + multipartFile.getContentType() + ";base64," + Base64.getEncoder().encodeToString(multipartFile.getBytes()));
cinemaService.updateCinema(cinemaDto);
}
return "redirect:/cinema";

View File

@ -24,8 +24,7 @@ public class SessionMvcController {
@GetMapping
public String getSessions(Model model) {
model.addAttribute("sessions",
sessionService.findAllSessions().stream()
model.addAttribute("sessions", sessionService.findAllSessions().stream()
.map(SessionDto::new)
.toList());
return "session";

View File

@ -5,12 +5,6 @@ body {
.green-mark {
background-color: #38a65d;
}
.willSee {
background-color: #38a65d;
}
.delete {
background-color: #e94049;
}
.icon {
width: 50px;
height: 50px;
@ -18,30 +12,10 @@ body {
hr {
height: 2px !important;
}
.description {
color: #8f9398;
}
.editIcon {
height: 2.5vh;
}
.posterChoiceToTaste {
width: 290px;
height: 437px;
}
.posterFilmPage{
width: 290px;
height: 437px;
}
a {
text-decoration: none;
}
a:hover {
color: white;
}
.current a {
color: white;
}
/* for film-page */
.table {
@ -81,6 +55,10 @@ form input {
max-width: 300px;
}
form select {
max-width: 300px;
}
table tbody tr td {
border: 0px !important;
}
@ -101,12 +79,18 @@ header {
header a {
color: #c2c2c2;
text-decoration: none;
}
header a:hover {
color: #ffffff;
color: white;
text-decoration: none;
}
.mainInput {
max-width: 200px;
a {
text-decoration: none;
}
a:hover {
text-decoration: underline;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

View File

@ -5,10 +5,11 @@
<head>
</head>
<body>
<div layout:fragment="content_header">Фильм</div>
<div layout:fragment="content">
<h1>Фильм</h1>
<div th:text="${errors}" class="margin-bottom alert-danger"></div>
<form action="#" th:action="@{/cinema/{id}(id=${id})}" th:object="${cinemaDto}" enctype="multipart/form-data" method="post">
<form action="#" th:action="@{/cinema/{id}(id=${id})}" th:object="${cinemaDto}" enctype="multipart/form-data"
method="post">
<div class="mb-3">
<label for="name" class="form-label">Название</label>
<input type="text" class="form-control" id="name" th:field="${cinemaDto.name}" required="true">

View File

@ -5,18 +5,20 @@
<head>
</head>
<body>
<div layout:fragment="content_header">Фильмы</div>
<div layout:fragment="content">
<h1>Фильмы</h1>
<div class="d-flex justify-content-between align-items-center">
<form action="#" th:action="@{/cinema/search/}" class="d-flex">
<input class="form-control m-1" type="text" name="request" required="true"/>
<button class="btn btn-secondary m-1" type="submit"><i class="fa-solid fa-magnifying-glass"></i></button>
</form>
<div class="d-flex justify-content-end">
<a class="btn btn-success button-fixed"
<a type="button" class="btn btn-success m-1"
th:href="@{/cinema/edit}">
<i class="fa-solid fa-plus"></i>
</a>
</div>
<form action="#" th:action="@{/cinema/search/}">
<input class="form-control mainInput" type="text" name="request" search="true" rounded="true" required="true" />
<button class="border border-0 p-0 ms-2" type="submit"><img class="icon" src="/search.jpg" alt="Поиск" /></button>
</form>
</div>
<hr class="border border-0 bg-black"/>
<table class="table" id="tbl-items">
<tbody>
@ -24,15 +26,17 @@
<td>
<img class="posterItem me-3" th:src="${cinema.image}" alt="${cinema.name}" align="left"/>
<div class="d-flex flex-row flex-wrap flex-grow-1 align-items-center">
<div class="pt-3 description d-flex flex-column justify-content-start align-items-center mb-3 fs-6 fw-bold">
<p class="text-start description">
<a class="text-white fs-5 fw-bold pt-3" th:text="${cinema.name}"></a>
<div class="pt-3 d-flex flex-column justify-content-start align-items-center mb-3 fs-6 fw-bold">
<p class="text-start">
<a class="text-white fs-5 fw-bold pt-3" th:text="${cinema.name}" href=""></a>
</p>
</div>
<div id="rightPanel" class="d-flex flex-wrap justify-content-end text-white fw-bold fs-4 flex-grow-1">
<div id="rightPanel"
class="d-flex flex-wrap justify-content-end text-white fw-bold fs-4 flex-grow-1">
<div class="rounded p-1 mx-2 green-mark">9.2</div>
<div>
<a type="button" class="m-1 btn btn-primary" th:href="@{/cinema/edit/{id}(id=${cinema.id})}">
<a type="button" class="m-1 btn btn-primary"
th:href="@{/cinema/edit/{id}(id=${cinema.id})}">
<i class="fa fa-pencil"></i>
</a>
<a type="button" class="m-1 btn btn-danger"

View File

@ -5,8 +5,8 @@
<head>
</head>
<body>
<div layout:fragment="content_header">Пользователь</div>
<div layout:fragment="content">
<h1>Пользователь</h1>
<div th:text="${errors}" class="margin-bottom alert-danger"></div>
<form action="#" th:action="@{/customer/{id}(id=${id})}" th:object="${customerDto}" method="post">
<div class="mb-3">

View File

@ -5,8 +5,8 @@
<head>
</head>
<body>
<div layout:fragment="content_header">Пользователи</div>
<div layout:fragment="content">
<h1>Пользователи</h1>
<div class="d-flex justify-content-end">
<a class="btn btn-success button-fixed"
th:href="@{/customer/edit}">

View File

@ -8,7 +8,6 @@
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<link rel="icon" href="/favicon.svg">
<script type="text/javascript" src="/webjars/bootstrap/5.1.3/js/bootstrap.bundle.min.js"></script>
<script type="text/javascript" src="/webjars/jquery/3.6.0/jquery.min.js"></script>
<link rel="stylesheet" href="/webjars/bootstrap/5.1.3/css/bootstrap.min.css"/>
<link rel="stylesheet" href="/webjars/font-awesome/6.1.0/css/all.min.css"/>
<link rel="stylesheet" href="/css/style.css"/>
@ -40,29 +39,19 @@
</header>
<div class="container rounded my-5 p-4 content">
<div class="content_header rounded-top p-2 mb-2">
<h1 class="fs-1 fw-bold text-white ms-5">Киносайт</h1>
<h1 class="fs-1 fw-bold text-white ms-5">
<div layout:fragment="content_header">
</div>
</h1>
</div>
<div layout:fragment="content">
</div>
</div>
</body>
<th:block layout:fragment="scripts">
<script>
$(function () {
var location = window.location.href;
var cur_url = '/' + location.split('/').pop();
$('.menu li').each(function () {
var link = $(this).find('a').attr('href');
if (cur_url == link) {
$(this).addClass('current');
}
});
});
</script>
</th:block>
<footer class="d-flex align-items-center fw-bold fs-4 p-2 ps-5">2022 г.
<nav class="d-flex justify-content-center flex-grow-1"><a href="https://vk.com/id0" target="_blank"><img class="icon" src="/vk.jpg" alt="VK" /></a></nav>
<nav class="d-flex justify-content-center flex-grow-1"><a href="https://vk.com/id0" target="_blank"><img
class="icon" src="/vk.jpg" alt="VK"/></a></nav>
</footer>
</html>

View File

@ -5,6 +5,7 @@
<head>
</head>
<body>
<div layout:fragment="content_header" th:text="'Главная'"></div>
<div layout:fragment="content">
<div>It's works!</div>
<a href="123">ERROR</a>

View File

@ -5,9 +5,8 @@
<head>
</head>
<body>
<div layout:fragment="content_header">Создание заказа</div>
<div layout:fragment="content">
<h1 th:if="${id == null}">Создание заказа</h1>
<h1 th:if="${id != null}">Добавление сеансов в заказ</h1>
<div th:text="${errors}" class="margin-bottom alert-danger"></div>
<form action="#" th:action="@{/order/{id}(id=${id})}" th:object="${orderDto}" method="post" th:if="${id == null}">
<div class="mb-3">
@ -29,29 +28,6 @@
</a>
</div>
</form>
<form action="#" th:action="@{/order/{id}(id=${id})}" th:object="${orderSessionDto}" method="post" th:if="${id != null}">
<div class="mb-3">
<label for="session" class="form-label">Сеанс</label>
<select id="session" class="form-select" required="true" th:name="session">
<option th:each="value: ${sessions}"
th:value="${value.id}"
th:text="${value.cinema.name} + ' ' + ${value.timestamp}">
</option>
</select>
</div>
<div class="mb-3" >
<label for="count" class="form-label">Количество</label>
<input type="number" class="form-control" min="1" id="count" th:name="count" th:field="${orderSessionDto.count}" required="true">
</div>
<div class="mb-3">
<button type="submit" class="btn btn-primary button-fixed">
<span>Добавить</span>
</button>
<a class="btn btn-secondary button-fixed" th:href="@{/order}">
Назад
</a>
</div>
</form>
</div>
</body>
</html>

View File

@ -5,8 +5,8 @@
<head>
</head>
<body>
<div layout:fragment="content_header">Заказы</div>
<div layout:fragment="content">
<h1>Заказы</h1>
<div class="d-flex justify-content-end">
<a class="btn btn-success button-fixed"
th:href="@{/order/edit}">

View File

@ -5,8 +5,8 @@
<head>
</head>
<body>
<div layout:fragment="content_header" th:text="'Сеансы заказа ' + ${id}"></div>
<div layout:fragment="content">
<h1 th:text="'Сеансы заказа ' + ${id}"></h1>
<form action="#" th:action="@{/order/{id}(id=${id})}" method="post">
<div class="mb-3">
<label for="session" class="form-label">Сеанс</label>
@ -19,7 +19,8 @@
</div>
<div class="mb-3">
<label for="count" class="form-label">Количество</label>
<input type="number" class="form-control" min="1" id="count" th:name="count" th:field="${orderSessionDto.count}" required="true">
<input type="number" class="form-control" min="1" id="count" th:name="count"
th:field="${orderSessionDto.count}" required="true">
</div>
<div class="mb-3">
<button type="submit" class="btn btn-primary button-fixed">

View File

@ -5,13 +5,14 @@
<head>
</head>
<body>
<div layout:fragment="content_header" th:text="'Сеанс'"></div>
<div layout:fragment="content">
<h1>Сеанс</h1>
<div th:text="${errors}" class="margin-bottom alert-danger"></div>
<form action="#" th:action="@{/session/{id}(id=${id})}" th:object="${sessionDto}" method="post">
<div class="mb-3">
<label for="price" class="form-label">Цена</label>
<input type="number" class="form-control" min="1" step="0.01" id="price" th:field="${sessionDto.price}" required="true">
<input type="number" class="form-control" min="1" step="0.01" id="price" th:field="${sessionDto.price}"
required="true">
</div>
<div class="mb-3" th:if="${id == null}">
<label for="cinemaid" class="form-label">Фильм</label>
@ -23,12 +24,14 @@
</select>
</div>
<div class="mb-3" th:if="${id == null}">
<label for="count" class="form-label">Кол-во сеансов</label>
<input type="number" class="form-control" min="1" id="count" th:field="${sessionDto.maxCount}" required="true">
<label for="count" class="form-label">Количество сеансов</label>
<input type="number" class="form-control" min="1" id="count" th:field="${sessionDto.maxCount}"
required="true">
</div>
<div class="mb-3" th:if="${id == null}">
<label for="date" class="form-label">Дата</label>
<input type="datetime-local" class="form-control" id="date" th:field="${sessionDto.timestamp}" required="true">
<input type="datetime-local" class="form-control" id="date" th:field="${sessionDto.timestamp}"
required="true">
</div>
<div class="mb-3">
<button type="submit" class="btn btn-primary button-fixed">

View File

@ -5,8 +5,8 @@
<head>
</head>
<body>
<div layout:fragment="content_header" th:text="'Сеансы'"></div>
<div layout:fragment="content">
<h1>Сеансы</h1>
<div class="d-flex justify-content-end">
<a class="btn btn-success button-fixed"
th:href="@{/session/edit}">