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: 100px;height:100px;border-radius:50%" style="width: 120px;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"><span th:text="${korisnik.ime + ' ' + korisnik.prezime}"></span></p> <p class="fw-bold h4 mt-3 text-center"><span th:text="${korisnik.ime + ' ' + korisnik.prezime}"></span></p>
<p th:object="${avgOcena}" th:text="${'Prosecna ocena korisnika: ' + avgOcena}"></p> <p class="text-center" th:object="${avgOcena}" th:text="${'Prosecna ocena korisnika: ' + avgOcena}"></p>
<p th:object="${countOglas}" th:text="${'Broj aktivnih oglasa: ' + countOglas}"></p> <p class="text-center" 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,20 +140,27 @@ ...@@ -140,20 +140,27 @@
</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>
<div class="col-8 justify-content-end align-items-center flex-row d-flex">
<a th:href="@{/korisnik/{korisnikId}(korisnikId=${vlasnik.korisnikId})}" <a th:href="@{/korisnik/{korisnikId}(korisnikId=${vlasnik.korisnikId})}"
th:text="${vlasnik.ime + ' '+ vlasnik.prezime}" class="text-right w-50" th:text="${vlasnik.ime + ' '+ vlasnik.prezime}" class="text-right w-50"
style="color:#495056;text-decoration: none"></a> style="color:#495056;text-decoration: none"></a>
...@@ -163,6 +170,7 @@ ...@@ -163,6 +170,7 @@
alt="Image Description"> 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;">
<h4 th:text="${oglas.cena*oglas.kvadratura} + '$'"></h4> <h4 th:text="${oglas.cena*oglas.kvadratura} + '$'"></h4>
<h4 th:text="${oglas.lokacija} + ', '+${grad}"></h4> <h4 th:text="${oglas.lokacija} + ', '+${grad}"></h4>
...@@ -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,43 +289,23 @@ ...@@ -277,43 +289,23 @@
</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">
<div class="col-md-2 d-flex justify-content-center align-items-center">
<img
th:if="${zahtevi[korisnikStat.index].status.toString() == 'POTVRDJEN'}"
th:src="@{'data:image/png;charset=utf-8;base64,'+${korisnik.getSlika()}}"
alt="slika korisnika"
style="width: 150px;height: 150px;border-radius: 50%;object-fit: cover;
border: green 5px solid">
<img
th:if="${zahtevi[korisnikStat.index].status.toString() == 'CEKANJE'}"
th:src="@{'data:image/png;charset=utf-8;base64,'+${korisnik.getSlika()}}"
alt="slika korisnika"
style="width: 150px;height: 150px;border-radius: 50%;object-fit: cover;
border: yellow 5px solid">
<img
th:if="${zahtevi[korisnikStat.index].status.toString() == 'ZAVRSEN'}"
th:src="@{'data:image/png;charset=utf-8;base64,'+${korisnik.getSlika()}}"
alt="slika korisnika"
style="width: 150px;height: 150px;border-radius: 50%;object-fit: cover;
border: blue 5px solid">
<img <img
th:if="${zahtevi[korisnikStat.index].status.toString() == 'ODBIJEN'}" style="width: 90px;height: 100px;border-radius: 50%;object-fit: cover;"
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"
style="width: 150px;height: 150px;border-radius: 50%;object-fit: cover; th:styleappend="${zahtevi[korisnikStat.index].status.toString() == 'POTVRDJEN' ? 'border: green 3px solid'
border: red 5px solid"> : zahtevi[korisnikStat.index].status.toString() == 'CEKANJE' ? 'border: yellow 3px solid'
: 'border: blue 3px solid'}">
</div> </div>
<div class="col-md-4"> <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">
<div class="card-body">
<h5 class="card-title" <h5 class="card-title"
th:text="${korisnik.getIme() + ' ' + korisnik.getPrezime()}"></h5> th:text="${korisnik.getIme() + ' ' + korisnik.getPrezime()}"></h5>
<p class="card-text" <p class="card-text"
...@@ -321,20 +313,12 @@ ...@@ -321,20 +313,12 @@
Email:<span th:text="${korisnik.getEmail()}"></span><br> Email:<span th:text="${korisnik.getEmail()}"></span><br>
Telefon:<span th:text="${korisnik.getTelefon()}"></span> Telefon:<span th:text="${korisnik.getTelefon()}"></span>
</p> </p>
<button class="btn btn-primary" <button class="btn btn-dark"
th:onclick="window.open('/chat?email='+[[${korisnik.getEmail()}]],'mywindow','menubar=1,width=650,height=900')"> th:onclick="window.open('/chat?email='+[[${korisnik.getEmail()}]],'mywindow','menubar=1,width=650,height=900')">
Posaljite poruku <i class="fas fa-sms"></i> Chat
</button> </button>
</div> </div>
</div> <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">
<div class="col-md-3 d-flex flex-column justify-content-around align-items-center">
<div class="card-body">
<p class="card-text">
<span th:text="${zahtevi[korisnikStat.index].datum + ' ' + zahtevi[korisnikStat.index].vreme}"></span>
</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}"> <form method="get" th:action="@{/oceni-korisnika}">
<input type="text" th:value="${oglas.oglasId}" name="oglasId" <input type="text" th:value="${oglas.oglasId}" name="oglasId"
style="display: none"/> style="display: none"/>
...@@ -344,6 +328,9 @@ ...@@ -344,6 +328,9 @@
style="display: none"> style="display: none">
<input type="text" th:value="${zahtevi[korisnikStat.index].zahtevId}" <input type="text" th:value="${zahtevi[korisnikStat.index].zahtevId}"
name="zahtevId" style="display: none"> name="zahtevId" style="display: none">
<textarea class="form-control" id="exampleFormControlTextarea1"
rows="2"
name="komentar"></textarea>
<div class="starrating risingstar d-flex justify-content-center flex-row-reverse"> <div class="starrating risingstar d-flex justify-content-center flex-row-reverse">
<input type="radio" <input type="radio"
th:id="${'star' + zahtevi[korisnikStat.index].zahtevId + '-5'}" th:id="${'star' + zahtevi[korisnikStat.index].zahtevId + '-5'}"
...@@ -370,21 +357,28 @@ ...@@ -370,21 +357,28 @@
name="ocenaRadio" value="1"/><label name="ocenaRadio" value="1"/><label
th:for="${'star' + zahtevi[korisnikStat.index].zahtevId + '-1'}" th:for="${'star' + zahtevi[korisnikStat.index].zahtevId + '-1'}"
title="1 star"></label> title="1 star"></label>
<textarea class="form-control h-100" id="exampleFormControlTextarea1"
rows="3"
name="komentar"></textarea>
</div> </div>
<button class="btn btn-primary" type="submit">Oceni</button> <div class="row flex-row justify-content-between align-items-center">
<button class="btn btn-primary w-40" type="submit">Oceni</button>
<button class="btn btn-primary w-40" type="button"
onclick="document.getElementById('formaZavrsi').submit(); return false;">
Zavrsi
</button>
</div>
</form> </form>
<form method="get" th:action="@{/oceni-bez-komentara}"> <form method="get" th:action="@{/oceni-bez-komentara}" id="formaZavrsi">
<input type="text" th:value="${zahtevi[korisnikStat.index].zahtevId}" <input type="text" th:value="${zahtevi[korisnikStat.index].zahtevId}"
name="zahtevId" style="display: none"> name="zahtevId" style="display: none">
<input type="text" th:value="${oglas.oglasId}" <input type="text" th:value="${oglas.oglasId}"
name="oglasId" style="display: none"> name="oglasId" style="display: none">
<button class="btn btn-primary" type="submit">Završi</button>
</form> </form>
</div> </div>
<div class="col-md-2 d-flex flex-column justify-content-around align-items-center" <div class="col-lg-2 col-md-12 col-sm-12 col-xs-12 d-flex flex-column justify-content-around align-items-center">
<p class="card-text">
<span th:text="${zahtevi[korisnikStat.index].datum + ' ' + zahtevi[korisnikStat.index].vreme}"></span>
</p>
</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'}"> th:if="${zahtevi[korisnikStat.index].status.toString() == 'CEKANJE'}">
<form method="GET" <form method="GET"
th:action="@{/oglas-edit/{oglasId}/prihvati-zahtev/{zahtevId}(oglasId=${zahtevi[korisnikStat.index].oglasId},zahtevId=${zahtevi[korisnikStat.index].zahtevId})}"> th:action="@{/oglas-edit/{oglasId}/prihvati-zahtev/{zahtevId}(oglasId=${zahtevi[korisnikStat.index].oglasId},zahtevId=${zahtevi[korisnikStat.index].zahtevId})}">
...@@ -396,11 +390,9 @@ ...@@ -396,11 +390,9 @@
<button type="submit" class="btn btn-danger">Odbij zahtev</button> <button type="submit" class="btn btn-danger">Odbij zahtev</button>
</form> </form>
</div> </div>
<div class="col-md-2 d-flex flex-column justify-content-around align-items-center" <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'}"> th:if="${zahtevi[korisnikStat.index].status.toString() == 'ODBIJEN'}">
<form method="GET" <form method="GET">
>
<!--OBRISI ZAHTEV TH:ACTION="@{/oglas-edit/{oglasId}/obrisi-zahtev/}"-->
<button type="submit" class="btn btn-danger">Obrisi zahtev</button> <button type="submit" class="btn btn-danger">Obrisi zahtev</button>
</form> </form>
</div> </div>
...@@ -409,7 +401,6 @@ ...@@ -409,7 +401,6 @@
</div> </div>
</div> </div>
</div> </div>
</div>
</div> </div>
<div class="container-fluid pb-0 mb-0 justify-content-center text-light "> <div class="container-fluid pb-0 mb-0 justify-content-center text-light ">
......
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