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
21fcd929
Commit
21fcd929
authored
Nov 06, 2021
by
Алдамжарова Ляйла
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Добавила стили
parent
376b5cdd
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
48 additions
and
26 deletions
+48
-26
PlaceController.java
.../com/example/final_exam_l/controller/PlaceController.java
+2
-2
application.properties
src/main/resources/application.properties
+1
-1
main.css
src/main/resources/static/css/main.css
+16
-1
403.ftlh
src/main/resources/templates/error/403.ftlh
+1
-1
404.ftlh
src/main/resources/templates/error/404.ftlh
+1
-1
navbar.ftlh
src/main/resources/templates/navbar.ftlh
+5
-5
place.ftlh
src/main/resources/templates/place/place.ftlh
+10
-8
places.ftlh
src/main/resources/templates/place/places.ftlh
+9
-6
cabinet.ftlh
src/main/resources/templates/user/cabinet.ftlh
+3
-1
No files found.
src/main/java/com/example/final_exam_l/controller/PlaceController.java
View file @
21fcd929
...
@@ -124,15 +124,15 @@ public class PlaceController {
...
@@ -124,15 +124,15 @@ public class PlaceController {
return
"redirect:/"
+
id
;
return
"redirect:/"
+
id
;
}
}
@PreAuthorize
(
"hasAuthority('ADMIN')"
)
@PostMapping
(
"/{id}/review/{reviewId}"
)
@PostMapping
(
"/{id}/review/{reviewId}"
)
// @PreAuthorize("hasAuthority('ADMIN')")
public
String
deleteReview
(
@PathVariable
Integer
id
,
@PathVariable
Integer
reviewId
){
public
String
deleteReview
(
@PathVariable
Integer
id
,
@PathVariable
Integer
reviewId
){
reviewService
.
delete
(
reviewId
,
id
);
reviewService
.
delete
(
reviewId
,
id
);
return
"redirect:/"
+
id
;
return
"redirect:/"
+
id
;
}
}
@PreAuthorize
(
"hasAuthority('ADMIN')"
)
@PostMapping
(
"/{id}/photo/{photoId}"
)
@PostMapping
(
"/{id}/photo/{photoId}"
)
// @PreAuthorize("hasAuthority('ADMIN')")
public
String
deletePhoto
(
@PathVariable
Integer
id
,
@PathVariable
Integer
photoId
){
public
String
deletePhoto
(
@PathVariable
Integer
id
,
@PathVariable
Integer
photoId
){
placePhotoService
.
delete
(
photoId
);
placePhotoService
.
delete
(
photoId
);
return
"redirect:/"
+
id
;
return
"redirect:/"
+
id
;
...
...
src/main/resources/application.properties
View file @
21fcd929
spring.datasource.url
=
jdbc:mysql://localhost:3306/final_exam
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
...
...
src/main/resources/static/css/main.css
View file @
21fcd929
...
@@ -98,12 +98,27 @@ label{
...
@@ -98,12 +98,27 @@ label{
border
:
1px
grey
solid
;
border
:
1px
grey
solid
;
}
}
.btn
{
.btn
{
background-color
:
cadetblue
;
background-color
:
#498388
;
padding
:
7px
;
padding
:
7px
;
display
:
inline-block
;
display
:
inline-block
;
border
:
black
;
color
:
darkslategrey
;
}
}
.btn-danger
{
.btn-danger
{
background-color
:
darkred
;
background-color
:
darkred
;
padding
:
7px
;
padding
:
7px
;
display
:
inline-block
;
display
:
inline-block
;
}
.center
{
text-align
:
center
;
}
h1
,
h2
,
h3
,
h4
{
color
:
darkred
;
}
hr
{
background-color
:
black
;
/*border: black;*/
}
.gallery
div
{
margin-right
:
5px
;
}
}
\ No newline at end of file
src/main/resources/templates/error/403.ftlh
View file @
21fcd929
...
@@ -6,6 +6,6 @@
...
@@ -6,6 +6,6 @@
<img src="/images/403.png" alt="Ошибка" class="error-img">
<img src="/images/403.png" alt="Ошибка" class="error-img">
<h2>Вы пытаетесь выполнить действие с ограниченным доступом</h2>
<h2>Вы пытаетесь выполнить действие с ограниченным доступом</h2>
<a href="/login">Перейти к аутентификации</a>
<a
class="btn"
href="/login">Перейти к аутентификации</a>
</div>
</div>
</@main.renderWith>
</@main.renderWith>
\ No newline at end of file
src/main/resources/templates/error/404.ftlh
View file @
21fcd929
...
@@ -6,6 +6,6 @@
...
@@ -6,6 +6,6 @@
<img src="/images/404.png" alt="Ошибка" class="error-img">
<img src="/images/404.png" alt="Ошибка" class="error-img">
<h2>Здесь ничего нет, предлагаем перейти на главную страницу</h2>
<h2>Здесь ничего нет, предлагаем перейти на главную страницу</h2>
<a href="/">Главная страница</a>
<a
class="btn"
href="/">Главная страница</a>
</div>
</div>
</@main.renderWith>
</@main.renderWith>
\ No newline at end of file
src/main/resources/templates/navbar.ftlh
View file @
21fcd929
...
@@ -5,25 +5,25 @@
...
@@ -5,25 +5,25 @@
<div class="navbar flex-between">
<div class="navbar flex-between">
<div class="flex">
<div class="flex">
<div class="nav-item">
<div class="nav-item">
<a href="/">Заведения</a>
<a href="/"
class="btn"
>Заведения</a>
</div>
</div>
<#if user??>
<#if user??>
<div class="nav-item">
<div class="nav-item">
<a href="/add">Добавить завeдение</a>
<a href="/add"
class="btn"
>Добавить завeдение</a>
</div>
</div>
</#if>
</#if>
</div>
</div>
<div class="flex">
<div class="flex">
<#if !(user??)>
<#if !(user??)>
<div class="nav-item">
<div class="nav-item">
<a class="
nav-link
" href="/login">Вход</a>
<a class="
btn
" href="/login">Вход</a>
</div>
</div>
<div class="nav-item">
<div class="nav-item">
<a class="
nav-link"
href="/register">Регистрация</a>
<a class="
btn"
href="/register">Регистрация</a>
</div>
</div>
<#else>
<#else>
<div class="nav-item">
<div class="nav-item">
<a href="/cabinet">Привет, ${user.login}</a>
<a
class="btn"
href="/cabinet">Привет, ${user.login}</a>
</div>
</div>
</div>
</div>
<div class="nav-item">
<div class="nav-item">
...
...
src/main/resources/templates/place/place.ftlh
View file @
21fcd929
<#import "../main.ftlh" as main>
<#import "../main.ftlh" as main>
<@main.renderWith title="Заведени
я
">
<@main.renderWith title="Заведени
e ${place.name}
">
<h1>Заведение ${place.name}</h1>
<h1>Заведение ${place.name}</h1>
<div class="place">
<div class="place">
<div class="part">
<div class="part">
...
@@ -24,13 +24,15 @@
...
@@ -24,13 +24,15 @@
<h2 class="info">Галерея: </h2>
<h2 class="info">Галерея: </h2>
<div class="gallery">
<div class="gallery">
<#list place.photos as c>
<#list place.photos as c>
<img src="/file/${c.filePath}" alt="Изображение">
<div>
<#if user?? && user.role == "ADMIN">
<img src="/file/${c.filePath}" alt="Изображение">
<form action="/${place.id}/photo/${c.id}">
<#if user?? && user.role == "ADMIN">
<input type='hidden' value='${_csrf.token}' name='${_csrf.parameterName}'/>
<form action="/${place.id}/photo/${c.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>
</div>
</div>
<hr>
<hr>
...
...
src/main/resources/templates/place/places.ftlh
View file @
21fcd929
...
@@ -6,8 +6,9 @@
...
@@ -6,8 +6,9 @@
<input type="text" name="search" placeholder="поиск">
<input type="text" name="search" placeholder="поиск">
<button type="submit" class="btn btn-primary">Искать</button>
<button type="submit" class="btn btn-primary">Искать</button>
</form>
</form>
<div class="items">
<#if places?? && places?size != 0>
<#if places?? && places?size != 0>
<div class="items">
<#list places as c>
<#list places as c>
<#if !c.isDel()>
<#if !c.isDel()>
<div class="item">
<div class="item">
...
@@ -24,12 +25,14 @@
...
@@ -24,12 +25,14 @@
</#list>
</#list>
</div>
</div>
<#include "../pagination.ftlh">
<#include "../pagination.ftlh">
<div>
<
/
div>
<#else>
<#else>
<p>Заведений нет</p>
<div class="center">
<a href="/add">Добавить заведение</a>
<h1>Заведений нет</h1>
<a href="/add" class="btn btn-primary" >Добавить заведение</a>
</div>
</#if>
</#if>
</div>
</@main.renderWith>
</@main.renderWith>
\ No newline at end of file
src/main/resources/templates/user/cabinet.ftlh
View file @
21fcd929
...
@@ -8,7 +8,9 @@
...
@@ -8,7 +8,9 @@
<p class="info">Email: ${user.email}</p>
<p class="info">Email: ${user.email}</p>
<p class="info">Добавленные заведения:</p>
<p class="info">Добавленные заведения:</p>
<#list user.places as p>
<#list user.places as p>
<a href="/places/${p.id}">${p.name}</a>
<#if !p.isDel()>
<a class="btn" href="/${p.id}">${p.name}</a>
</#if>
</#list>
</#list>
</div>
</div>
</div>
</div>
...
...
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