Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
SkuciSe
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tim 2 - 2022
SkuciSe
Commits
9cf212aa
Commit
9cf212aa
authored
Sep 03, 2022
by
Milovan Samardzic
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
IzmenaProfilaUpdate
parent
8f6bc11a
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
414 additions
and
25 deletions
+414
-25
SkuciSe/src/main/java/com/example/SkuciSe/controller/AdminController.java
+25
-1
SkuciSe/src/main/java/com/example/SkuciSe/repository/KorisnikRepository.java
+21
-3
SkuciSe/src/main/resources/static/css/style.css
+2
-0
SkuciSe/src/main/resources/templates/index.html
+19
-9
SkuciSe/src/main/resources/templates/listaProfilaAdmin.html
+164
-0
SkuciSe/src/main/resources/templates/listaProfilaAdminDelete.html
+170
-0
SkuciSe/src/main/resources/templates/profile.html
+11
-10
SkuciSe/src/main/resources/templates/register.html
+2
-2
No files found.
SkuciSe/src/main/java/com/example/SkuciSe/controller/AdminController.java
View file @
9cf212aa
package
com
.
example
.
SkuciSe
.
controller
;
import
com.example.SkuciSe.model.korisnik.Korisnik
;
import
com.example.SkuciSe.model.korisnik.KorisnikDetails
;
import
com.example.SkuciSe.repository.KorisnikRepository
;
import
com.example.SkuciSe.repository.LokacijaRepository
;
...
...
@@ -8,6 +9,12 @@ import org.springframework.security.core.annotation.AuthenticationPrincipal;
import
org.springframework.stereotype.Controller
;
import
org.springframework.ui.Model
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Objects
;
@Controller
public
class
AdminController
...
...
@@ -26,6 +33,23 @@ public class AdminController
}
model
.
addAttribute
(
"korisnici"
,
kRepo
.
findAll
());
model
.
addAttribute
(
"loggedUser"
,
loggedUser
);
return
"/lista-korisnika"
;
List
<
String
>
list
=
new
ArrayList
<
String
>();
for
(
Korisnik
k:
kRepo
.
findAll
())
{
list
.
add
(
kRepo
.
findCity
(
k
.
getGradId
()));
}
model
.
addAttribute
(
"gradovi"
,
list
);
return
"listaProfilaAdmin"
;
}
@PostMapping
(
"/delete-user/{id}"
)
public
String
deleteUser
(
@PathVariable
(
"id"
)
Integer
id
,
@AuthenticationPrincipal
KorisnikDetails
loggedUser
,
Model
model
){
kRepo
.
deleteUser
(
id
);
List
<
String
>
list
=
new
ArrayList
<
String
>();
for
(
Korisnik
k:
kRepo
.
findAll
())
{
list
.
add
(
kRepo
.
findCity
(
k
.
getGradId
()));
}
model
.
addAttribute
(
"korisnici"
,
kRepo
.
findAll
());
model
.
addAttribute
(
"loggedUser"
,
loggedUser
);
model
.
addAttribute
(
"gradovi"
,
list
);
return
"listaProfilaAdminDelete"
;
}
}
SkuciSe/src/main/java/com/example/SkuciSe/repository/KorisnikRepository.java
View file @
9cf212aa
...
...
@@ -21,9 +21,7 @@ public class KorisnikRepository
public
void
insert
(
Korisnik
korisnik
,
MultipartFile
multipartFile
)
throws
IOException
{
String
slika
=
Base64
.
getEncoder
().
encodeToString
(
multipartFile
.
getBytes
());
System
.
out
.
println
(
slika
);
String
sql
=
"insert into korisnik( ime, prezime, telefon, email, sifra, tipId, slika, gradid) values('"
+
korisnik
.
getIme
()+
"','"
+
korisnik
.
getPrezime
()+
"','"
+
korisnik
.
getTelefon
()+
"','"
+
korisnik
.
getEmail
()+
"','"
+
new
BCryptPasswordEncoder
().
encode
(
korisnik
.
getSifra
())+
"',1, '"
+
slika
+
"', "
+
korisnik
.
getGradId
()+
")"
;
System
.
out
.
println
(
sql
);
try
{
dataBase
.
statement
.
executeUpdate
(
sql
);
}
catch
(
SQLException
e
)
{
...
...
@@ -113,7 +111,7 @@ public class KorisnikRepository
public
List
<
Korisnik
>
findAll
()
{
String
sql
=
"select * from korisnik"
;
String
sql
=
"select * from korisnik
where TipID = 1
"
;
List
<
Korisnik
>
list
=
new
ArrayList
<
Korisnik
>();
ResultSet
rs
=
null
;
try
{
...
...
@@ -127,4 +125,24 @@ public class KorisnikRepository
throw
new
RuntimeException
(
e
);
}
}
public
String
findCity
(
Integer
id
){
String
sql
=
"select Naziv from lokacija where LokacijaID = "
+
id
;
ResultSet
rs
=
null
;
try
{
rs
=
dataBase
.
statement
.
executeQuery
(
sql
);
if
(
rs
.
next
())
return
rs
.
getString
(
"Naziv"
);
}
catch
(
SQLException
e
)
{
throw
new
RuntimeException
(
e
);
}
return
"Nema grada"
;
}
public
void
deleteUser
(
Integer
id
){
String
sql
=
"delete from korisnik where KorisnikId = "
+
id
;
try
{
dataBase
.
statement
.
execute
(
sql
);
}
catch
(
SQLException
e
)
{
throw
new
RuntimeException
(
e
);
}
}
}
SkuciSe/src/main/resources/static/css/style.css
View file @
9cf212aa
...
...
@@ -55,6 +55,7 @@ header nav ul li a:hover:after {
}
header
#navbar-login
{
margin-top
:
1%
;
margin-right
:
2%
;
width
:
50%
;
height
:
120px
;
}
...
...
@@ -141,6 +142,7 @@ h3{
.form-holder
.form-content
{
position
:
relative
;
bottom
:
150px
;
text-align
:
center
;
display
:
-webkit-box
;
display
:
-moz-box
;
...
...
SkuciSe/src/main/resources/templates/index.html
View file @
9cf212aa
...
...
@@ -25,31 +25,41 @@
<nav>
<ul>
<li><a
th:href=
"@{/index}"
>
Pocetna
</a></li>
<li><a
href=
"
#
"
>
Kategorije
</a></li>
<li><a
href=
""
>
Kategorije
</a></li>
<li><a
href=
"#"
>
O nama
</a></li>
</ul>
</nav>
<!--<img src="../static/images/logo.png" alt="Logo">-->
<div
id=
"navbar-login"
>
<div
id=
"navbar-login"
class=
"ml-10"
>
<ul>
<li
th:if=
"${loggedUser == null}"
><a
th:href=
"@{/login}"
><i
class=
"fas fa-sign-in-alt"
></i><span
style=
"padding:5px;"
>
Prijavi se
</span></a></li>
<li
th:if=
"${loggedUser == null}"
><a
th:href=
"@{/register}"
><i
class=
"fa-solid fa-circle-user"
></i><span
style=
"padding:5px;"
>
Registruj se
</span></a></li>
<li
th:if=
"${loggedUser == null}"
><a
th:href=
"@{/login}"
><i
class=
"fas fa-sign-in-alt"
></i><span
style=
"padding:5px;"
>
Prijavi se
</span></a></li>
<li
th:if=
"${loggedUser == null}"
><a
th:href=
"@{/register}"
><i
class=
"fa-solid fa-circle-user"
></i><span
style=
"padding:5px;"
>
Registruj se
</span></a></li>
<li>
<button
type=
"button"
class=
"btn btn-primary btn-md"
><i
class=
"fa-regular fa-message"
></i>
Postavite
novi oglas
</button>
</li>
<li
th:if=
"${loggedUser != null}"
>
<div
class=
"dropdown"
>
<button
class=
"btn btn-secondary dropdown-toggle round"
type=
"button"
id=
"dropdownMenuButton"
data-toggle=
"dropdown"
aria-haspopup=
"true"
aria-expanded=
"false"
>
<i
class=
"fa-solid fa-circle-user"
></i><span
style=
"padding:5px;"
th:text=
"${loggedUser.getKorisnik().getIme()}"
></span>
<button
class=
"btn btn-secondary dropdown-toggle round"
type=
"button"
id=
"dropdownMenuButton"
data-toggle=
"dropdown"
aria-haspopup=
"true"
aria-expanded=
"false"
>
<i
class=
"fa-solid fa-circle-user"
></i><span
style=
"padding:5px;"
th:text=
"${loggedUser.getKorisnik().getIme()}"
></span>
</button>
<div
class=
"dropdown-menu"
aria-labelledby=
"dropdownMenuButton"
>
<a
class=
"dropdown-item"
th:href=
"@{/profile}"
>
Moj Profil
</a>
<a
class=
"dropdown-item"
th:href=
"@{/mojioglasi}"
>
Moji Oglasi
</a>
<a
class=
"dropdown-item"
th:href=
"@{/mojizahtevi}"
>
Moji Zahtevi
</a>
<a
th:if=
"${loggedUser.getKorisnik().getTipId() == 2}"
class=
"dropdown-item"
th:href=
"@{/lista-korisnika}"
>
Lista Profila
</a>
<form
th:action=
"@{/logout}"
method=
"post"
id=
"my_form"
class=
"dropdown-item"
>
<a
href=
"#"
onclick=
"document.getElementById('my_form').submit(); return false;"
><i
class=
"fas fa-sign-in-alt"
></i><span
style=
"padding:5px;"
>
Odjavi se
</span></a>
<a
href=
"#"
onclick=
"document.getElementById('my_form').submit(); return false;"
><i
class=
"fas fa-sign-in-alt"
></i><span
style=
"padding:5px;"
>
Odjavi se
</span></a>
</form>
</div>
</div>
</li>
<li><button
type=
"button"
class=
"btn btn-primary btn-md"
><i
class=
"fa-regular fa-message"
></i>
Postavite novi oglas
</button></li>
</ul>
</div>
</header>
...
...
SkuciSe/src/main/resources/templates/listaProfilaAdmin.html
0 → 100644
View file @
9cf212aa
<!DOCTYPE html>
<html
lang=
"en"
xmlns:th=
"http://www.thymeleaf.org"
>
<head>
<meta
charset=
"utf-8"
/>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1, shrink-to-fit=no"
/>
<meta
name=
"description"
content=
""
/>
<meta
name=
"author"
content=
""
/>
<title>
SkuciSe
</title>
<link
rel=
"shortcut icon"
type=
"image/x-icon"
href=
"/images/logo.ico"
/>
<link
href=
'https://fonts.googleapis.com/css?family=Jost'
rel=
'stylesheet'
>
<!-- Favicon-->
<link
rel=
"icon"
type=
"image/x-icon"
href=
"assets/favicon.ico"
/>
<!-- CSS only -->
<link
href=
"https://cdn.jsdelivr.net/npm/bootstrap@5.2.0/dist/css/bootstrap.min.css"
rel=
"stylesheet"
integrity=
"sha384-gH2yIJqKdNHPEq0n4Mqa/HGKIhSkIHeL5AyhkYV8i59U5AR6csBvApHHNl/vI1Bx"
crossorigin=
"anonymous"
>
<!-- Core theme CSS (includes Bootstrap)-->
<link
href=
"/css/style.css"
rel=
"stylesheet"
/>
</head>
<body
th:object=
"${loggedUser}"
>
<header>
<nav>
<ul>
<li><a
th:href=
"@{/index}"
>
Pocetna
</a></li>
<li><a
href=
""
>
Kategorije
</a></li>
<li><a
href=
"#"
>
O nama
</a></li>
</ul>
</nav>
<div
id=
"navbar-login"
class=
"ml-10"
>
<ul>
<li
th:if=
"${loggedUser == null}"
><a
th:href=
"@{/login}"
><i
class=
"fas fa-sign-in-alt"
></i><span
style=
"padding:5px;"
>
Prijavi se
</span></a></li>
<li
th:if=
"${loggedUser == null}"
><a
th:href=
"@{/register}"
><i
class=
"fa-solid fa-circle-user"
></i><span
style=
"padding:5px;"
>
Registruj se
</span></a></li>
<li>
<button
type=
"button"
class=
"btn btn-primary btn-md"
><i
class=
"fa-regular fa-message"
></i>
Postavite
novi oglas
</button>
</li>
<li
th:if=
"${loggedUser != null}"
>
<div
class=
"dropdown"
>
<button
class=
"btn btn-secondary dropdown-toggle round"
type=
"button"
id=
"dropdownMenuButton"
data-toggle=
"dropdown"
aria-haspopup=
"true"
aria-expanded=
"false"
>
<i
class=
"fa-solid fa-circle-user"
></i><span
style=
"padding:5px;"
th:text=
"${loggedUser.getKorisnik().getIme()}"
></span>
</button>
<div
class=
"dropdown-menu"
aria-labelledby=
"dropdownMenuButton"
>
<a
class=
"dropdown-item"
th:href=
"@{/profile}"
>
Moj Profil
</a>
<a
class=
"dropdown-item"
th:href=
"@{/mojioglasi}"
>
Moji Oglasi
</a>
<a
class=
"dropdown-item"
th:href=
"@{/mojizahtevi}"
>
Moji Zahtevi
</a>
<a
th:if=
"${loggedUser.getKorisnik().getTipId() == 2}"
class=
"dropdown-item"
th:href=
"@{/lista-korisnika}"
>
Lista Profila
</a>
<form
th:action=
"@{/logout}"
method=
"post"
id=
"my_form"
class=
"dropdown-item"
>
<a
href=
"#"
onclick=
"document.getElementById('my_form').submit(); return false;"
><i
class=
"fas fa-sign-in-alt"
></i><span
style=
"padding:5px;"
>
Odjavi se
</span></a>
</form>
</div>
</div>
</li>
</ul>
</div>
</header>
<div
class=
"container d-flex align-items-center justify-content-center flex flex-column h-50"
>
<h1>
Spisak korisnika
</h1>
<div
class=
"row w-100 h-50"
style=
"margin-top:50px;"
>
<div>
<div
class=
"row h-50"
>
<div
class=
"col ps-md-4"
>
<div
class=
"row"
>
<div
class=
"card mb-3"
th:each=
"korisnik: ${korisnici}"
>
<div
class=
"row no-gutters"
>
<div
class=
"col-md-4 d-flex justify-content-center align-items-center"
>
<img
style=
"width: 150px;height: 150px"
th:src=
"@{'data:image/png;charset=utf-8;base64,'+${korisnik.getSlika()}}"
alt=
"slika korisnika"
>
</div>
<div
class=
"col-md-6"
>
<div
class=
"card-body"
>
<h5
class=
"card-title"
th:text=
"${korisnik.getIme() + ' ' + korisnik.getPrezime()}"
></h5>
<p
class=
"card-text"
>
Email:
<span
th:text=
"${korisnik.getEmail()}"
></span><br>
Telefon:
<span
th:text=
"${korisnik.getTelefon()}"
></span><br>
Grad:
<span
th:text=
"${gradovi[korisnikStat.count - 1]}"
></span>
</p>
</div>
</div>
<div
class=
"col-md-2 d-flex flex-column justify-content-around align-items-center"
>
<form
method=
"POST"
th:action=
"@{/delete-user/{id}(id=${korisnik.getKorisnikId()})}"
>
<button
type=
"submit"
class=
"btn btn-danger"
>
Obrisi korisnika
</button>
</form>
<button
type=
"button"
class=
"btn btn-secondary"
>
Izmeni korisnika
</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div
class=
"container-fluid pb-0 mb-0 justify-content-center text-light "
>
<footer>
<div
class=
"row my-5 justify-content-center py-5"
>
<div
class=
"col-11"
>
<div
class=
"row "
>
<div
class=
"col-xl-8 col-md-4 col-sm-4 col-12 my-auto mx-auto a"
><h3
class=
"text-muted mb-md-0 mb-5 bold-text"
>
SkuciSe
</h3></div>
<div
class=
"col-xl-2 col-md-4 col-sm-4 col-12"
><h6
class=
"mb-3 mb-lg-4 bold-text "
><b>
MENI
</b></h6>
<ul
class=
"list-unstyled"
>
<li>
Pocetna
</li>
<li>
O nama
</li>
<li>
Blog
</li>
<li>
Portfolio
</li>
</ul>
</div>
<div
class=
"col-xl-2 col-md-4 col-sm-4 col-12"
><h6
class=
"mb-3 mb-lg-4 text-muted bold-text mt-sm-0 mt-5"
><b>
ADRESA
</b></h6>
<p
class=
"mb-1"
>
Radoja Domanovića 12
</p>
<p>
Kragujevac 34000
</p></div>
</div>
<div
class=
"row "
>
<div
class=
"col-xl-8 col-md-4 col-sm-4 col-auto my-md-0 mt-5 order-sm-1 order-3 align-self-end"
><p
class=
"social text-muted mb-0 pb-0 bold-text"
><span
class=
"mx-2"
><i
class=
"fa fa-facebook"
aria-hidden=
"true"
></i></span>
<span
class=
"mx-2"
><i
class=
"fa fa-linkedin-square"
aria-hidden=
"true"
></i></span>
<span
class=
"mx-2"
><i
class=
"fa fa-twitter"
aria-hidden=
"true"
></i></span>
<span
class=
"mx-2"
><i
class=
"fa fa-instagram"
aria-hidden=
"true"
></i></span></p><small
class=
"rights"
><span>
®
</span>
SkuciSe All Rights Reserved.
</small></div>
<div
class=
"col-xl-2 col-md-4 col-sm-4 col-auto order-1 align-self-end "
><h6
class=
"mt-55 mt-2 text-muted bold-text"
><b>
PERA PERIC
</b></h6><small>
<span><i
class=
"fa fa-envelope"
aria-hidden=
"true"
></i></span>
pera@gmail.com
</small></div>
<div
class=
"col-xl-2 col-md-4 col-sm-4 col-auto order-2 align-self-end mt-3 "
><h6
class=
"text-muted bold-text"
><b>
ACA ACIC
</b></h6><small><span><i
class=
"fa fa-envelope"
aria-hidden=
"true"
></i></span>
aca@gmail.com
</small></div>
</div>
</div>
</div>
</footer>
</div>
<!-- JavaScript Bundle with Popper -->
<script
src=
"https://code.jquery.com/jquery-3.2.1.slim.min.js"
integrity=
"sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN"
crossorigin=
"anonymous"
></script>
<script
src=
"https://cdn.jsdelivr.net/npm/popper.js@1.12.9/dist/umd/popper.min.js"
integrity=
"sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q"
crossorigin=
"anonymous"
></script>
<script
src=
"https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/js/bootstrap.min.js"
integrity=
"sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl"
crossorigin=
"anonymous"
></script>
<script
src=
"https://kit.fontawesome.com/51d1fadef3.js"
crossorigin=
"anonymous"
></script>
<script
src=
"/js/main.js"
></script>
</body>
</html>
\ No newline at end of file
SkuciSe/src/main/resources/templates/listaProfilaAdminDelete.html
0 → 100644
View file @
9cf212aa
<!DOCTYPE html>
<html
lang=
"en"
xmlns:th=
"http://www.thymeleaf.org"
>
<head>
<meta
charset=
"utf-8"
/>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1, shrink-to-fit=no"
/>
<meta
name=
"description"
content=
""
/>
<meta
name=
"author"
content=
""
/>
<title>
SkuciSe
</title>
<link
rel=
"shortcut icon"
type=
"image/x-icon"
href=
"/images/logo.ico"
/>
<link
href=
'https://fonts.googleapis.com/css?family=Jost'
rel=
'stylesheet'
>
<!-- Favicon-->
<link
rel=
"icon"
type=
"image/x-icon"
href=
"assets/favicon.ico"
/>
<!-- CSS only -->
<link
href=
"https://cdn.jsdelivr.net/npm/bootstrap@5.2.0/dist/css/bootstrap.min.css"
rel=
"stylesheet"
integrity=
"sha384-gH2yIJqKdNHPEq0n4Mqa/HGKIhSkIHeL5AyhkYV8i59U5AR6csBvApHHNl/vI1Bx"
crossorigin=
"anonymous"
>
<!-- Core theme CSS (includes Bootstrap)-->
<link
href=
"/css/style.css"
rel=
"stylesheet"
/>
</head>
<body
th:object=
"${loggedUser}"
>
<header>
<nav>
<ul>
<li><a
th:href=
"@{/index}"
>
Pocetna
</a></li>
<li><a
href=
""
>
Kategorije
</a></li>
<li><a
href=
"#"
>
O nama
</a></li>
</ul>
</nav>
<div
id=
"navbar-login"
class=
"ml-10"
>
<ul>
<li
th:if=
"${loggedUser == null}"
><a
th:href=
"@{/login}"
><i
class=
"fas fa-sign-in-alt"
></i><span
style=
"padding:5px;"
>
Prijavi se
</span></a></li>
<li
th:if=
"${loggedUser == null}"
><a
th:href=
"@{/register}"
><i
class=
"fa-solid fa-circle-user"
></i><span
style=
"padding:5px;"
>
Registruj se
</span></a></li>
<li>
<button
type=
"button"
class=
"btn btn-primary btn-md"
><i
class=
"fa-regular fa-message"
></i>
Postavite
novi oglas
</button>
</li>
<li
th:if=
"${loggedUser != null}"
>
<div
class=
"dropdown"
>
<button
class=
"btn btn-secondary dropdown-toggle round"
type=
"button"
id=
"dropdownMenuButton"
data-toggle=
"dropdown"
aria-haspopup=
"true"
aria-expanded=
"false"
>
<i
class=
"fa-solid fa-circle-user"
></i><span
style=
"padding:5px;"
th:text=
"${loggedUser.getKorisnik().getIme()}"
></span>
</button>
<div
class=
"dropdown-menu"
aria-labelledby=
"dropdownMenuButton"
>
<a
class=
"dropdown-item"
th:href=
"@{/profile}"
>
Moj Profil
</a>
<a
class=
"dropdown-item"
th:href=
"@{/mojioglasi}"
>
Moji Oglasi
</a>
<a
class=
"dropdown-item"
th:href=
"@{/mojizahtevi}"
>
Moji Zahtevi
</a>
<a
th:if=
"${loggedUser.getKorisnik().getTipId() == 2}"
class=
"dropdown-item"
th:href=
"@{/lista-korisnika}"
>
Lista Profila
</a>
<form
th:action=
"@{/logout}"
method=
"post"
id=
"my_form"
class=
"dropdown-item"
>
<a
href=
"#"
onclick=
"document.getElementById('my_form').submit(); return false;"
><i
class=
"fas fa-sign-in-alt"
></i><span
style=
"padding:5px;"
>
Odjavi se
</span></a>
</form>
</div>
</div>
</li>
</ul>
</div>
</header>
<div
class=
"container d-flex align-items-center justify-content-center flex flex-column h-50"
>
<h1>
Spisak korisnika
</h1>
<div
class=
"alert alert-info"
>
<strong>
Uspesno!
</strong>
Uspesno ste obrisali korisnika!
<button
type=
"button"
class=
"btn-close"
data-dismiss=
"alert"
></button>
</div>
<div
class=
"row w-100 h-50"
style=
"margin-top:50px;"
>
<div>
<div
class=
"row h-50"
>
<div
class=
"col ps-md-4"
>
<div
class=
"row"
>
<div
class=
"card mb-3"
th:each=
"korisnik: ${korisnici}"
>
<div
class=
"row no-gutters"
>
<div
class=
"col-md-4 d-flex justify-content-center align-items-center"
>
<img
style=
"width: 150px;height: 150px"
th:src=
"@{'data:image/png;charset=utf-8;base64,'+${korisnik.getSlika()}}"
alt=
"slika korisnika"
>
</div>
<div
class=
"col-md-6"
>
<div
class=
"card-body"
>
<h5
class=
"card-title"
th:text=
"${korisnik.getIme() + ' ' + korisnik.getPrezime()}"
></h5>
<p
class=
"card-text"
>
Email:
<span
th:text=
"${korisnik.getEmail()}"
></span><br>
Telefon:
<span
th:text=
"${korisnik.getTelefon()}"
></span><br>
Grad:
<span
th:text=
"${gradovi[korisnikStat.count - 1]}"
></span>
</p>
</div>
</div>
<div
class=
"col-md-2 d-flex flex-column justify-content-around align-items-center"
>
<form
method=
"POST"
th:action=
"@{/delete-user/{id}(id=${korisnik.getKorisnikId()})}"
>
<button
type=
"submit"
class=
"btn btn-danger"
>
Obrisi korisnika
</button>
</form>
<button
type=
"button"
class=
"btn btn-secondary"
>
Izmeni korisnika
</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div
class=
"container-fluid pb-0 mb-0 justify-content-center text-light "
>
<footer>
<div
class=
"row my-5 justify-content-center py-5"
>
<div
class=
"col-11"
>
<div
class=
"row "
>
<div
class=
"col-xl-8 col-md-4 col-sm-4 col-12 my-auto mx-auto a"
><h3
class=
"text-muted mb-md-0 mb-5 bold-text"
>
SkuciSe
</h3></div>
<div
class=
"col-xl-2 col-md-4 col-sm-4 col-12"
><h6
class=
"mb-3 mb-lg-4 bold-text "
><b>
MENI
</b></h6>
<ul
class=
"list-unstyled"
>
<li>
Pocetna
</li>
<li>
O nama
</li>
<li>
Blog
</li>
<li>
Portfolio
</li>
</ul>
</div>
<div
class=
"col-xl-2 col-md-4 col-sm-4 col-12"
><h6
class=
"mb-3 mb-lg-4 text-muted bold-text mt-sm-0 mt-5"
><b>
ADRESA
</b></h6>
<p
class=
"mb-1"
>
Radoja Domanovića 12
</p>
<p>
Kragujevac 34000
</p></div>
</div>
<div
class=
"row "
>
<div
class=
"col-xl-8 col-md-4 col-sm-4 col-auto my-md-0 mt-5 order-sm-1 order-3 align-self-end"
><p
class=
"social text-muted mb-0 pb-0 bold-text"
><span
class=
"mx-2"
><i
class=
"fa fa-facebook"
aria-hidden=
"true"
></i></span>
<span
class=
"mx-2"
><i
class=
"fa fa-linkedin-square"
aria-hidden=
"true"
></i></span>
<span
class=
"mx-2"
><i
class=
"fa fa-twitter"
aria-hidden=
"true"
></i></span>
<span
class=
"mx-2"
><i
class=
"fa fa-instagram"
aria-hidden=
"true"
></i></span></p><small
class=
"rights"
><span>
®
</span>
SkuciSe All Rights Reserved.
</small></div>
<div
class=
"col-xl-2 col-md-4 col-sm-4 col-auto order-1 align-self-end "
><h6
class=
"mt-55 mt-2 text-muted bold-text"
><b>
PERA PERIC
</b></h6><small>
<span><i
class=
"fa fa-envelope"
aria-hidden=
"true"
></i></span>
pera@gmail.com
</small></div>
<div
class=
"col-xl-2 col-md-4 col-sm-4 col-auto order-2 align-self-end mt-3 "
><h6
class=
"text-muted bold-text"
><b>
ACA ACIC
</b></h6><small><span><i
class=
"fa fa-envelope"
aria-hidden=
"true"
></i></span>
aca@gmail.com
</small></div>
</div>
</div>
</div>
</footer>
</div>
<!-- JavaScript Bundle with Popper -->
<script
src=
"https://code.jquery.com/jquery-3.2.1.slim.min.js"
integrity=
"sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN"
crossorigin=
"anonymous"
></script>
<script
src=
"https://cdn.jsdelivr.net/npm/popper.js@1.12.9/dist/umd/popper.min.js"
integrity=
"sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q"
crossorigin=
"anonymous"
></script>
<script
src=
"https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/js/bootstrap.min.js"
integrity=
"sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl"
crossorigin=
"anonymous"
></script>
<script
src=
"https://kit.fontawesome.com/51d1fadef3.js"
crossorigin=
"anonymous"
></script>
<script
src=
"/js/main.js"
></script>
</body>
</html>
\ No newline at end of file
SkuciSe/src/main/resources/templates/profile.html
View file @
9cf212aa
...
...
@@ -28,17 +28,21 @@
<nav>
<ul>
<li><a
th:href=
"@{/index}"
>
Pocetna
</a></li>
<li><a
href=
"
#
"
>
Kategorije
</a></li>
<li><a
href=
""
>
Kategorije
</a></li>
<li><a
href=
"#"
>
O nama
</a></li>
</ul>
</nav>
<!--<img src="../static/images/logo.png" alt="Logo">-->
<div
id=
"navbar-login"
>
<div
id=
"navbar-login"
class=
"ml-10"
>
<ul>
<li
th:if=
"${loggedUser == null}"
><a
th:href=
"@{/login}"
><i
class=
"fas fa-sign-in-alt"
></i><span
style=
"padding:5px;"
>
Prijavi se
</span></a></li>
<li
th:if=
"${loggedUser == null}"
><a
th:href=
"@{/register}"
><i
class=
"fa-solid fa-circle-user"
></i><span
style=
"padding:5px;"
>
Registruj se
</span></a></li>
<li>
<button
type=
"button"
class=
"btn btn-primary btn-md"
><i
class=
"fa-regular fa-message"
></i>
Postavite
novi oglas
</button>
</li>
<li
th:if=
"${loggedUser != null}"
>
<div
class=
"dropdown"
>
<button
class=
"btn btn-secondary dropdown-toggle round"
type=
"button"
id=
"dropdownMenuButton"
...
...
@@ -50,6 +54,8 @@
<a
class=
"dropdown-item"
th:href=
"@{/profile}"
>
Moj Profil
</a>
<a
class=
"dropdown-item"
th:href=
"@{/mojioglasi}"
>
Moji Oglasi
</a>
<a
class=
"dropdown-item"
th:href=
"@{/mojizahtevi}"
>
Moji Zahtevi
</a>
<a
th:if=
"${loggedUser.getKorisnik().getTipId() == 2}"
class=
"dropdown-item"
th:href=
"@{/lista-korisnika}"
>
Lista Profila
</a>
<form
th:action=
"@{/logout}"
method=
"post"
id=
"my_form"
class=
"dropdown-item"
>
<a
href=
"#"
onclick=
"document.getElementById('my_form').submit(); return false;"
><i
class=
"fas fa-sign-in-alt"
></i><span
style=
"padding:5px;"
>
Odjavi se
</span></a>
...
...
@@ -57,11 +63,6 @@
</div>
</div>
</li>
<li>
<button
type=
"button"
class=
"btn btn-primary btn-md"
><i
class=
"fa-regular fa-message"
></i>
Postavite
novi oglas
</button>
</li>
</ul>
</div>
</header>
...
...
@@ -95,7 +96,7 @@
<div
class=
"form-body"
style=
"height: 400px;margin-left:53px;display: none;"
id=
"fadeDiv"
>
<div
class=
"row"
>
<div
class=
"form-holder"
style=
"min-height: 0;"
>
<div
class=
"form-content"
>
<div
class=
"form-content"
style=
"bottom:50px;"
>
<div
class=
"form-items"
>
<form
class=
"requires-validation"
novalidate
th:object=
"${editUser}"
method=
"POST"
th:action=
"@{/profile-update}"
enctype=
"multipart/form-data"
>
...
...
@@ -175,7 +176,7 @@
</div>
<div
class=
"d-flex align-items-center justify-content-between"
>
<p
class=
"py-2"
>
Grad
</p>
<p
class=
"py-2 text-muted"
th:object=
"${grad}"
th:text=
"${grad.
naziv
}"
></p>
<p
class=
"py-2 text-muted"
th:object=
"${grad}"
th:text=
"${grad.
getNaziv()
}"
></p>
</div>
</div>
</div>
...
...
SkuciSe/src/main/resources/templates/register.html
View file @
9cf212aa
...
...
@@ -31,7 +31,7 @@
<!--<img src="../static/images/logo.png" alt="Logo">-->
<div
id=
"navbar-login"
>
<ul>
<li><a
th:href=
"@{/login}"
><i
class=
"fas fa-sign-in-alt"
></i><span
style=
"padding:5px;"
>
Uloguj
se
</span></a></li>
<li><a
th:href=
"@{/login}"
><i
class=
"fas fa-sign-in-alt"
></i><span
style=
"padding:5px;"
>
Prijavi
se
</span></a></li>
<li><a
th:href=
"@{/register}"
><i
class=
"fa-solid fa-circle-user"
></i><span
style=
"padding:5px;"
>
Registruj se
</span></a></li>
<li><button
type=
"button"
class=
"btn btn-primary btn-md"
><i
class=
"fa-regular fa-message"
></i>
Postavite novi oglas
</button></li>
</ul>
...
...
@@ -41,7 +41,7 @@
<div
class=
"form-body"
>
<div
class=
"row"
>
<div
class=
"form-holder"
>
<div
class=
"form-content"
>
<div
class=
"form-content"
style=
"bottom:50px;"
>
<div
class=
"form-items"
>
<h3>
Registrujte se
</h3>
<p>
Popunite podatke ispod.
</p>
...
...
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