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

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"; return "cinema-edit";
} }
if (id == null || id <= 0) { 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); cinemaService.addCinema(cinemaDto);
} else { } else {
cinemaDto.setId(id); 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); cinemaService.updateCinema(cinemaDto);
} }
return "redirect:/cinema"; return "redirect:/cinema";

View File

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

View File

@ -5,12 +5,6 @@ body {
.green-mark { .green-mark {
background-color: #38a65d; background-color: #38a65d;
} }
.willSee {
background-color: #38a65d;
}
.delete {
background-color: #e94049;
}
.icon { .icon {
width: 50px; width: 50px;
height: 50px; height: 50px;
@ -18,30 +12,10 @@ body {
hr { hr {
height: 2px !important; height: 2px !important;
} }
.description {
color: #8f9398;
}
.editIcon {
height: 2.5vh;
}
.posterChoiceToTaste {
width: 290px;
height: 437px;
}
.posterFilmPage{ .posterFilmPage{
width: 290px; width: 290px;
height: 437px; height: 437px;
} }
a {
text-decoration: none;
}
a:hover {
color: white;
}
.current a {
color: white;
}
/* for film-page */ /* for film-page */
.table { .table {
@ -81,6 +55,10 @@ form input {
max-width: 300px; max-width: 300px;
} }
form select {
max-width: 300px;
}
table tbody tr td { table tbody tr td {
border: 0px !important; border: 0px !important;
} }
@ -101,12 +79,18 @@ header {
header a { header a {
color: #c2c2c2; color: #c2c2c2;
text-decoration: none;
} }
header a:hover { header a:hover {
color: #ffffff; color: white;
text-decoration: none;
} }
.mainInput { a {
max-width: 200px; 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>
</head> </head>
<body> <body>
<div layout:fragment="content_header">Фильм</div>
<div layout:fragment="content"> <div layout:fragment="content">
<h1>Фильм</h1>
<div th:text="${errors}" class="margin-bottom alert-danger"></div> <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"> <div class="mb-3">
<label for="name" class="form-label">Название</label> <label for="name" class="form-label">Название</label>
<input type="text" class="form-control" id="name" th:field="${cinemaDto.name}" required="true"> <input type="text" class="form-control" id="name" th:field="${cinemaDto.name}" required="true">

View File

@ -5,18 +5,20 @@
<head> <head>
</head> </head>
<body> <body>
<div layout:fragment="content_header">Фильмы</div>
<div layout:fragment="content"> <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"> <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}"> th:href="@{/cinema/edit}">
<i class="fa-solid fa-plus"></i> <i class="fa-solid fa-plus"></i>
</a> </a>
</div> </div>
<form action="#" th:action="@{/cinema/search/}"> </div>
<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>
<hr class="border border-0 bg-black"/> <hr class="border border-0 bg-black"/>
<table class="table" id="tbl-items"> <table class="table" id="tbl-items">
<tbody> <tbody>
@ -24,15 +26,17 @@
<td> <td>
<img class="posterItem me-3" th:src="${cinema.image}" alt="${cinema.name}" align="left"/> <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="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"> <div class="pt-3 d-flex flex-column justify-content-start align-items-center mb-3 fs-6 fw-bold">
<p class="text-start description"> <p class="text-start">
<a class="text-white fs-5 fw-bold pt-3" th:text="${cinema.name}"></a> <a class="text-white fs-5 fw-bold pt-3" th:text="${cinema.name}" href=""></a>
</p> </p>
</div> </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 class="rounded p-1 mx-2 green-mark">9.2</div>
<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> <i class="fa fa-pencil"></i>
</a> </a>
<a type="button" class="m-1 btn btn-danger" <a type="button" class="m-1 btn btn-danger"

View File

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

View File

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

View File

@ -8,7 +8,6 @@
<meta name="viewport" content="width=device-width, initial-scale=1"/> <meta name="viewport" content="width=device-width, initial-scale=1"/>
<link rel="icon" href="/favicon.svg"> <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/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/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="/webjars/font-awesome/6.1.0/css/all.min.css"/>
<link rel="stylesheet" href="/css/style.css"/> <link rel="stylesheet" href="/css/style.css"/>
@ -40,29 +39,19 @@
</header> </header>
<div class="container rounded my-5 p-4 content"> <div class="container rounded my-5 p-4 content">
<div class="content_header rounded-top p-2 mb-2"> <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>
<div layout:fragment="content"> <div layout:fragment="content">
</div> </div>
</div> </div>
</body> </body>
<th:block layout:fragment="scripts"> <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> </th:block>
<footer class="d-flex align-items-center fw-bold fs-4 p-2 ps-5">2022 г. <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> </footer>
</html> </html>

View File

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

View File

@ -5,9 +5,8 @@
<head> <head>
</head> </head>
<body> <body>
<div layout:fragment="content_header">Создание заказа</div>
<div layout:fragment="content"> <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> <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}"> <form action="#" th:action="@{/order/{id}(id=${id})}" th:object="${orderDto}" method="post" th:if="${id == null}">
<div class="mb-3"> <div class="mb-3">
@ -29,29 +28,6 @@
</a> </a>
</div> </div>
</form> </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> </div>
</body> </body>
</html> </html>

View File

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

View File

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

View File

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

View File

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