Добавила стили на страницы

parent 9b88f2c9
......@@ -2,4 +2,4 @@ spring.datasource.url= jdbc:mysql://localhost:3306/final_exam
spring.datasource.username=root
spring.datasource.password=12345
server.port=8002
spring.data.web.pageable.default-page-size=3
spring.data.web.pageable.default-page-size=12
......@@ -2,4 +2,4 @@ use `final_exam`;
insert into `users` (login, email, password, role) VALUES
#пароль Admin123
('admin', 'admin@test.com', '$2a$10$lOwhRkS64B3sbYsXnpMLPu.ua0FUR3Yz3omdWU..V8Aqp2xzTBKqi', 'ADMIN');
\ No newline at end of file
('admin', 'admin@test.com', '$2a$10$mORwtK4znSqLoEgIlxYFpOFQrSkkgbUO20tUeiyiEiVOFWkVsMgYS', 'ADMIN');
\ No newline at end of file
......@@ -40,7 +40,8 @@ a{
display: flex;
margin: 0 auto;
align-items: center;
justify-content: center
justify-content: center;
border: 1px solid darkred;
}
label{
display: block;
......@@ -70,3 +71,39 @@ label{
width: 70%;
height: 70%;
}
.place{
display: flex;
justify-content: space-between;
align-items: center;
}
.part img{
width: 400px;
}
.part{
max-width: 500px;
max-height: 500px;
}
.gallery{
display: flex;
}
.gallery img{
max-width: 200px;
max-height: 200px;
}
.reviews{
display: flex;
flex-direction: column;
}
.review{
border: 1px grey solid;
}
.btn{
background-color: cadetblue;
padding: 7px;
display: inline-block;
}
.btn-danger{
background-color: darkred;
padding: 7px;
display: inline-block;
}
\ No newline at end of file
......@@ -23,12 +23,13 @@
</div>
<#else>
<div class="nav-item">
<span>${user.email}</span>
<a href="/cabinet">Привет, ${user.login}</a>
</div>
</div>
<div class="nav-item">
<form action="/logout" method="post">
<input type='hidden' value='${_csrf.token}' name='${_csrf.parameterName}'/>
<button type="submit" class="btn nav-link">Выход</button>
<button type="submit" class="btn btn-danger">Выход</button>
</form>
</div>
</#if>
......
......@@ -21,8 +21,7 @@
<input type="file" name="file" class="form-control" id="file">
</div>
<button type="submit" class="btn btn-primary mt-1" id="btn">Добавить</button>
<button type="submit" class="btn btn-primary" id="btn">Добавить</button>
</form>
</div>
</div>
......
......@@ -2,15 +2,27 @@
<@main.renderWith title="Заведения">
<h1>Заведение ${place.name}</h1>
<div class="item">
<a href="/${place.id}">
<img src="/file/${place.placePhoto.filePath}" alt="Изображение">
<div class="place">
<div class="part">
<p class="info">Наименование ${place.name}</p>
<p class="info">Создал ${place.user.login}</p>
<p class="info">Рейтинг ${place.rating}</p>
<p class="info">Отзывов ${place.reviews?size}</p>
<p class="info">Галерея: </p>
<#if user?? && user.role == "ADMIN">
<form action="/${place.id}/delete" method="post">
<input type='hidden' value='${_csrf.token}' name='${_csrf.parameterName}'/>
<button type="submit" class="btn btn-danger">Удалить заведение</button>
</form>
</#if>
</div>
<div class="part">
<img src="/file/${place.placePhoto.filePath}" alt="Изображение">
</div>
</div>
<hr>
<div>
<h2 class="info">Галерея: </h2>
<div class="gallery">
<#list place.photos as c>
<img src="/file/${c.filePath}" alt="Изображение">
<#if user?? && user.role == "ADMIN">
......@@ -20,28 +32,31 @@
</form>
</#if>
</#list>
</div>
<hr>
<h4>Отзывы</h4>
<h2>Отзывы</h2>
<div class="reviews">
<#list place.reviews as r>
<p>${r.description}</p>
<p>${r.user.login}</p>
<p>${r.grade}</p>
<p>${r.date}</p>
<div class="review">
<p>${r.user.login} ${r.date} написала: <br>
<span>${r.description}</span>
</p>
<p>Оценка: ${r.grade}</p>
<#if user?? && user.role == "ADMIN">
<form action="/${place.id}/review/${r.id}">
<input type='hidden' value='${_csrf.token}' name='${_csrf.parameterName}'/>
<button type="submit" class="btn btn-danger">X</button>
</form>
</#if>
</div>
</#list>
</a>
</div>
<#if user?? && user.role == "ADMIN">
<form action="/${place.id}/delete" method="post">
<input type='hidden' value='${_csrf.token}' name='${_csrf.parameterName}'/>
<button type="submit" class="btn btn-danger">Удалить заведение</button>
</form>
</#if>
</div>
<hr>
<div class="place">
<div class="part">
<#if user?? && (user.role == "ADMIN" || user.role == "USER")>
<h3>Добавить отзыв</h3>
<div class="form">
......@@ -49,7 +64,7 @@
<input type='hidden' value='${_csrf.token}' name='${_csrf.parameterName}'/>
<div class="col">
<label for="description" class="form-label fs-4">Комментарий</label>
<input type="text" name="description" class="form-control" id="description">
<textarea type="text" name="description" class="form-control" id="description"></textarea>
</div>
<div class="col">
<label for="grade" class="form-label fs-4">Оценка</label>
......@@ -72,6 +87,9 @@
</#if>
</div>
</#if>
</div>
<hr>
<div class="part">
<#if user?? && (user.role == "ADMIN" || user.role == "USER")>
<h3>Добавить фото</h3>
<div class="form">
......@@ -88,4 +106,9 @@
</#if>
</div>
</#if>
</div>
</div>
</@main.renderWith>
\ No newline at end of file
......@@ -4,7 +4,7 @@
<h1>Заведения</h1>
<form action="/">
<input type="text" name="search" placeholder="поиск">
<button type="submit">Искать</button>
<button type="submit" class="btn btn-primary">Искать</button>
</form>
<div class="items">
<#if places?? && places?size != 0>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment