Commit d16b985a by Nikola Markovic

Dodato:

index filter - front
parent 75be4f70
...@@ -3,6 +3,7 @@ package com.example.SkuciSe.controller; ...@@ -3,6 +3,7 @@ package com.example.SkuciSe.controller;
import com.example.SkuciSe.configuration.EmailPostoji; import com.example.SkuciSe.configuration.EmailPostoji;
import com.example.SkuciSe.model.korisnik.Korisnik; import com.example.SkuciSe.model.korisnik.Korisnik;
import com.example.SkuciSe.model.korisnik.KorisnikDetails; import com.example.SkuciSe.model.korisnik.KorisnikDetails;
import com.example.SkuciSe.model.oglas.Oglas;
import com.example.SkuciSe.repository.KorisnikRepository; import com.example.SkuciSe.repository.KorisnikRepository;
import com.example.SkuciSe.repository.LokacijaRepository; import com.example.SkuciSe.repository.LokacijaRepository;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -27,6 +28,8 @@ public class AppController ...@@ -27,6 +28,8 @@ public class AppController
public String getIndex(Model model, @AuthenticationPrincipal KorisnikDetails korisnik) public String getIndex(Model model, @AuthenticationPrincipal KorisnikDetails korisnik)
{ {
model.addAttribute("loggedUser", korisnik); model.addAttribute("loggedUser", korisnik);
model.addAttribute("lokacije", lRepo.findAll());
model.addAttribute("filter", new Oglas());
return("index"); return("index");
} }
......
...@@ -512,3 +512,9 @@ img { ...@@ -512,3 +512,9 @@ img {
hsl(0, 0%, 68%) 100% hsl(0, 0%, 68%) 100%
); );
} }
#index-vrsta-smestaja {
display: flex;
justify-content: space-between;
align-items: center;
}
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en" xmlns="http://www.w3.org/1999/html" xmlns:th="http://www.w3.org/1999/xhtml">
<head> <head>
<meta charset="utf-8"/> <meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"/> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"/>
...@@ -92,7 +92,50 @@ ...@@ -92,7 +92,50 @@
</nav> </nav>
<div class="container-main pozadinaSVG d-flex justify-content-center align-items-center"> <div class="container-main pozadinaSVG d-flex justify-content-center align-items-center">
<h1 class="animate__animated animate__slideInDown">Dobrodosli</h1> <div class="row">
<div class="form-holder">
<div class="form-content">
<div class="form-items" style="width: 50vw">
<h1>Pretrazite smestaj</h1>
<form class="requires-validation d-flex flex-wrap justify-content-around align-items-center"
novalidate th:object="${filter}" method="POST"
th:action="@{/lista-oglasa}" enctype="multipart/form-data">
<div>
<div class="col-md-12">
<select th:field="${filter.lokacijaId}">
<option th:each="lokacija: ${lokacije}" th:value="${lokacija.getLokacijaId()}"
th:text="${lokacija.getNaziv()}">
</option>
</select>
</div>
</div>
<div class="col-6 d-flex justify-content-around align-items-center flex-row mt-3" /*style="min-width:250px*/">
<div>
<input checked class="form-check-input" type="radio" name="flexRadioDefault"
id="flexRadioDefault1" value="1" th:field="${filter.vrstaOglasaId}">
<label class="form-check-label" for="flexRadioDefault1">
Prodaja
</label>
</div>
<div>
<input class="form-check-input" type="radio" name="flexRadioDefault"
id="flexRadioDefault2" value="2" th:field="${filter.vrstaOglasaId}">
<label class="form-check-label" for="flexRadioDefault2">
Izdavanje
</label>
</div>
</div>
<div class="form-button mt-3">
<button id="submit" type="submit" class="btn btn-primary">Pretrazi</button>
</div>
</form>
</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