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

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;
......@@ -69,4 +70,40 @@ label{
.item img{
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,72 +32,83 @@
</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>
<#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 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>
</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>
<#if user?? && (user.role == "ADMIN" || user.role == "USER")>
<h3>Добавить отзыв</h3>
<div class="form">
<form action="/${place.id}/review" method="post">
<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">
</div>
<div class="col">
<label for="grade" class="form-label fs-4">Оценка</label>
<select name="grade" id="grade">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
</select>
<hr>
<div class="place">
<div class="part">
<#if user?? && (user.role == "ADMIN" || user.role == "USER")>
<h3>Добавить отзыв</h3>
<div class="form">
<form action="/${place.id}/review" method="post">
<input type='hidden' value='${_csrf.token}' name='${_csrf.parameterName}'/>
<div class="col">
<label for="description" class="form-label fs-4">Комментарий</label>
<textarea type="text" name="description" class="form-control" id="description"></textarea>
</div>
<div class="col">
<label for="grade" class="form-label fs-4">Оценка</label>
<select name="grade" id="grade">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
</select>
</div>
<button type="submit" class="btn btn-primary mt-1" id="btn">Добавить отзыв</button>
</form>
<#if errors??>
<#list errors as e>
<h2>${e.defaultMessage!'__no message__'}</h2>
</#list>
<#elseif nameError??>
<h2>${nameError}</h2>
</#if>
</div>
<button type="submit" class="btn btn-primary mt-1" id="btn">Добавить отзыв</button>
</form>
<#if errors??>
<#list errors as e>
<h2>${e.defaultMessage!'__no message__'}</h2>
</#list>
<#elseif nameError??>
<h2>${nameError}</h2>
</#if>
</div>
</#if>
<#if user?? && (user.role == "ADMIN" || user.role == "USER")>
<h3>Добавить фото</h3>
<div class="form">
<form action="/${place.id}/photo" method="post" enctype="multipart/form-data">
<input type='hidden' value='${_csrf.token}' name='${_csrf.parameterName}'/>
<div class="col">
<label for="file" class="form-label fs-4">Изображение</label>
<input type="file" name="file" class="form-control" id="file">
<hr>
<div class="part">
<#if user?? && (user.role == "ADMIN" || user.role == "USER")>
<h3>Добавить фото</h3>
<div class="form">
<form action="/${place.id}/photo" method="post" enctype="multipart/form-data">
<input type='hidden' value='${_csrf.token}' name='${_csrf.parameterName}'/>
<div class="col">
<label for="file" class="form-label fs-4">Изображение</label>
<input type="file" name="file" class="form-control" id="file">
</div>
<button type="submit" class="btn btn-primary mt-1" id="btn">Добавить фото</button>
</form>
<#if fileError??>
<h2>${fileError}</h2>
</#if>
</div>
<button type="submit" class="btn btn-primary mt-1" id="btn">Добавить фото</button>
</form>
<#if fileError??>
<h2>${fileError}</h2>
</#if>
</div>
</#if>
</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>
......@@ -15,10 +15,10 @@
<img src="/file/${c.placePhoto.filePath}" alt="Изображение">
<p class="info">Наименование ${c.name}</p>
</a>
<p class="info">Создал ${c.user.login}</p>
<p class="info">Рейтинг ${c.rating}</p>
<p class="info">Отзывов ${c.reviews?size}</p>
<p class="info">Фото ${c.photos?size}</p>
<p class="info">Создал ${c.user.login}</p>
<p class="info">Рейтинг ${c.rating}</p>
<p class="info">Отзывов ${c.reviews?size}</p>
<p class="info">Фото ${c.photos?size}</p>
</div>
</#if>
</#list>
......
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