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
2043b173
Commit
2043b173
authored
Sep 15, 2022
by
Bogdan Andjelkovic
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slanje liste zahteva za odgovarajuci oglas i zakrivanje u zavistnosti prijavljen i vlasnik oglasa
parent
87a78ca1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
7 deletions
+16
-7
SkuciSe/src/main/java/com/example/SkuciSe/controller/OglasController.java
+6
-5
SkuciSe/src/main/resources/templates/moji-zahtevi.html
+2
-0
SkuciSe/src/main/resources/templates/oglas.html
+8
-2
No files found.
SkuciSe/src/main/java/com/example/SkuciSe/controller/OglasController.java
View file @
2043b173
...
...
@@ -4,10 +4,7 @@ import com.example.SkuciSe.model.korisnik.Korisnik;
import
com.example.SkuciSe.model.korisnik.KorisnikDetails
;
import
com.example.SkuciSe.model.oglas.Oglas
;
import
com.example.SkuciSe.model.zahtev.Zahtev
;
import
com.example.SkuciSe.repository.KorisnikRepository
;
import
com.example.SkuciSe.repository.LokacijaRepository
;
import
com.example.SkuciSe.repository.OglasRepository
;
import
com.example.SkuciSe.repository.SlikeRepository
;
import
com.example.SkuciSe.repository.*
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.security.core.annotation.AuthenticationPrincipal
;
import
org.springframework.stereotype.Controller
;
...
...
@@ -34,6 +31,9 @@ public class OglasController
@Autowired
SlikeRepository
sRepo
;
@Autowired
ZahtevRepository
zRepo
;
@GetMapping
(
"/novi-oglas"
)
public
String
getNoviOglas
(
Model
model
,
@AuthenticationPrincipal
KorisnikDetails
loggedUser
)
{
...
...
@@ -92,7 +92,8 @@ public class OglasController
model
.
addAttribute
(
"loggedUser"
,
loggedUser
);
model
.
addAttribute
(
"oglas"
,
oRepo
.
findById
(
oglasId
));
model
.
addAttribute
(
"slike"
,
sRepo
.
findAllById
(
oglasId
));
model
.
addAttribute
(
"grad"
,
kRepo
.
findCity
(
oRepo
.
findById
(
oglasId
).
getLokacijaId
()));
model
.
addAttribute
(
"grad"
,
kRepo
.
findCity
(
oRepo
.
findById
(
oglasId
).
getLokacijaId
()));
model
.
addAttribute
(
"zahtevi"
,
zRepo
.
findAllByOglasId
(
oglasId
));
return
(
"oglas"
);
}
@GetMapping
(
"/profile/moji-oglasi"
)
...
...
SkuciSe/src/main/resources/templates/moji-zahtevi.html
View file @
2043b173
...
...
@@ -88,9 +88,11 @@
</ul>
</div>
</nav>
<div
th:object=
"${zahtevi}"
>
<p
th:each=
"zahtev: ${zahtevi}"
th:text=
"${zahtev.toString()}"
></p>
</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"
>
...
...
SkuciSe/src/main/resources/templates/oglas.html
View file @
2043b173
...
...
@@ -170,12 +170,18 @@
</div>
</div>
<form
th:if=
"${loggedUser != null}"
th:action=
"@{/obradi-zahtev/{id}(id=${oglasId})}"
method=
"POST"
th:object=
"${noviZahtev}"
>
<div
th:if=
"${loggedUser != null}"
>
<form
th:if=
"${loggedUser.korisnik.korisnikId != oglas.korisnikId}"
th:action=
"@{/obradi-zahtev/{id}(id=${oglasId})}"
method=
"POST"
th:object=
"${noviZahtev}"
>
<input
type=
"hidden"
th:field=
"${noviZahtev.korisnikId}"
th:value=
"${loggedUser.korisnik.korisnikId}"
>
<input
type=
"hidden"
th:field=
"${noviZahtev.oglasId}"
th:value=
"${oglas.oglasId}"
>
<input
type=
"datetime-local"
name=
"datumIVreme"
>
<button
type=
"submit"
>
POSALJI ZAHTEV
</button>
</form>
</form>
<div
th:if=
"${loggedUser.korisnik.korisnikId == oglas.korisnikId}"
th:object=
"${zahtevi}"
>
<p
th:each=
"zahtev: ${zahtevi}"
th:text=
"${zahtev.toString()}"
></p>
</div>
</div>
<div
class=
"container-fluid pb-0 mb-0 justify-content-center text-light "
>
<footer>
...
...
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