Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
F
final_exam_lyalya_aldamzharova
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Алдамжарова Ляйла
final_exam_lyalya_aldamzharova
Commits
376b5cdd
Commit
376b5cdd
authored
Nov 06, 2021
by
Алдамжарова Ляйла
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Добавила стили на страницы
parent
9b88f2c9
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
135 additions
and
75 deletions
+135
-75
application.properties
src/main/resources/application.properties
+1
-1
V1004__add_admin.sql
src/main/resources/db/migration/V1004__add_admin.sql
+1
-1
main.css
src/main/resources/static/css/main.css
+38
-1
navbar.ftlh
src/main/resources/templates/navbar.ftlh
+3
-2
add.ftlh
src/main/resources/templates/place/add.ftlh
+1
-2
place.ftlh
src/main/resources/templates/place/place.ftlh
+86
-63
places.ftlh
src/main/resources/templates/place/places.ftlh
+5
-5
No files found.
src/main/resources/application.properties
View file @
376b5cdd
...
...
@@ -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
src/main/resources/db/migration/V1004__add_admin.sql
View file @
376b5cdd
...
...
@@ -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
src/main/resources/static/css/main.css
View file @
376b5cdd
...
...
@@ -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
src/main/resources/templates/navbar.ftlh
View file @
376b5cdd
...
...
@@ -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>
...
...
src/main/resources/templates/place/add.ftlh
View file @
376b5cdd
...
...
@@ -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>
...
...
src/main/resources/templates/place/place.ftlh
View file @
376b5cdd
...
...
@@ -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
src/main/resources/templates/place/places.ftlh
View file @
376b5cdd
...
...
@@ -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>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment