Commit f52f760c by Milovan Samardzic

frontIzmenaResponzivnost

parent baac01a4
...@@ -156,7 +156,7 @@ public class OglasController ...@@ -156,7 +156,7 @@ public class OglasController
@PostMapping("/obrisi-oglas/{oglasId}") @PostMapping("/obrisi-oglas/{oglasId}")
public String postObrisiOglas(@AuthenticationPrincipal KorisnikDetails loggedUser, @PathVariable("oglasId") int oglasId) public String postObrisiOglas(@AuthenticationPrincipal KorisnikDetails loggedUser, @PathVariable("oglasId") int oglasId)
{ {
if (loggedUser!=null && (loggedUser.getKorisnik().getTipId()==1 || oRepo.findById(oglasId).getKorisnikId()==loggedUser.getKorisnik().getKorisnikId())) { if (loggedUser!=null && (loggedUser.getKorisnik().getTipId()==2 || oRepo.findById(oglasId).getKorisnikId()==loggedUser.getKorisnik().getKorisnikId())) {
oRepo.deleteOglas(oglasId); oRepo.deleteOglas(oglasId);
} }
return "redirect:/lista-oglasa"; return "redirect:/lista-oglasa";
......
...@@ -14,13 +14,18 @@ import org.springframework.web.bind.annotation.*; ...@@ -14,13 +14,18 @@ import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import java.io.IOException; import java.io.IOException;
import java.math.BigDecimal;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Base64; import java.util.Base64;
import java.util.List; import java.util.List;
@Controller @Controller
public class ProfileController public class ProfileController
{ {
public static float round(double d, int decimalPlace) {
return BigDecimal.valueOf(d).setScale(decimalPlace,BigDecimal.ROUND_HALF_UP).floatValue();
}
@Autowired @Autowired
KorisnikRepository kRepo; KorisnikRepository kRepo;
...@@ -110,7 +115,7 @@ public class ProfileController ...@@ -110,7 +115,7 @@ public class ProfileController
} }
model.addAttribute("komentari", komentari); model.addAttribute("komentari", komentari);
model.addAttribute("korisniciKomentari", korisniciKomentari); model.addAttribute("korisniciKomentari", korisniciKomentari);
model.addAttribute("avgOcena", komRepo.averageOcenaByKorisnikId( korisnikId)); model.addAttribute("avgOcena", round(komRepo.averageOcenaByKorisnikId( korisnikId),2));
model.addAttribute("countOglas",oRepo.countOglasByKorisnikId(korisnikId)); model.addAttribute("countOglas",oRepo.countOglasByKorisnikId(korisnikId));
return "korisnik"; return "korisnik";
} }
......
...@@ -354,4 +354,8 @@ h3{ ...@@ -354,4 +354,8 @@ h3{
{ color: #ffca08 ; } /* Set yellow color when star checked */ { color: #ffca08 ; } /* Set yellow color when star checked */
.starrating > input:hover ~ label .starrating > input:hover ~ label
{ color: #ffca08 ; } /* Set yellow color when star hover */ { color: #ffca08 ; } /* St yellow color when star hover */
\ No newline at end of file
.w-40{
width: 40%;
}
\ No newline at end of file
...@@ -114,13 +114,9 @@ $(document).ready(function() { ...@@ -114,13 +114,9 @@ $(document).ready(function() {
function prikaziOglase(){ function prikaziOglase(){
document.getElementById("div-oglasi").style.display = "block"; document.getElementById("div-oglasi").style.display = "block";
document.getElementById("div-ocene").style.display = "none"; document.getElementById("div-ocene").style.display = "none";
document.getElementById("dugme-oglasi").style = "text-decoration:none; border-bottom: 3px solid grey; width:100px; text-align:center;padding-bottom:5px;";
document.getElementById("dugme-ocene").style = "";
} }
function prikaziOcene(){ function prikaziOcene(){
document.getElementById("div-oglasi").style.display = "none"; document.getElementById("div-oglasi").style.display = "none";
document.getElementById("div-ocene").style.display = "block"; document.getElementById("div-ocene").style.display = "block";
document.getElementById("dugme-ocene").style = "text-decoration:none; border-bottom: 3px solid grey; width:100px; text-align:center;padding-bottom:5px;";
document.getElementById("dugme-oglasi").style = "";
} }
\ No newline at end of file
...@@ -99,29 +99,27 @@ ...@@ -99,29 +99,27 @@
method="GET" th:action="@{/lista-oglasa}" id="filter"> method="GET" th:action="@{/lista-oglasa}" id="filter">
<div class="row w-100"> <div class="row w-100">
<div class="col-3"> <div class="col-3">
<div class="card mt-2" style="min-width: 130px" th:object="${korisnik}"> <div class="card mt-2 justify-content-center align-items-center d-flex mt-5" style="min-width: 130px" th:object="${korisnik}">
<article class="card-group-item"> <div class="profilepic">
<div class="profilepic"> <img class="photo profilepic__image" id="slikaProfil"
<img class="photo profilepic__image" id="slikaProfil" style="width: 120px;height:100px;border-radius:50%"
style="width: 100px;height:100px;border-radius:50%" th:src="@{'data:image/png;charset=utf-8;base64,'+${korisnik.getSlika()}}"
th:src="@{'data:image/png;charset=utf-8;base64,'+${korisnik.getSlika()}}" alt="slika korisnika">
alt="slika korisnika"> </div>
</div> <div class="filter-content">
<div class="filter-content"> <p class="fw-bold h4 mt-3 text-center"><span th:text="${korisnik.ime + ' ' + korisnik.prezime}"></span></p>
<p class="fw-bold h4 mt-3"><span th:text="${korisnik.ime + ' ' + korisnik.prezime}"></span></p> <p class="text-center" th:object="${avgOcena}" th:text="${'Prosecna ocena korisnika: ' + avgOcena}"></p>
<p th:object="${avgOcena}" th:text="${'Prosecna ocena korisnika: ' + avgOcena}"></p> <p class="text-center" th:object="${countOglas}" th:text="${'Broj aktivnih oglasa: ' + countOglas}"></p>
<p th:object="${countOglas}" th:text="${'Broj aktivnih oglasa: ' + countOglas}"></p> </div>
</div>
</article>
</div> </div>
</div> </div>
<div class="col-9" th:object="${slikeOglasa}"> <div class="col-9" th:object="${slikeOglasa}">
<div class="row w-100 box " style="/*! border: 1px solid red; */"> <div class="row w-100 box ">
<div class="col d-flex justify-content-center"> <div class="col d-flex justify-content-center">
<h4 id="dugme-oglasi" class="link-secondary" style="text-decoration:none; border-bottom: 3px solid grey; width:100px; text-align:center;padding-bottom:5px;" onclick="prikaziOglase()">Oglasi</h4> <h4 id="dugme-oglasi" class="link-secondary" style="width:100px; text-align:center;padding-bottom:5px;cursor: pointer;" onclick="prikaziOglase()">Oglasi</h4>
</div> </div>
<div class="col d-flex justify-content-center"> <div class="col d-flex justify-content-center">
<h4 id="dugme-ocene" class="link-secondary" style="text-decoration: none" onclick="prikaziOcene()">Ocene</h4> <h4 id="dugme-ocene" class="link-secondary" style="cursor: pointer;" onclick="prikaziOcene()">Ocene</h4>
</div> </div>
</div> </div>
<div id="div-oglasi"> <div id="div-oglasi">
...@@ -237,17 +235,21 @@ ...@@ -237,17 +235,21 @@
<p th:text="${komentar.komentar}"></p> <p th:text="${komentar.komentar}"></p>
<div class="starrating risingstar d-flex justify-content-end flex-row-reverse"> <div class="starrating risingstar d-flex justify-content-end flex-row-reverse">
<img src th:onload="postaviZvezdice([[${komentar.ocena}]])"> <input type="radio" th:id="${'star' + komentar.komentarVlasnikId + '-5'}" th:name="${'ocenaRadio' + komentar.komentarVlasnikId + '-5'}" value="5"
<input type="radio" id="star5" name="ocenaRadio" value="5" th:checked="${komentar.ocena == 5}" disabled/><label th:checked="${komentar.ocena == 5}" disabled/><label
for="star5" title="5 star" style="pointer-events:none"></label> th:for="${'star' + komentar.komentarVlasnikId + '-5'}" title="5 star" style="pointer-events:none"></label>
<input type="radio" id="star4" name="ocenaRadio" value="4" th:checked="${komentar.ocena == 4}" disabled/><label <input type="radio" th:id="${'star' + komentar.komentarVlasnikId + '-4'}" th:name="${'ocenaRadio' + komentar.komentarVlasnikId + '-5'}" value="4"
for="star4" title="4 star" style="pointer-events:none"></label> th:checked="${komentar.ocena == 4}" disabled/><label
<input type="radio" id="star3" name="ocenaRadio" value="3" th:checked="${komentar.ocena == 3}" disabled/><label th:for="${'star' + komentar.komentarVlasnikId + '-4'}" title="4 star" style="pointer-events:none"></label>
for="star3" title="3 star" style="pointer-events:none"></label> <input type="radio"th:id="${'star' + komentar.komentarVlasnikId + '-3'}" th:name="${'ocenaRadio' + komentar.komentarVlasnikId + '-5'}" value="3"
<input type="radio" id="star2" name="ocenaRadio" value="2" th:checked="${komentar.ocena == 2}" disabled/><label th:checked="${komentar.ocena == 3}" disabled/><label
for="star2" title="2 star" style="pointer-events:none"></label> th:for="${'star' + komentar.komentarVlasnikId + '-3'}" title="3 star" style="pointer-events:none"></label>
<input type="radio" id="star1" name="ocenaRadio" value="1" th:checked="${komentar.ocena == 1}" disabled/><label <input type="radio" th:id="${'star' + komentar.komentarVlasnikId + '-2'}" th:name="${'ocenaRadio' + komentar.komentarVlasnikId + '-5'}" value="2"
for="star1" title="1 star" style="pointer-events:none"></label> th:checked="${komentar.ocena == 2}" disabled/><label
th:for="${'star' + komentar.komentarVlasnikId + '-2'}" title="2 star" style="pointer-events:none"></label>
<input type="radio" th:id="${'star' + komentar.komentarVlasnikId + '-1'}" th:name="${'ocenaRadio' + komentar.komentarVlasnikId + '-5'}" value="1"
th:checked="${komentar.ocena == 1}" disabled/><label
th:for="${'star' + komentar.komentarVlasnikId + '-1'}" title="1 star" style="pointer-events:none"></label>
</div> </div>
</div> </div>
</div> </div>
......
...@@ -102,30 +102,17 @@ ...@@ -102,30 +102,17 @@
<h2 th:if="${oglasi.size() == 0}" class="text-center">Jos niste poslali nijedan zahtev!</h2> <h2 th:if="${oglasi.size() == 0}" class="text-center">Jos niste poslali nijedan zahtev!</h2>
<div class="card mb-3" th:each="oglas: ${oglasi}" style="background: transparent" th:if="${!zahtevi[oglasStat.index].korisnikKom}"> <div class="card mb-3" th:each="oglas: ${oglasi}" style="background: transparent" th:if="${!zahtevi[oglasStat.index].korisnikKom}">
<div class="row"> <div class="row">
<div class="col-lg-2 col-md-3 col-sm-2 col-xs-2 d-flex justify-content-center align-items-center"> <div class="col-lg-2 col-md-12 col-sm-12 col-xs-12 d-flex justify-content-center align-items-center">
<img <img
th:if="${zahtevi[oglasStat.index].status.toString() == 'POTVRDJEN'}" style="width: 120px;height: 120px;border-radius: 50%;object-fit: cover;"
th:src="@{'data:image/png;charset=utf-8;base64,'+${slike[oglasStat.index].slikaCode}}" th:src="@{'data:image/png;charset=utf-8;base64,'+${vlasnici[oglasStat.index].getSlika()}}"
alt="slika korisnika" alt="slika korisnika"
style="width: 150px;height: 150px;border-radius: 50%;object-fit: cover; border: green 3px solid"> th:styleappend="${zahtevi[oglasStat.index].status.toString() == 'POTVRDJEN' ? 'border: green 3px solid'
<img : zahtevi[oglasStat.index].status.toString() == 'CEKANJE' ? 'border: yellow 3px solid'
th:if="${zahtevi[oglasStat.index].status.toString() == 'CEKANJE'}" : zahtevi[oglasStat.index].status.toString() == 'ODBIJEN' ? 'border: red 3px solid'
th:src="@{'data:image/png;charset=utf-8;base64,'+${slike[oglasStat.index].slikaCode}}" : 'border: blue 3px solid'}">
alt="slika korisnika"
style="width: 150px;height: 150px;border-radius: 50%;object-fit: cover; border: yellow 3px solid">
<img
th:if="${zahtevi[oglasStat.index].status.toString() == 'ZAVRSEN'}"
th:src="@{'data:image/png;charset=utf-8;base64,'+${slike[oglasStat.index].slikaCode}}"
alt="slika korisnika"
style="width: 150px;height: 150px;border-radius: 50%;object-fit: cover; border: blue 3px solid"
class="w-sm-50">
<img
th:if="${zahtevi[oglasStat.index].status.toString() == 'ODBIJEN'}"
th:src="@{'data:image/png;charset=utf-8;base64,'+${slike[oglasStat.index].slikaCode}}"
alt="slika korisnika"
style="width: 150px;height: 150px;border-radius: 50%;object-fit: cover; border: red 3px solid">
</div> </div>
<div class="col-lg-3 col-md-4 col-sm-2 col-xs-3"> <div class="col-lg-3 col-md-12 col-sm-12 col-xs-12">
<div class="card-body"> <div class="card-body">
<a class="card-title" <a class="card-title"
th:href="@{/lista-oglasa/{oglasId}(oglasId=${oglas.oglasId})}" th:href="@{/lista-oglasa/{oglasId}(oglasId=${oglas.oglasId})}"
...@@ -159,7 +146,7 @@ ...@@ -159,7 +146,7 @@
</button> </button>
</form> </form>
</div> </div>
<div class="col-lg-7 col-md-5 col-sm-7 col-xs-7 d-flex align-items-center flex-row justify-content-center" th:if="${(zahtevi[oglasStat.index].status.toString() == 'ZAVRSEN')}"> <div class="col-lg-7 col-md-12 col-sm-12 col-xs-12 d-flex align-items-center flex-row justify-content-center" th:if="${(zahtevi[oglasStat.index].status.toString() == 'ZAVRSEN')}">
<form method="get" class="row w-100 h-100 flex-wrap flex-row" <form method="get" class="row w-100 h-100 flex-wrap flex-row"
th:action="@{/profile/moji-zahtevi/sacuvaj-komentar}" th:action="@{/profile/moji-zahtevi/sacuvaj-komentar}"
th:if="${zahtevi[oglasStat.index].status.toString() == 'ZAVRSEN'}"> th:if="${zahtevi[oglasStat.index].status.toString() == 'ZAVRSEN'}">
...@@ -186,14 +173,14 @@ ...@@ -186,14 +173,14 @@
th:for="${'star' + zahtevi[oglasStat.index].zahtevId + '-1'}" title="1 star"></label> th:for="${'star' + zahtevi[oglasStat.index].zahtevId + '-1'}" title="1 star"></label>
</div> </div>
</div> </div>
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 d-flex justify-content-center align-items-center"> <div class="col-lg-3 col-md-12 col-sm-12 col-xs-12 d-flex justify-content-center align-items-center">
<button type="submit" class="btn btn-secondary text-wrap w-100 h-md-50">Komentarisi</button> <button type="submit" class="btn btn-secondary text-wrap w-100">Komentarisi</button>
<button type="button" class="btn btn-secondary text-wrap w-100 ml-1">Završi</button>
</div> </div>
</form> </form>
<form method="get" th:action="@{/profile/moji-zahtevi/sacuvaj-bez-komentara}"> <form method="get" th:action="@{/profile/moji-zahtevi/sacuvaj-bez-komentara}">
<input type="text" th:value="${zahtevi[oglasStat.index].zahtevId}" <input type="text" th:value="${zahtevi[oglasStat.index].zahtevId}"
name="zahtevId" style="display: none"> name="zahtevId" style="display: none">
<button class="btn btn-primary" type="submit">Završi</button>
</form> </form>
</div> </div>
</div> </div>
......
...@@ -108,7 +108,7 @@ ...@@ -108,7 +108,7 @@
<button type="button" class="btn-close" data-dismiss="alert"></button> <button type="button" class="btn-close" data-dismiss="alert"></button>
</div> </div>
<div class="row mb-5 flex-row"> <div class="row mb-5 flex-row">
<div class="col-lg-6 col-md-6 col-sm-6"> <div class="col-lg-6 col-md-11 col-sm-11">
<div id="custCarousel" class="carousel slide" data-ride="carousel" align="center"> <div id="custCarousel" class="carousel slide" data-ride="carousel" align="center">
<!-- slides --> <!-- slides -->
<div class="carousel-inner"> <div class="carousel-inner">
...@@ -140,27 +140,35 @@ ...@@ -140,27 +140,35 @@
</ol> </ol>
</div> </div>
</div> </div>
<div class="col-lg-5 col-md-5 col-sm-5"> <div class="col-lg-5 col-md-11 col-sm-11">
<div class="col d-flex flex-column justify-content-center align-items-center border-bottom-grey gradient-bg"> <div class="col d-flex flex-column justify-content-center align-items-center border-bottom-grey gradient-bg">
<div class="row"> <div class="row">
<h1 th:text="${oglas.naslov}" class="oglas-naslov"></h1> <h1 th:text="${oglas.naslov}" class="oglas-naslov"></h1>
</div> </div>
<div class="row w-100 border-bottom-grey my-3 flex-row justify-content-end align-items-center pb-3"> <div class="row w-100 border-bottom-grey my-3 flex-row pb-3">
<div class="col d-flex justify-content-evenly" style="color: #777;"> <div class="col-4 d-flex justify-content-start align-items-center" style="color: #777;">
<p th:object="${likesCount}"> <p th:object="${likesCount}">
<span th:text="${likesCount}"></span> <span th:text="${likesCount}"></span>
<a th:if="${(loggedUser==null)}" th:href="@{/login-zahtev/{oglasId}(oglasId=${oglas.oglasId})}" style="text-decoration: none; color: grey;"><i class="fa-solid fa-heart"></i></a> <a th:if="${(loggedUser==null)}"
<a th:if="${(loggedUser!=null)&&(!liked)}" th:href="@{/lajkuj-oglas/{oglasId}(oglasId=${oglas.oglasId})}" style="text-decoration: none; color:grey"><i class="fa-solid fa-heart"></i></a> th:href="@{/login-zahtev/{oglasId}(oglasId=${oglas.oglasId})}"
<a th:if="${(loggedUser!=null)&&(liked)}" th:href="@{/lajkuj-oglas/{oglasId}(oglasId=${oglas.oglasId})}" style="text-decoration: none; color: red;"><i class="fa-solid fa-heart"></i></a> style="text-decoration: none; color: grey;"><i class="fa-solid fa-heart"></i></a>
<a th:if="${(loggedUser!=null)&&(!liked)}"
th:href="@{/lajkuj-oglas/{oglasId}(oglasId=${oglas.oglasId})}"
style="text-decoration: none; color:grey"><i class="fa-solid fa-heart"></i></a>
<a th:if="${(loggedUser!=null)&&(liked)}"
th:href="@{/lajkuj-oglas/{oglasId}(oglasId=${oglas.oglasId})}"
style="text-decoration: none; color: red;"><i class="fa-solid fa-heart"></i></a>
</p> </p>
</div> </div>
<a th:href="@{/korisnik/{korisnikId}(korisnikId=${vlasnik.korisnikId})}" <div class="col-8 justify-content-end align-items-center flex-row d-flex">
th:text="${vlasnik.ime + ' '+ vlasnik.prezime}" class="text-right w-50" <a th:href="@{/korisnik/{korisnikId}(korisnikId=${vlasnik.korisnikId})}"
style="color:#495056;text-decoration: none"></a> th:text="${vlasnik.ime + ' '+ vlasnik.prezime}" class="text-right w-50"
<div style="width:50px; height:50px;"> style="color:#495056;text-decoration: none"></a>
<img class="d-flex rounded-circle" style="width: 50px; height:50px;" <div style="width:50px; height:50px;">
th:src="@{'data:image/png;charset=utf-8;base64,'+${vlasnik.getSlika()}}" <img class="d-flex rounded-circle" style="width: 50px; height:50px;"
alt="Image Description"> th:src="@{'data:image/png;charset=utf-8;base64,'+${vlasnik.getSlika()}}"
alt="Image Description">
</div>
</div> </div>
</div> </div>
<div class="col d-flex justify-content-evenly" style="color: #777;"> <div class="col d-flex justify-content-evenly" style="color: #777;">
...@@ -192,11 +200,16 @@ ...@@ -192,11 +200,16 @@
</div> </div>
</div> </div>
</div> </div>
<div class="row mt-3 pl-3 pr-3"> <div class="row mt-3 pl-3 pr-3 border-bottom-grey">
<div class="col"> <div class="col">
<p class="text-wrap" th:text="${'Opis: ' + oglas.opis}" style="text-align: justify;"></p> <p class="text-wrap" th:text="${'Opis: ' + oglas.opis}" style="text-align: justify;"></p>
</div> </div>
</div> </div>
<div class="row w-100 justify-content-end align-items-center mt-2 mb-3" th:if="${(oglas.korisnikId == loggedUser.getKorisnik().korisnikId) || (loggedUser.getKorisnik().tipId == 2)}">
<form method="POST" class="w-100 justify-content-end align-items-center d-flex" th:action="@{/obrisi-oglas/{oglasId}(oglasId=${oglas.oglasId})}">
<button type="submit" class="btn btn-danger w-25">Obrisi oglas</button>
</form>
</div>
<div class="row" <div class="row"
th:if="${(loggedUser !=null) && (oglas.korisnikId != loggedUser.getKorisnik().korisnikId)}"> th:if="${(loggedUser !=null) && (oglas.korisnikId != loggedUser.getKorisnik().korisnikId)}">
<button type="button" class="btn btn-primary" id="zahtevDugme">Zakazite obilazak</button> <button type="button" class="btn btn-primary" id="zahtevDugme">Zakazite obilazak</button>
...@@ -232,8 +245,9 @@ ...@@ -232,8 +245,9 @@
<div class="row"> <div class="row">
<div class="col-5"> <div class="col-5">
<div class="container"> <div class="container">
<h1>Komentari</h1>
<div class="row" th:object="${korisniciKomentari}"> <div class="row" th:object="${korisniciKomentari}">
<div class="col-md-8" th:each="komentar:${komentari}"> <div class="col-12" th:each="komentar:${komentari}">
<div class="media g-mb-30 media-comment"> <div class="media g-mb-30 media-comment">
<div class="media-body u-shadow-v18 g-bg-secondary g-pa-30"> <div class="media-body u-shadow-v18 g-bg-secondary g-pa-30">
<div class="row"> <div class="row">
...@@ -252,24 +266,22 @@ ...@@ -252,24 +266,22 @@
</div> </div>
</div> </div>
<p class="pt-3" th:text="${komentar.komentar}"></p> <p class="pt-3" th:text="${komentar.komentar}"></p>
<div class="starrating risingstar d-flex justify-content-end flex-row-reverse"> <div class="starrating risingstar d-flex justify-content-end flex-row-reverse">
<img src th:onload="postaviZvezdice([[${komentar.ocena}]])"> <input type="radio" th:id="${'star' + komentar.komentarId + '-5'}" th:name="${'ocenaRadio' + komentar.komentarId + '-5'}" value="5"
<input type="radio" id="star5" name="ocenaRadio" value="5"
th:checked="${komentar.ocena == 5}" disabled/><label th:checked="${komentar.ocena == 5}" disabled/><label
for="star5" title="5 star" style="pointer-events:none"></label> th:for="${'star' + komentar.komentarId + '-5'}" title="5 star" style="pointer-events:none"></label>
<input type="radio" id="star4" name="ocenaRadio" value="4" <input type="radio" th:id="${'star' + komentar.komentarId + '-4'}" th:name="${'ocenaRadio' + komentar.komentarId + '-5'}" value="4"
th:checked="${komentar.ocena == 4}" disabled/><label th:checked="${komentar.ocena == 4}" disabled/><label
for="star4" title="4 star" style="pointer-events:none"></label> th:for="${'star' + komentar.komentarId + '-4'}" title="4 star" style="pointer-events:none"></label>
<input type="radio" id="star3" name="ocenaRadio" value="3" <input type="radio"th:id="${'star' + komentar.komentarId + '-3'}" th:name="${'ocenaRadio' + komentar.komentarId + '-5'}" value="3"
th:checked="${komentar.ocena == 3}" disabled/><label th:checked="${komentar.ocena == 3}" disabled/><label
for="star3" title="3 star" style="pointer-events:none"></label> th:for="${'star' + komentar.komentarId + '-3'}" title="3 star" style="pointer-events:none"></label>
<input type="radio" id="star2" name="ocenaRadio" value="2" <input type="radio" th:id="${'star' + komentar.komentarId + '-2'}" th:name="${'ocenaRadio' + komentar.komentarId + '-5'}" value="2"
th:checked="${komentar.ocena == 2}" disabled/><label th:checked="${komentar.ocena == 2}" disabled/><label
for="star2" title="2 star" style="pointer-events:none"></label> th:for="${'star' + komentar.komentarId + '-2'}" title="2 star" style="pointer-events:none"></label>
<input type="radio" id="star1" name="ocenaRadio" value="1" <input type="radio" th:id="${'star' + komentar.komentarId + '-1'}" th:name="${'ocenaRadio' + komentar.komentarId + '-5'}" value="1"
th:checked="${komentar.ocena == 1}" disabled/><label th:checked="${komentar.ocena == 1}" disabled/><label
for="star1" title="1 star" style="pointer-events:none"></label> th:for="${'star' + komentar.komentarId + '-1'}" title="1 star" style="pointer-events:none"></label>
</div> </div>
</div> </div>
</div> </div>
...@@ -277,133 +289,112 @@ ...@@ -277,133 +289,112 @@
</div> </div>
</div> </div>
</div> </div>
<div class="col-5"> <div class="col-7">
<div class="container container-main d-flex align-items-center justify-content-center flex-column" <div class="d-flex align-items-center justify-content-center flex-column"
th:object="${korisnici}" th:object="${korisnici}"
th:if="${(loggedUser!=null)&&(loggedUser.korisnik.korisnikId == oglas.korisnikId)}"> th:if="${(loggedUser!=null)&&(loggedUser.korisnik.korisnikId == oglas.korisnikId)}">
<h1 th:if="${korisnici.size() > 0}">Spisak zahteva za obilazak</h1> <h1 th:if="${korisnici.size() > 0}" class="mt-2 mb-5">Spisak zahteva za obilazak</h1>
<div class="row w-100 h-50" style="margin-top:50px;"> <div class="card mb-3" th:each="korisnik: ${korisnici}" style="background: transparent" th:if="${!zahtevi[korisnikStat.index].vlasnikKom}">
<div class="card mb-3" th:each="korisnik: ${korisnici}" <div class="row flex-sm-wrap w-100">
style="background: transparent" th:if="${!zahtevi[korisnikStat.index].vlasnikKom}"> <div class="col-lg-2 col-md-12 col-sm-12 col-xs-12 d-flex justify-content-around align-items-center">
<div class="row"> <img
<div class="col-md-2 d-flex justify-content-center align-items-center"> style="width: 90px;height: 100px;border-radius: 50%;object-fit: cover;"
<img th:src="@{'data:image/png;charset=utf-8;base64,'+${korisnik.getSlika()}}"
th:if="${zahtevi[korisnikStat.index].status.toString() == 'POTVRDJEN'}" alt="slika korisnika"
th:src="@{'data:image/png;charset=utf-8;base64,'+${korisnik.getSlika()}}" th:styleappend="${zahtevi[korisnikStat.index].status.toString() == 'POTVRDJEN' ? 'border: green 3px solid'
alt="slika korisnika" : zahtevi[korisnikStat.index].status.toString() == 'CEKANJE' ? 'border: yellow 3px solid'
style="width: 150px;height: 150px;border-radius: 50%;object-fit: cover; : 'border: blue 3px solid'}">
border: green 5px solid"> </div>
<img <div class="col-lg-3 col-md-12 col-sm-12 col-xs-12 d-flex justify-content-center align-items-lg-start align-items-md-center align-items-sm-center align-items-xs-center flex-column">
th:if="${zahtevi[korisnikStat.index].status.toString() == 'CEKANJE'}" <h5 class="card-title"
th:src="@{'data:image/png;charset=utf-8;base64,'+${korisnik.getSlika()}}" th:text="${korisnik.getIme() + ' ' + korisnik.getPrezime()}"></h5>
alt="slika korisnika" <p class="card-text"
style="width: 150px;height: 150px;border-radius: 50%;object-fit: cover; th:if="${zahtevi[korisnikStat.index].status.toString()=='POTVRDJEN'}">
border: yellow 5px solid"> Email:<span th:text="${korisnik.getEmail()}"></span><br>
<img Telefon:<span th:text="${korisnik.getTelefon()}"></span>
th:if="${zahtevi[korisnikStat.index].status.toString() == 'ZAVRSEN'}" </p>
th:src="@{'data:image/png;charset=utf-8;base64,'+${korisnik.getSlika()}}" <button class="btn btn-dark"
alt="slika korisnika" th:onclick="window.open('/chat?email='+[[${korisnik.getEmail()}]],'mywindow','menubar=1,width=650,height=900')">
style="width: 150px;height: 150px;border-radius: 50%;object-fit: cover; <i class="fas fa-sms"></i> Chat
border: blue 5px solid"> </button>
<img </div>
th:if="${zahtevi[korisnikStat.index].status.toString() == 'ODBIJEN'}" <div class="col-lg-5 col-md-12 col-sm-12 col-xs-12 d-flex flex-column justify-content-around align-items-center p-2">
th:src="@{'data:image/png;charset=utf-8;base64,'+${korisnik.getSlika()}}" <form method="get" th:action="@{/oceni-korisnika}">
alt="slika korisnika" <input type="text" th:value="${oglas.oglasId}" name="oglasId"
style="width: 150px;height: 150px;border-radius: 50%;object-fit: cover; style="display: none"/>
border: red 5px solid"> <input type="text" th:value="${loggedUser.korisnik.korisnikId}" name="vlasnikId"
</div> style="display: none">
<div class="col-md-4"> <input type="text" th:value="${korisnik.korisnikId}" name="korisnikId"
<div class="card-body"> style="display: none">
<h5 class="card-title" <input type="text" th:value="${zahtevi[korisnikStat.index].zahtevId}"
th:text="${korisnik.getIme() + ' ' + korisnik.getPrezime()}"></h5> name="zahtevId" style="display: none">
<p class="card-text" <textarea class="form-control" id="exampleFormControlTextarea1"
th:if="${zahtevi[korisnikStat.index].status.toString()=='POTVRDJEN'}"> rows="2"
Email:<span th:text="${korisnik.getEmail()}"></span><br> name="komentar"></textarea>
Telefon:<span th:text="${korisnik.getTelefon()}"></span> <div class="starrating risingstar d-flex justify-content-center flex-row-reverse">
</p> <input type="radio"
<button class="btn btn-primary" th:id="${'star' + zahtevi[korisnikStat.index].zahtevId + '-5'}"
th:onclick="window.open('/chat?email='+[[${korisnik.getEmail()}]],'mywindow','menubar=1,width=650,height=900')"> name="ocenaRadio" value="5"/><label
Posaljite poruku th:for="${'star' + zahtevi[korisnikStat.index].zahtevId + '-5'}"
</button> title="5 star"></label>
</div> <input type="radio"
</div> th:id="${'star' + zahtevi[korisnikStat.index].zahtevId + '-4'}"
<div class="col-md-3 d-flex flex-column justify-content-around align-items-center"> name="ocenaRadio" value="4"/><label
<div class="card-body"> th:for="${'star' + zahtevi[korisnikStat.index].zahtevId + '-4'}"
<p class="card-text"> title="4 star"></label>
<span th:text="${zahtevi[korisnikStat.index].datum + ' ' + zahtevi[korisnikStat.index].vreme}"></span> <input type="radio"
</p> th:id="${'star' + zahtevi[korisnikStat.index].zahtevId + '-3'}"
name="ocenaRadio" value="3"/><label
th:for="${'star' + zahtevi[korisnikStat.index].zahtevId + '-3'}"
title="3 star"></label>
<input type="radio"
th:id="${'star' + zahtevi[korisnikStat.index].zahtevId + '-2'}"
name="ocenaRadio" value="2"/><label
th:for="${'star' + zahtevi[korisnikStat.index].zahtevId + '-2'}"
title="2 star"></label>
<input type="radio"
th:id="${'star' + zahtevi[korisnikStat.index].zahtevId + '-1'}"
name="ocenaRadio" value="1"/><label
th:for="${'star' + zahtevi[korisnikStat.index].zahtevId + '-1'}"
title="1 star"></label>
</div> </div>
</div> <div class="row flex-row justify-content-between align-items-center">
<div class="col-md-3 d-flex flex-column justify-content-around align-items-center"> <button class="btn btn-primary w-40" type="submit">Oceni</button>
<form method="get" th:action="@{/oceni-korisnika}"> <button class="btn btn-primary w-40" type="button"
<input type="text" th:value="${oglas.oglasId}" name="oglasId" onclick="document.getElementById('formaZavrsi').submit(); return false;">
style="display: none"/> Zavrsi
<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="text" th:value="${zahtevi[korisnikStat.index].zahtevId}"
name="zahtevId" style="display: none">
<div class="starrating risingstar d-flex justify-content-center flex-row-reverse">
<input type="radio"
th:id="${'star' + zahtevi[korisnikStat.index].zahtevId + '-5'}"
name="ocenaRadio" value="5"/><label
th:for="${'star' + zahtevi[korisnikStat.index].zahtevId + '-5'}"
title="5 star"></label>
<input type="radio"
th:id="${'star' + zahtevi[korisnikStat.index].zahtevId + '-4'}"
name="ocenaRadio" value="4"/><label
th:for="${'star' + zahtevi[korisnikStat.index].zahtevId + '-4'}"
title="4 star"></label>
<input type="radio"
th:id="${'star' + zahtevi[korisnikStat.index].zahtevId + '-3'}"
name="ocenaRadio" value="3"/><label
th:for="${'star' + zahtevi[korisnikStat.index].zahtevId + '-3'}"
title="3 star"></label>
<input type="radio"
th:id="${'star' + zahtevi[korisnikStat.index].zahtevId + '-2'}"
name="ocenaRadio" value="2"/><label
th:for="${'star' + zahtevi[korisnikStat.index].zahtevId + '-2'}"
title="2 star"></label>
<input type="radio"
th:id="${'star' + zahtevi[korisnikStat.index].zahtevId + '-1'}"
name="ocenaRadio" value="1"/><label
th:for="${'star' + zahtevi[korisnikStat.index].zahtevId + '-1'}"
title="1 star"></label>
<textarea class="form-control h-100" id="exampleFormControlTextarea1"
rows="3"
name="komentar"></textarea>
</div>
<button class="btn btn-primary" type="submit">Oceni</button>
</form>
<form method="get" th:action="@{/oceni-bez-komentara}">
<input type="text" th:value="${zahtevi[korisnikStat.index].zahtevId}"
name="zahtevId" style="display: none">
<input type="text" th:value="${oglas.oglasId}"
name="oglasId" style="display: none">
<button class="btn btn-primary" type="submit">Završi</button>
</form>
</div>
<div class="col-md-2 d-flex flex-column justify-content-around align-items-center"
th:if="${zahtevi[korisnikStat.index].status.toString() == 'CEKANJE'}">
<form method="GET"
th:action="@{/oglas-edit/{oglasId}/prihvati-zahtev/{zahtevId}(oglasId=${zahtevi[korisnikStat.index].oglasId},zahtevId=${zahtevi[korisnikStat.index].zahtevId})}">
<button type="submit" class="btn btn-success">Prihvati zahtev
</button> </button>
</form> </div>
<form method="GET" </form>
th:action="@{/oglas-edit/{oglasId}/odbi-zahtev/{zahtevId}(oglasId=${zahtevi[korisnikStat.index].oglasId},zahtevId=${zahtevi[korisnikStat.index].zahtevId})}"> <form method="get" th:action="@{/oceni-bez-komentara}" id="formaZavrsi">
<button type="submit" class="btn btn-danger">Odbij zahtev</button> <input type="text" th:value="${zahtevi[korisnikStat.index].zahtevId}"
</form> name="zahtevId" style="display: none">
</div> <input type="text" th:value="${oglas.oglasId}"
<div class="col-md-2 d-flex flex-column justify-content-around align-items-center" name="oglasId" style="display: none">
th:if="${zahtevi[korisnikStat.index].status.toString() == 'ODBIJEN'}"> </form>
<form method="GET" </div>
> <div class="col-lg-2 col-md-12 col-sm-12 col-xs-12 d-flex flex-column justify-content-around align-items-center">
<!--OBRISI ZAHTEV TH:ACTION="@{/oglas-edit/{oglasId}/obrisi-zahtev/}"--> <p class="card-text">
<button type="submit" class="btn btn-danger">Obrisi zahtev</button> <span th:text="${zahtevi[korisnikStat.index].datum + ' ' + zahtevi[korisnikStat.index].vreme}"></span>
</form> </p>
</div> </div>
<div class="col-lg-2 col-md-12 col-sm-12 col-xs-12 d-flex flex-column justify-content-around align-items-center"
th:if="${zahtevi[korisnikStat.index].status.toString() == 'CEKANJE'}">
<form method="GET"
th:action="@{/oglas-edit/{oglasId}/prihvati-zahtev/{zahtevId}(oglasId=${zahtevi[korisnikStat.index].oglasId},zahtevId=${zahtevi[korisnikStat.index].zahtevId})}">
<button type="submit" class="btn btn-success">Prihvati zahtev
</button>
</form>
<form method="GET"
th:action="@{/oglas-edit/{oglasId}/odbi-zahtev/{zahtevId}(oglasId=${zahtevi[korisnikStat.index].oglasId},zahtevId=${zahtevi[korisnikStat.index].zahtevId})}">
<button type="submit" class="btn btn-danger">Odbij zahtev</button>
</form>
</div>
<div class="col-lg-2 col-md-12 col-sm-12 col-xs-12 d-flex flex-column justify-content-around align-items-center"
th:if="${zahtevi[korisnikStat.index].status.toString() == 'ODBIJEN'}">
<form method="GET">
<button type="submit" class="btn btn-danger">Obrisi zahtev</button>
</form>
</div> </div>
</div> </div>
</div> </div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment