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
...
@@ -2,4 +2,4 @@ spring.datasource.url= jdbc:mysql://localhost:3306/final_exam
spring.datasource.username
=
root
spring.datasource.username
=
root
spring.datasource.password
=
12345
spring.datasource.password
=
12345
server.port
=
8002
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`;
...
@@ -2,4 +2,4 @@ use `final_exam`;
insert
into
`users`
(
login
,
email
,
password
,
role
)
VALUES
insert
into
`users`
(
login
,
email
,
password
,
role
)
VALUES
#
пароль
Admin123
#
пароль
Admin123
(
'admin'
,
'admin@test.com'
,
'$2a$10$lOwhRkS64B3sbYsXnpMLPu.ua0FUR3Yz3omdWU..V8Aqp2xzTBKqi'
,
'ADMIN'
);
(
'admin'
,
'admin@test.com'
,
'$2a$10$mORwtK4znSqLoEgIlxYFpOFQrSkkgbUO20tUeiyiEiVOFWkVsMgYS'
,
'ADMIN'
);
\ No newline at end of file
\ No newline at end of file
src/main/resources/static/css/main.css
View file @
376b5cdd
...
@@ -40,7 +40,8 @@ a{
...
@@ -40,7 +40,8 @@ a{
display
:
flex
;
display
:
flex
;
margin
:
0
auto
;
margin
:
0
auto
;
align-items
:
center
;
align-items
:
center
;
justify-content
:
center
justify-content
:
center
;
border
:
1px
solid
darkred
;
}
}
label
{
label
{
display
:
block
;
display
:
block
;
...
@@ -69,4 +70,40 @@ label{
...
@@ -69,4 +70,40 @@ label{
.item
img
{
.item
img
{
width
:
70%
;
width
:
70%
;
height
:
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 @@
...
@@ -23,12 +23,13 @@
</div>
</div>
<#else>
<#else>
<div class="nav-item">
<div class="nav-item">
<
span>${user.email}</span
>
<
a href="/cabinet">Привет, ${user.login}</a
>
</div>
</div>
</div>
<div class="nav-item">
<div class="nav-item">
<form action="/logout" method="post">
<form action="/logout" method="post">
<input type='hidden' value='${_csrf.token}' name='${_csrf.parameterName}'/>
<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>
</form>
</div>
</div>
</#if>
</#if>
...
...
src/main/resources/templates/place/add.ftlh
View file @
376b5cdd
...
@@ -21,8 +21,7 @@
...
@@ -21,8 +21,7 @@
<input type="file" name="file" class="form-control" id="file">
<input type="file" name="file" class="form-control" id="file">
</div>
</div>
<button type="submit" class="btn btn-primary" id="btn">Добавить</button>
<button type="submit" class="btn btn-primary mt-1" id="btn">Добавить</button>
</form>
</form>
</div>
</div>
</div>
</div>
...
...
src/main/resources/templates/place/place.ftlh
View file @
376b5cdd
...
@@ -2,15 +2,27 @@
...
@@ -2,15 +2,27 @@
<@main.renderWith title="Заведения">
<@main.renderWith title="Заведения">
<h1>Заведение ${place.name}</h1>
<h1>Заведение ${place.name}</h1>
<div class="place">
<div class="item">
<div class="part">
<a href="/${place.id}">
<img src="/file/${place.placePhoto.filePath}" alt="Изображение">
<p class="info">Наименование ${place.name}</p>
<p class="info">Наименование ${place.name}</p>
<p class="info">Создал ${place.user.login}</p>
<p class="info">Создал ${place.user.login}</p>
<p class="info">Рейтинг ${place.rating}</p>
<p class="info">Рейтинг ${place.rating}</p>
<p class="info">Отзывов ${place.reviews?size}</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>
<#list place.photos as c>
<img src="/file/${c.filePath}" alt="Изображение">
<img src="/file/${c.filePath}" alt="Изображение">
<#if user?? && user.role == "ADMIN">
<#if user?? && user.role == "ADMIN">
...
@@ -20,72 +32,83 @@
...
@@ -20,72 +32,83 @@
</form>
</form>
</#if>
</#if>
</#list>
</#list>
</div>
<hr>
<h4>Отзывы</h4>
<h2>Отзывы</h2>
<div class="reviews">
<#list place.reviews as r>
<#list place.reviews as r>
<p>${r.description}</p>
<div class="review">
<p>${r.user.login}</p>
<p>${r.user.login} ${r.date} написала: <br>
<p>${r.grade}</p>
<span>${r.description}</span>
<p>${r.date}</p>
</p>
<#if user?? && user.role == "ADMIN">
<p>Оценка: ${r.grade}</p>
<form action="/${place.id}/review/${r.id}">
<#if user?? && user.role == "ADMIN">
<input type='hidden' value='${_csrf.token}' name='${_csrf.parameterName}'/>
<form action="/${place.id}/review/${r.id}">
<button type="submit" class="btn btn-danger">X</button>
<input type='hidden' value='${_csrf.token}' name='${_csrf.parameterName}'/>
</form>
<button type="submit" class="btn btn-danger">X</button>
</#if>
</form>
</#if>
</div>
</#list>
</#list>
</a>
</div>
</div>
</div>
<#if user?? && user.role == "ADMIN">
<hr>
<form action="/${place.id}/delete" method="post">
<div class="place">
<input type='hidden' value='${_csrf.token}' name='${_csrf.parameterName}'/>
<div class="part">
<button type="submit" class="btn btn-danger">Удалить заведение</button>
<#if user?? && (user.role == "ADMIN" || user.role == "USER")>
</form>
<h3>Добавить отзыв</h3>
</#if>
<div class="form">
<#if user?? && (user.role == "ADMIN" || user.role == "USER")>
<form action="/${place.id}/review" method="post">
<h3>Добавить отзыв</h3>
<input type='hidden' value='${_csrf.token}' name='${_csrf.parameterName}'/>
<div class="form">
<div class="col">
<form action="/${place.id}/review" method="post">
<label for="description" class="form-label fs-4">Комментарий</label>
<input type='hidden' value='${_csrf.token}' name='${_csrf.parameterName}'/>
<textarea type="text" name="description" class="form-control" id="description"></textarea>
<div class="col">
</div>
<label for="description" class="form-label fs-4">Комментарий</label>
<div class="col">
<input type="text" name="description" class="form-control" id="description">
<label for="grade" class="form-label fs-4">Оценка</label>
</div>
<select name="grade" id="grade">
<div class="col">
<option value="1">1</option>
<label for="grade" class="form-label fs-4">Оценка</label>
<option value="2">2</option>
<select name="grade" id="grade">
<option value="3">3</option>
<option value="1">1</option>
<option value="4">4</option>
<option value="2">2</option>
<option value="5">5</option>
<option value="3">3</option>
</select>
<option value="4">4</option>
</div>
<option value="5">5</option>
<button type="submit" class="btn btn-primary mt-1" id="btn">Добавить отзыв</button>
</select>
</form>
<#if errors??>
<#list errors as e>
<h2>${e.defaultMessage!'__no message__'}</h2>
</#list>
<#elseif nameError??>
<h2>${nameError}</h2>
</#if>
</div>
</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>
</#if>
</div>
</div>
</#if>
<hr>
<#if user?? && (user.role == "ADMIN" || user.role == "USER")>
<div class="part">
<h3>Добавить фото</h3>
<#if user?? && (user.role == "ADMIN" || user.role == "USER")>
<div class="form">
<h3>Добавить фото</h3>
<form action="/${place.id}/photo" method="post" enctype="multipart/form-data">
<div class="form">
<input type='hidden' value='${_csrf.token}' name='${_csrf.parameterName}'/>
<form action="/${place.id}/photo" method="post" enctype="multipart/form-data">
<div class="col">
<input type='hidden' value='${_csrf.token}' name='${_csrf.parameterName}'/>
<label for="file" class="form-label fs-4">Изображение</label>
<div class="col">
<input type="file" name="file" class="form-control" id="file">
<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>
</div>
<button type="submit" class="btn btn-primary mt-1" id="btn">Добавить фото</button>
</form>
<#if fileError??>
<h2>${fileError}</h2>
</#if>
</#if>
</div>
</div>
</#if>
</div>
</@main.renderWith>
</@main.renderWith>
\ No newline at end of file
src/main/resources/templates/place/places.ftlh
View file @
376b5cdd
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
<h1>Заведения</h1>
<h1>Заведения</h1>
<form action="/">
<form action="/">
<input type="text" name="search" placeholder="поиск">
<input type="text" name="search" placeholder="поиск">
<button type="submit">Искать</button>
<button type="submit"
class="btn btn-primary"
>Искать</button>
</form>
</form>
<div class="items">
<div class="items">
<#if places?? && places?size != 0>
<#if places?? && places?size != 0>
...
@@ -15,10 +15,10 @@
...
@@ -15,10 +15,10 @@
<img src="/file/${c.placePhoto.filePath}" alt="Изображение">
<img src="/file/${c.placePhoto.filePath}" alt="Изображение">
<p class="info">Наименование ${c.name}</p>
<p class="info">Наименование ${c.name}</p>
</a>
</a>
<p class="info">Создал ${c.user.login}</p>
<p class="info">Создал ${c.user.login}</p>
<p class="info">Рейтинг ${c.rating}</p>
<p class="info">Рейтинг ${c.rating}</p>
<p class="info">Отзывов ${c.reviews?size}</p>
<p class="info">Отзывов ${c.reviews?size}</p>
<p class="info">Фото ${c.photos?size}</p>
<p class="info">Фото ${c.photos?size}</p>
</div>
</div>
</#if>
</#if>
</#list>
</#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