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
12b14a2e
Commit
12b14a2e
authored
Sep 19, 2022
by
Bogdan Andjelkovic
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
komentari vlasnika, stranica korisnika sa njegovim oglasima i komentarima
parent
beca7ae7
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
504 additions
and
19 deletions
+504
-19
SkuciSe/src/main/java/com/example/SkuciSe/controller/AdminController.java
+5
-3
SkuciSe/src/main/java/com/example/SkuciSe/controller/KomentarController.java
+19
-2
SkuciSe/src/main/java/com/example/SkuciSe/controller/OglasController.java
+0
-8
SkuciSe/src/main/java/com/example/SkuciSe/controller/ProfileController.java
+37
-6
SkuciSe/src/main/java/com/example/SkuciSe/model/komentar/KomentarVlasnik.java
+19
-0
SkuciSe/src/main/java/com/example/SkuciSe/repository/KomentarVlasnikRepository.java
+69
-0
SkuciSe/src/main/java/com/example/SkuciSe/repository/OglasRepository.java
+9
-0
SkuciSe/src/main/resources/templates/korisnik.html
+337
-0
SkuciSe/src/main/resources/templates/oglas.html
+9
-0
No files found.
SkuciSe/src/main/java/com/example/SkuciSe/controller/AdminController.java
View file @
12b14a2e
...
...
@@ -30,7 +30,8 @@ public class AdminController
ZahtevRepository
zRepo
;
@Autowired
LajkRepository
lajkRepo
;
@Autowired
KomentarVlasnikRepository
komentarVlasnikRepo
;
@GetMapping
(
"/lista-korisnika"
)
public
String
getListaKorisnika
(
Model
model
,
@AuthenticationPrincipal
KorisnikDetails
loggedUser
)
{
...
...
@@ -38,12 +39,12 @@ public class AdminController
{
return
"redirect:/index"
;
}
model
.
addAttribute
(
"korisnici"
,
kRepo
.
findAll
());
model
.
addAttribute
(
"loggedUser"
,
loggedUser
);
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
"lista-korisnika"
;
}
...
...
@@ -51,6 +52,7 @@ public class AdminController
@PostMapping
(
"/delete-user/{id}"
)
public
String
deleteUser
(
@PathVariable
(
"id"
)
Integer
id
,
@AuthenticationPrincipal
KorisnikDetails
loggedUser
,
Model
model
,
RedirectAttributes
redirectAttributes
)
{
komentarVlasnikRepo
.
deleteKomentarVlasnikByKorisnikId
(
id
);
komRepo
.
deleteKomentariByKorisnikId
(
id
);
zRepo
.
deleteZahteviByKorisnikId
(
id
);
lajkRepo
.
deleteLajkByKorisnikId
(
id
);
...
...
SkuciSe/src/main/java/com/example/SkuciSe/controller/KomentarController.java
View file @
12b14a2e
package
com
.
example
.
SkuciSe
.
controller
;
import
com.example.SkuciSe.repository.KomentarRepository
;
import
com.example.SkuciSe.repository.KomentarVlasnikRepository
;
import
com.example.SkuciSe.repository.ZahtevRepository
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
...
...
@@ -13,13 +14,15 @@ public class KomentarController {
KomentarRepository
komentarRepo
;
@Autowired
ZahtevRepository
zRepo
;
@Autowired
KomentarVlasnikRepository
komentarVlasnikRepo
;
@GetMapping
(
"/profile/moji-zahtevi/sacuvaj-komentar"
)
public
String
postSacuvajKomentar
(
@RequestParam
(
"korisnikId"
)
int
korisnikId
,
@RequestParam
(
"oglasId"
)
int
oglasId
,
@RequestParam
(
"zahtevId"
)
int
zahtevId
,
@RequestParam
(
"ocenaRadio"
)
int
ocenaRadio
,
@RequestParam
(
"komentar"
)
String
text
)
{
@RequestParam
(
"komentar"
)
String
text
)
{
try
{
komentarRepo
.
insert
(
korisnikId
,
oglasId
,
text
,
ocenaRadio
);
zRepo
.
deleteZahtev
(
zahtevId
);
...
...
@@ -28,4 +31,18 @@ public class KomentarController {
}
return
(
"redirect:/profile/moji-zahtevi"
);
}
@GetMapping
(
"/oceni-korisnika"
)
public
String
getOceniKorisnika
(
@RequestParam
(
"vlasnikId"
)
int
vlasnikId
,
@RequestParam
(
"korisnikId"
)
int
korisnikId
,
@RequestParam
(
"ocenaRadio"
)
int
ocenaRadio
,
@RequestParam
(
"komentar"
)
String
text
)
{
try
{
komentarVlasnikRepo
.
insert
(
vlasnikId
,
korisnikId
,
ocenaRadio
,
text
);
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
e
);
}
return
(
"redirect:/profile/moji-zahtevi"
);
}
}
SkuciSe/src/main/java/com/example/SkuciSe/controller/OglasController.java
View file @
12b14a2e
...
...
@@ -112,10 +112,6 @@ public class OglasController
{
model
.
addAttribute
(
"loggedUser"
,
loggedUser
);
List
<
Oglas
>
listaOglasa
=
oRepo
.
findAll
(
vrstaOglasaId
,
lokacijaId
,
brojSoba
,
cenaMin
,
cenaMax
,
kvadraturaMin
,
kvadraturaMax
,
lift
,
grejanje
,
namesten
,
pretraga
);
while
(
listaOglasa
.
size
()
%
3
!=
0
){
Oglas
o
=
new
Oglas
();
listaOglasa
.
add
(
o
);
}
model
.
addAttribute
(
"oglasi"
,
listaOglasa
);
List
<
String
>
list
=
new
ArrayList
<
String
>();
for
(
Oglas
o:
listaOglasa
)
{
...
...
@@ -144,10 +140,6 @@ public class OglasController
{
model
.
addAttribute
(
"loggedUser"
,
loggedUser
);
List
<
Oglas
>
listaOglasa
=
oRepo
.
findAllByKorisnikId
(
loggedUser
.
getKorisnik
().
getKorisnikId
(),
vrstaOglasaId
,
lokacijaId
,
brojSoba
,
cenaMin
,
cenaMax
,
kvadraturaMin
,
kvadraturaMax
,
lift
,
grejanje
,
namesten
,
pretraga
);
while
(
listaOglasa
.
size
()
%
3
!=
0
){
Oglas
o
=
new
Oglas
();
listaOglasa
.
add
(
o
);
}
model
.
addAttribute
(
"oglasi"
,
listaOglasa
);
List
<
String
>
list
=
new
ArrayList
<
String
>();
for
(
Oglas
o:
listaOglasa
)
{
...
...
SkuciSe/src/main/java/com/example/SkuciSe/controller/ProfileController.java
View file @
12b14a2e
package
com
.
example
.
SkuciSe
.
controller
;
import
com.example.SkuciSe.model.komentar.Komentar
;
import
com.example.SkuciSe.model.komentar.KomentarVlasnik
;
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
;
import
com.example.SkuciSe.
model.oglas.Oglas
;
import
com.example.SkuciSe.repository.
*
;
import
org.springframework.beans.factory.annotation.Autowired
;
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.ModelAttribute
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.multipart.MultipartFile
;
import
java.io.IOException
;
import
java.util.ArrayList
;
import
java.util.Base64
;
import
java.util.List
;
@Controller
public
class
ProfileController
...
...
@@ -26,6 +27,16 @@ public class ProfileController
@Autowired
LokacijaRepository
lRepo
;
@Autowired
OglasRepository
oRepo
;
@Autowired
SlikeRepository
sRepo
;
@Autowired
KomentarRepository
komRepo
;
@Autowired
KomentarVlasnikRepository
komentarVlasnikRepo
;
@GetMapping
(
"/profile"
)
public
String
getProfile
(
Model
model
,
@AuthenticationPrincipal
KorisnikDetails
loggedUser
)
{
...
...
@@ -79,4 +90,24 @@ public class ProfileController
loggedUser
.
setKorisnikSifra
(
korisnik
.
getSifra
());
return
"redirect:/profile"
;
}
@GetMapping
(
"/korisnik/{korisnikId}"
)
public
String
getKorisnik
(
Model
model
,
@AuthenticationPrincipal
KorisnikDetails
loggedUser
,
@PathVariable
(
"korisnikId"
)
int
korisnikId
)
{
model
.
addAttribute
(
"loggedUser"
,
loggedUser
);
model
.
addAttribute
(
"korisnik"
,
kRepo
.
findById
(
korisnikId
));
List
<
Oglas
>
oglasi
=
oRepo
.
findAllByKorisnikId
(
korisnikId
,
null
,
null
,
null
,
null
,
null
,
null
,
null
,
null
,
null
,
null
,
null
);
model
.
addAttribute
(
"oglasi"
,
oglasi
);
model
.
addAttribute
(
"slikeOglasa"
,
sRepo
.
findAllFirstPics
(
oglasi
));
model
.
addAttribute
(
"korisniciKomentari"
,
komentarVlasnikRepo
.
findAllKomentarVlasnikByKorisnikID
(
korisnikId
));
List
<
KomentarVlasnik
>
komentari
=
komentarVlasnikRepo
.
findAllKomentarVlasnikByKorisnikID
(
korisnikId
);
List
<
Korisnik
>
korisniciKomentari
=
new
ArrayList
<
Korisnik
>();
for
(
KomentarVlasnik
komentar:
komentari
)
{
korisniciKomentari
.
add
(
kRepo
.
findById
(
komentar
.
getVlasnikId
()));
}
model
.
addAttribute
(
"komentari"
,
komentari
);
model
.
addAttribute
(
"korisniciKomentari"
,
korisniciKomentari
);
return
"korisnik"
;
}
}
SkuciSe/src/main/java/com/example/SkuciSe/model/komentar/KomentarVlasnik.java
0 → 100644
View file @
12b14a2e
package
com
.
example
.
SkuciSe
.
model
.
komentar
;
import
lombok.*
;
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@ToString
public
class
KomentarVlasnik
{
private
int
komentarVlasnikId
;
private
int
vlasnikId
;
private
int
korisnikId
;
private
int
ocena
;
private
String
komentar
;
private
String
datum
;
private
String
vreme
;
}
SkuciSe/src/main/java/com/example/SkuciSe/repository/KomentarVlasnikRepository.java
0 → 100644
View file @
12b14a2e
package
com
.
example
.
SkuciSe
.
repository
;
import
com.example.SkuciSe.model.komentar.Komentar
;
import
com.example.SkuciSe.model.komentar.KomentarVlasnik
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
java.sql.CallableStatement
;
import
java.sql.ResultSet
;
import
java.sql.SQLException
;
import
java.util.ArrayList
;
import
java.util.List
;
@Component
public
class
KomentarVlasnikRepository
{
@Autowired
DataBase
dataBase
;
public
void
insert
(
int
vlasnikId
,
int
korisnikId
,
int
ocenaRadio
,
String
text
)
{
CallableStatement
stmt
=
null
;
ResultSet
rs
=
null
;
try
{
String
sql
=
"{call insertKomentarVlasnik(?,?,?,?)}"
;
stmt
=
dataBase
.
connection
.
prepareCall
(
sql
);
stmt
.
setInt
(
1
,
vlasnikId
);
stmt
.
setInt
(
2
,
korisnikId
);
stmt
.
setInt
(
3
,
ocenaRadio
);
stmt
.
setString
(
4
,
text
);
stmt
.
execute
();
}
catch
(
Exception
e
)
{
System
.
out
.
println
(
e
.
getMessage
());
}
}
public
List
<
KomentarVlasnik
>
findAllKomentarVlasnikByKorisnikID
(
int
korisnikId
)
{
List
<
KomentarVlasnik
>
komentari
=
new
ArrayList
<
KomentarVlasnik
>();
CallableStatement
cs
=
null
;
String
sql
=
"{ call findAllKomentarVlasnikByKorisnikID(?)}"
;
ResultSet
rs
=
null
;
try
{
cs
=
dataBase
.
connection
.
prepareCall
(
sql
);
cs
.
setInt
(
1
,
korisnikId
);
rs
=
cs
.
executeQuery
();
while
(
rs
.
next
())
{
komentari
.
add
(
new
KomentarVlasnik
(
rs
.
getInt
(
1
),
rs
.
getInt
(
2
),
rs
.
getInt
(
3
),
rs
.
getInt
(
4
),
rs
.
getString
(
5
),
rs
.
getString
(
6
),
rs
.
getString
(
7
)));
}
}
catch
(
SQLException
e
)
{
throw
new
RuntimeException
(
e
);
}
return
(
komentari
);
}
public
void
deleteKomentarVlasnikByKorisnikId
(
Integer
id
)
throws
RuntimeException
{
String
sql
=
"{call deleteKomentarVlasnikByKorisnikId(?)}"
;
CallableStatement
stmt
=
null
;
try
{
stmt
=
dataBase
.
connection
.
prepareCall
(
sql
);
stmt
.
setInt
(
1
,
id
);
stmt
.
execute
();
}
catch
(
SQLException
e
)
{
throw
new
RuntimeException
(
e
);
}
}
}
SkuciSe/src/main/java/com/example/SkuciSe/repository/OglasRepository.java
View file @
12b14a2e
...
...
@@ -188,6 +188,10 @@ public class OglasRepository
}
catch
(
SQLException
e
)
{
throw
new
RuntimeException
(
e
);
}
while
(
list
.
size
()
%
3
!=
0
){
Oglas
o
=
new
Oglas
();
list
.
add
(
o
);
}
return
(
list
);
}
...
...
@@ -229,6 +233,10 @@ public class OglasRepository
}
catch
(
SQLException
e
)
{
throw
new
RuntimeException
(
e
);
}
while
(
list
.
size
()
%
3
!=
0
){
Oglas
o
=
new
Oglas
();
list
.
add
(
o
);
}
return
(
list
);
}
}
\ No newline at end of file
SkuciSe/src/main/resources/templates/korisnik.html
0 → 100644
View file @
12b14a2e
<!DOCTYPE html>
<html
lang=
"en"
xmlns:th=
"http://www.w3.org/1999/xhtml"
>
<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'
>
<link
href=
"//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css"
rel=
"stylesheet"
id=
"bootstrap-css"
>
<link
rel=
"stylesheet"
href=
"https://unpkg.com/aos@next/dist/aos.css"
/>
<!-- 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/oglasiStyle.css"
rel=
"stylesheet"
/>
</head>
<body
th:object=
"${loggedUser}"
>
<nav
class=
"navbar navbar-icon-top navbar-expand-lg p-3"
>
<a
class=
"navbar-brand"
href=
"#"
>
</a>
<button
class=
"navbar-toggler"
type=
"button"
data-toggle=
"collapse"
data-target=
"#navbarSupportedContent"
aria-controls=
"navbarSupportedContent"
aria-expanded=
"false"
aria-label=
"Toggle navigation"
>
<span
class=
"navbar-toggler-icon"
></span>
</button>
<div
class=
"collapse navbar-collapse"
id=
"navbarSupportedContent"
>
<ul
class=
"navbar-nav mr-auto"
>
<li
class=
"nav-item active"
>
<a
class=
"nav-link"
th:href=
"@{/index}"
>
<i
class=
"fa fa-home"
></i>
Pocetna
<span
class=
"sr-only"
>
(current)
</span>
</a>
</li>
<li
class=
"nav-item active"
>
<a
class=
"nav-link"
th:href=
"@{/lista-oglasa}"
>
<i
class=
"fa fa-poll-h"
></i>
Lista oglasa
<span
class=
"sr-only"
>
(current)
</span>
</a>
</li>
<li
class=
"nav-item active"
>
<a
class=
"nav-link"
th:href=
"@{/onama}"
>
<i
class=
"fa-sharp fa-solid fa-address-card"
></i>
<p>
O nama
</p>
<span
class=
"sr-only"
>
(current)
</span>
</a>
</li>
<li
class=
"nav-item active"
>
<a
class=
"nav-link"
th:href=
"@{/portfolio}"
>
<i
class=
"fa-solid fa-briefcase"
></i>
<p>
Portfolio
</p>
<span
class=
"sr-only"
>
(current)
</span>
</a>
</li>
</ul>
<form
class=
"form-inline my-2 my-lg-0"
th:if=
"${loggedUser != null}"
>
<a
th:href=
"@{/novi-oglas}"
>
<button
type=
"button"
class=
"btn btn-primary btn-md mr-2"
><i
class=
"fa-solid fa-plus"
></i>
Postavite
novi oglas
</button>
</a>
</form>
<ul
class=
"navbar-nav"
>
<li
class=
"nav-item"
th:if=
"${loggedUser == null}"
>
<a
th:href=
"@{/login}"
><i
class=
"fas fa-sign-in-alt"
style=
"color:#495056"
></i><span
style=
"padding:10px;color:#495056"
>
Prijavi se
</span></a>
</li>
<li
class=
"nav-item"
th:if=
"${loggedUser == null}"
>
<a
th:href=
"@{/register}"
><i
class=
"fa-solid fa-circle-user"
style=
"color:#495056"
></i><span
style=
"padding:10px;color:#495056"
>
Registruj se
</span></a>
</li>
<li
th:if=
"${loggedUser != null}"
>
<div
class=
"dropdown mr-4"
>
<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:10px;"
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=
"@{/profile/moji-oglasi}"
>
Moji Oglasi
</a>
<a
class=
"dropdown-item"
th:href=
"@{/profile/moji-zahtevi}"
>
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>
</nav>
<form
class=
"main-section mb-5 d-flex flew-row m-4"
method=
"GET"
th:action=
"@{/lista-oglasa}"
id=
"filter"
>
<div
class=
"row w-100"
>
<div
class=
"col-3"
>
<div
class=
"card mt-2"
style=
"min-width: 130px"
th:object=
"${korisnik}"
>
<article
class=
"card-group-item"
>
<div
class=
"profilepic"
>
<img
class=
"photo profilepic__image"
id=
"slikaProfil"
th:src=
"@{'data:image/png;charset=utf-8;base64,'+${korisnik.getSlika()}}"
alt=
"slika korisnika"
>
</div>
<div
class=
"filter-content"
>
<p
class=
"fw-bold h4 mt-3"
><span
th:text=
"${korisnik.getIme()}"
></span></p>
</div>
</article>
</div>
</div>
<div
class=
"col-9"
th:object=
"${slikeOglasa}"
>
<h1
th:if=
"${oglasi.size() == 0}"
class=
"text-center"
>
Nema oglasa!
</h1>
<div
class=
"row w-100 box "
th:each=
"i : ${#numbers.sequence(0, oglasi.size()-1,3)}"
>
<div
class=
"col-lg-4 p-2"
data-aos=
"zoom-in"
th:if=
"${oglasi[i].naslov != null}"
>
<div
class=
"section border bg-white rounded p-2"
>
<div
class=
"row"
>
<div
class=
"col-lg-12 img-section"
>
<img
th:src=
"@{'data:image/png;charset=utf-8;base64,'+${slikeOglasa[i].slikaCode}}"
class=
"p-0 m-0 img-responsive"
>
<span
class=
"badge badge-danger add-sens p-2 rounded-0"
th:text=
"${oglasi[i].kvadratura + 'm2'}"
></span>
</div>
<div
class=
"col-lg-12 sectin-title d-flex alignt-items-center p-0"
>
<div
class=
"col-lg-5 d-flex justify-content-start align-items-center"
>
<h1
class=
"pt-2 pb-2 text-nowrap"
th:text=
"${oglasi[i].naslov}"
></h1>
</div>
<div
class=
"col-lg-7 d-flex justify-content-end align-items-center p-1"
>
<span><i
class=
"fas fa-star"
></i></span>
<span><i
class=
"fas fa-star"
></i></span>
<span><i
class=
"fas fa-star"
></i></span>
<span><i
class=
"fas fa-star"
></i></span>
<span><i
class=
"fas fa-star-half-alt"
></i></span><br>
</div>
</div>
<div
class=
"col-lg-12"
>
<div
class=
"row d-flex justify-content-between"
>
<div
class=
"col-lg-6 pb-2"
>
<span
th:if=
"${oglasi[i].vrstaOglasaId == 1}"
class=
"badge badge-info p-2"
th:text=
"${oglasi[i].cena*oglasi[i].kvadratura + '$'}"
></span>
<span
th:if=
"${oglasi[i].vrstaOglasaId == 2}"
class=
"badge badge-success p-2"
th:text=
"${oglasi[i].cena + '$/mes'}"
></span>
</div>
<div
class=
"col-lg-6 pb-2 d-flex justify-content-end"
>
<a
th:href=
"@{/lista-oglasa/{oglasid}(oglasid=${oglasi[i].getOglasId()})}"
class=
"link-secondary"
style=
"text-decoration: none"
>
Pogledajte oglas
</a>
</div>
</div>
</div>
</div>
</div>
</div>
<div
class=
"col-lg-4 p-2"
data-aos=
"zoom-in"
th:if=
"${oglasi[i+1].naslov != null}"
>
<div
class=
"section border bg-white rounded p-2"
>
<div
class=
"row"
>
<div
class=
"col-lg-12 img-section"
>
<img
th:src=
"@{'data:image/png;charset=utf-8;base64,'+${slikeOglasa[i+1].slikaCode}}"
class=
"p-0 m-0 img-responsive"
>
<span
class=
"badge badge-danger add-sens p-2 rounded-0"
th:text=
"${oglasi[i+1].kvadratura + 'm2'}"
></span>
</div>
<div
class=
"col-lg-12 sectin-title d-flex alignt-items-center p-0"
>
<div
class=
"col-lg-5 d-flex justify-content-start align-items-center"
>
<h1
class=
"pt-2 pb-2 text-nowrap"
th:text=
"${oglasi[i+1].naslov}"
></h1>
</div>
<div
class=
"col-lg-7 d-flex justify-content-end align-items-center p-1"
>
<span><i
class=
"fas fa-star"
></i></span>
<span><i
class=
"fas fa-star"
></i></span>
<span><i
class=
"fas fa-star"
></i></span>
<span><i
class=
"fas fa-star"
></i></span>
<span><i
class=
"fas fa-star-half-alt"
></i></span><br>
</div>
</div>
<div
class=
"col-lg-12"
>
<div
class=
"row d-flex justify-content-between"
>
<div
class=
"col-lg-6 pb-2"
>
<span
th:if=
"${oglasi[i+1].vrstaOglasaId == 1}"
class=
"badge badge-info p-2"
th:text=
"${oglasi[i+1].cena*oglasi[i+1].kvadratura + '$'}"
></span>
<span
th:if=
"${oglasi[i+1].vrstaOglasaId == 2}"
class=
"badge badge-success p-2"
th:text=
"${oglasi[i+1].cena + '$/mes'}"
></span>
</div>
<div
class=
"col-lg-6 pb-2 d-flex justify-content-end"
>
<a
th:href=
"@{/lista-oglasa/{oglasid}(oglasid=${oglasi[i+1].getOglasId()})}"
class=
"link-secondary"
style=
"text-decoration: none"
>
Pogledajte oglas
</a>
</div>
</div>
</div>
</div>
</div>
</div>
<div
class=
"col-lg-4 p-2"
data-aos=
"zoom-in"
th:if=
"${oglasi[i+2].naslov != null}"
>
<div
class=
"section border bg-white rounded p-2"
>
<div
class=
"row"
>
<div
class=
"col-lg-12 img-section"
>
<img
th:src=
"@{'data:image/png;charset=utf-8;base64,'+${slikeOglasa[i+2].slikaCode}}"
class=
"p-0 m-0 img-responsive"
>
<span
class=
"badge badge-danger add-sens p-2 rounded-0"
th:text=
"${oglasi[i+2].kvadratura + 'm2'}"
></span>
</div>
<div
class=
"col-lg-12 sectin-title d-flex alignt-items-center p-0"
>
<div
class=
"col-lg-5 d-flex justify-content-start align-items-center"
>
<h1
class=
"pt-2 pb-2 text-nowrap"
th:text=
"${oglasi[i+2].naslov}"
></h1>
</div>
<div
class=
"col-lg-7 col-md-7 d-flex justify-content-end align-items-center p-1"
>
<span><i
class=
"fas fa-star"
></i></span>
<span><i
class=
"fas fa-star"
></i></span>
<span><i
class=
"fas fa-star"
></i></span>
<span><i
class=
"fas fa-star"
></i></span>
<span><i
class=
"fas fa-star-half-alt"
></i></span>
</div>
</div>
<div
class=
"col-lg-12"
>
<div
class=
"row d-flex justify-content-between"
>
<div
class=
"col-lg-6 pb-2"
>
<span
th:if=
"${oglasi[i+2].vrstaOglasaId == 1}"
class=
"badge badge-info p-2"
th:text=
"${oglasi[i+2].cena*oglasi[i+2].kvadratura + '$'}"
></span>
<span
th:if=
"${oglasi[i+2].vrstaOglasaId == 2}"
class=
"badge badge-success p-2"
th:text=
"${oglasi[i+2].cena + '$/mes'}"
></span>
</div>
<div
class=
"col-lg-6 pb-2 d-flex justify-content-end"
>
<a
th:href=
"@{/lista-oglasa/{oglasid}(oglasid=${oglasi[i+2].getOglasId()})}"
class=
"link-secondary"
style=
"text-decoration: none"
>
Pogledajte oglas
</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</form>
<div
class=
"col-5"
>
<div
class=
"container"
>
<div
class=
"row"
th:object=
"${korisniciKomentari}"
>
<div
class=
"col-md-8"
th:each=
"komentar:${komentari}"
>
<div
class=
"media g-mb-30 media-comment"
>
<div
class=
"media-body u-shadow-v18 g-bg-secondary g-pa-30"
>
<img
class=
"d-flex g-width-50 g-height-50 rounded-circle g-mt-3 g-mr-15"
th:src=
"@{'data:image/png;charset=utf-8;base64,'+${korisniciKomentari[komentarStat.count -1].slika}}"
alt=
"Image Description"
>
<div
class=
"g-mb-15"
>
<h5
class=
"h5 g-color-gray-dark-v1 mb-0"
th:text=
"${korisniciKomentari[komentarStat.count -1].ime + ' ' + korisniciKomentari[komentarStat.count -1].prezime}"
>
John Doe
</h5>
<span
class=
"g-color-gray-dark-v4 g-font-size-12"
th:text=
"${komentar.vreme + ' ' + komentar.datum}"
></span>
</div>
<p
th:text=
"${komentar.komentar}"
></p>
</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><i
class=
"fa-solid fa-bars"
></i></h6>
<ul
class=
"list-unstyled"
>
<li><a
href=
"/index"
style=
"text-decoration: none;color:#627482;"
onmouseover=
"this.style.color='#989c9e'"
onMouseOut=
"this.style.color='#627482'"
>
Pocetna
</a>
</li>
<li><a
href=
"/onama"
style=
"text-decoration: none;color:#627482;"
onmouseover=
"this.style.color='#989c9e'"
onMouseOut=
"this.style.color='#627482'"
>
O
nama
</a></li>
<li><a
href=
"/portfolio"
style=
"text-decoration: none;color:#627482;"
onmouseover=
"this.style.color='#989c9e'"
onMouseOut=
"this.style.color='#627482'"
>
Portfolio
</a>
</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><i
class=
"fa-solid fa-map-pin"
></i></h6>
<p><a
href=
"http://maps.google.com/maps?daddr=Radoja Domanovića 12 Kragujevac&"
style=
"text-decoration: none;color:#627482;"
onmouseover=
"this.style.color='#989c9e'"
onMouseOut=
"this.style.color='#627482'"
>
Radoja Domanovića 12 Kragujevac 34000
</a></p>
</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. Sva prava zadrzana.
</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>
Korisnicki centar
</b><i
class=
"fa-solid fa-phone"
></i></h6><small>
<span><i
class=
"fa fa-envelope"
aria-hidden=
"true"
></i></span><a
href=
"mailto:someone@yoursite.com"
style=
"text-decoration: none;color:#627482;"
onmouseover=
"this.style.color='#989c9e'"
onMouseOut=
"this.style.color='#627482'"
>
skucise@gmail.com
</a>
</small></div>
</div>
</div>
</div>
</div>
</footer>
</div>
<!-- JavaScript Bundle with Popper -->
<script
src=
"//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"
></script>
<script
src=
"//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"
></script>
<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>
<script
src=
"https://unpkg.com/aos@next/dist/aos.js"
></script>
<script>
AOS
.
init
();
</script>
</body>
</html>
SkuciSe/src/main/resources/templates/oglas.html
View file @
12b14a2e
...
...
@@ -299,6 +299,15 @@
</p>
</div>
</div>
<div
class=
"col-md-3 d-flex flex-column justify-content-around align-items-center"
>
<form
method=
"get"
th:action=
"@{/oceni-korisnika}"
>
<input
type=
"text"
th:value=
"${loggedUser.korisnik.korisnikId}"
name=
"vlasnikId"
style=
"display: none"
>
<input
type=
"text"
th:value=
"${korisnik.korisnikId}"
name=
"korisnikId"
style=
"display: none"
>
<input
type=
"number"
name=
"ocenaRadio"
><br>
<input
type=
"text"
name=
"komentar"
><br>
<button
type=
"submit"
>
Oceni
</button>
</form>
</div>
<div
class=
"col-md-2 d-flex flex-column justify-content-around align-items-center"
th:if=
"${zahtevi[korisnikStat.count - 1].status.toString() == 'CEKANJE'}"
>
<form
method=
"GET"
...
...
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