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
Show 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 {
return
"redirect:/"
+
id
;
}
@PreAuthorize
(
"hasAuthority('ADMIN')"
)
@PostMapping
(
"/{id}/review/{reviewId}"
)
// @PreAuthorize("hasAuthority('ADMIN')")
public
String
deleteReview
(
@PathVariable
Integer
id
,
@PathVariable
Integer
reviewId
){
reviewService
.
delete
(
reviewId
,
id
);
return
"redirect:/"
+
id
;
}
@PreAuthorize
(
"hasAuthority('ADMIN')"
)
@PostMapping
(
"/{id}/photo/{photoId}"
)
// @PreAuthorize("hasAuthority('ADMIN')")
public
String
deletePhoto
(
@PathVariable
Integer
id
,
@PathVariable
Integer
photoId
){
placePhotoService
.
delete
(
photoId
);
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.password
=
12345
server.port
=
8002
...
...
src/main/resources/static/css/main.css
View file @
21fcd929
...
...
@@ -98,12 +98,27 @@ label{
border
:
1px
grey
solid
;
}
.btn
{
background-color
:
cadetblue
;
background-color
:
#498388
;
padding
:
7px
;
display
:
inline-block
;
border
:
black
;
color
:
darkslategrey
;
}
.btn-danger
{
background-color
:
darkred
;
padding
:
7px
;
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 @@
<img src="/images/403.png" alt="Ошибка" class="error-img">
<h2>Вы пытаетесь выполнить действие с ограниченным доступом</h2>
<a href="/login">Перейти к аутентификации</a>
<a
class="btn"
href="/login">Перейти к аутентификации</a>
</div>
</@main.renderWith>
\ No newline at end of file
src/main/resources/templates/error/404.ftlh
View file @
21fcd929
...
...
@@ -6,6 +6,6 @@
<img src="/images/404.png" alt="Ошибка" class="error-img">
<h2>Здесь ничего нет, предлагаем перейти на главную страницу</h2>
<a href="/">Главная страница</a>
<a
class="btn"
href="/">Главная страница</a>
</div>
</@main.renderWith>
\ No newline at end of file
src/main/resources/templates/navbar.ftlh
View file @
21fcd929
...
...
@@ -5,25 +5,25 @@
<div class="navbar flex-between">
<div class="flex">
<div class="nav-item">
<a href="/">Заведения</a>
<a href="/"
class="btn"
>Заведения</a>
</div>
<#if user??>
<div class="nav-item">
<a href="/add">Добавить завeдение</a>
<a href="/add"
class="btn"
>Добавить завeдение</a>
</div>
</#if>
</div>
<div class="flex">
<#if !(user??)>
<div class="nav-item">
<a class="
nav-link
" href="/login">Вход</a>
<a class="
btn
" href="/login">Вход</a>
</div>
<div class="nav-item">
<a class="
nav-link"
href="/register">Регистрация</a>
<a class="
btn"
href="/register">Регистрация</a>
</div>
<#else>
<div class="nav-item">
<a href="/cabinet">Привет, ${user.login}</a>
<a
class="btn"
href="/cabinet">Привет, ${user.login}</a>
</div>
</div>
<div class="nav-item">
...
...
src/main/resources/templates/place/place.ftlh
View file @
21fcd929
<#import "../main.ftlh" as main>
<@main.renderWith title="Заведени
я
">
<@main.renderWith title="Заведени
e ${place.name}
">
<h1>Заведение ${place.name}</h1>
<div class="place">
<div class="part">
...
...
@@ -24,6 +24,7 @@
<h2 class="info">Галерея: </h2>
<div class="gallery">
<#list place.photos as c>
<div>
<img src="/file/${c.filePath}" alt="Изображение">
<#if user?? && user.role == "ADMIN">
<form action="/${place.id}/photo/${c.id}">
...
...
@@ -31,6 +32,7 @@
<button type="submit" class="btn btn-danger">X</button>
</form>
</#if>
</div>
</#list>
</div>
<hr>
...
...
src/main/resources/templates/place/places.ftlh
View file @
21fcd929
...
...
@@ -6,8 +6,9 @@
<input type="text" name="search" placeholder="поиск">
<button type="submit" class="btn btn-primary">Искать</button>
</form>
<div class="items">
<#if places?? && places?size != 0>
<div class="items">
<#list places as c>
<#if !c.isDel()>
<div class="item">
...
...
@@ -24,12 +25,14 @@
</#list>
</div>
<#include "../pagination.ftlh">
<div>
<
/
div>
<#else>
<p>Заведений нет</p>
<a href="/add">Добавить заведение</a>
<div class="center">
<h1>Заведений нет</h1>
<a href="/add" class="btn btn-primary" >Добавить заведение</a>
</div>
</#if>
</div>
</@main.renderWith>
\ No newline at end of file
src/main/resources/templates/user/cabinet.ftlh
View file @
21fcd929
...
...
@@ -8,7 +8,9 @@
<p class="info">Email: ${user.email}</p>
<p class="info">Добавленные заведения:</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>
</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