Changeset e272096
- Timestamp:
- 02/18/24 22:01:54 (9 months ago)
- Branches:
- master
- Children:
- 4251327
- Parents:
- bde8b13
- Location:
- src/main
- Files:
-
- 2 added
- 28 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/mk/ukim/finki/busngo/repository/BiletRepository.java
rbde8b13 re272096 15 15 // List<Bilet> findAllByKorisnikByPatnikKId(Korisnik korisnik); 16 16 Optional<Bilet> findByBIdAndAndKorisnikByPatnikKId(Long bid, Patnik patnik); 17 // List<Bilet> findAllByKorisnikByPatnikKIdAndBStatus(Patnik patnik, BILET_STATUS status); 17 18 } -
src/main/java/mk/ukim/finki/busngo/repository/VozenjeRepository.java
rbde8b13 re272096 3 3 import mk.ukim.finki.busngo.model.entities.Patnik; 4 4 import mk.ukim.finki.busngo.model.entities.Vozenje; 5 import mk.ukim.finki.busngo.model.enums.VOZENJE_STATUS; 5 6 import org.springframework.data.jpa.repository.JpaRepository; 6 7 … … 9 10 public interface VozenjeRepository extends JpaRepository<Vozenje, Long> { 10 11 List<Vozenje> findAllByKorisnikByPatnikKId(Patnik patnik); 12 List<Vozenje> findAllByKorisnikByPatnikKIdAndAndVozenjeStatus(Patnik patnik, VOZENJE_STATUS vozenjeStatus); 11 13 } -
src/main/java/mk/ukim/finki/busngo/service/AuthService.java
rbde8b13 re272096 2 2 3 3 import mk.ukim.finki.busngo.model.entities.Korisnik; 4 import mk.ukim.finki.busngo.model.enums.VrabotenType; 4 5 5 6 public interface AuthService { 6 7 Korisnik login(String email, String password); 7 8 Korisnik registerPatnik(String ime, String email, String password, String confirmPassword, String address, String telefon); 9 Korisnik registerVraboten(String ime, String email, String password, String confirmPassword, String address, String telefon, VrabotenType type, Double salary); 8 10 9 11 } -
src/main/java/mk/ukim/finki/busngo/service/BiletService.java
rbde8b13 re272096 16 16 17 17 List<Bilet> findAllByPatnikEmail(String email); 18 // List<Bilet> findAllByPatnikEmailACTIVE(String email); 18 19 Bilet findBybIdAndPatnikEmail(Long bId, String email); 19 20 -
src/main/java/mk/ukim/finki/busngo/service/InstancaNaLinijaService.java
rbde8b13 re272096 11 11 Instancanalinija findById(Long inlId); 12 12 Instancanalinija start(Long liId, String a_registracija, String email); 13 Instancanalinija end(Long inlId );13 Instancanalinija end(Long inlId, String email); 14 14 List<Instancanalinija> findAllActive(); 15 15 -
src/main/java/mk/ukim/finki/busngo/service/KaznaService.java
rbde8b13 re272096 8 8 List<Kazna> findAll(); 9 9 List<Kazna> findAllByKontrolaId(Long kontrolaId); 10 Kazna pay(Long kaznaId); 11 Kazna findById(Long id); 10 12 } -
src/main/java/mk/ukim/finki/busngo/service/KaznaZaRegistriranService.java
rbde8b13 re272096 1 1 package mk.ukim.finki.busngo.service; 2 2 3 import mk.ukim.finki.busngo.model.entities.Kazna; 3 4 import mk.ukim.finki.busngo.model.entities.Kaznazaregistriran; 4 5 import mk.ukim.finki.busngo.model.exceptions.UserShouldNotBeTicketedException; … … 10 11 11 12 Kaznazaregistriran create(Long kontrolaId, String dokument, Double iznos, Long patnik, String email) throws UserShouldNotBeTicketedException; 13 Kaznazaregistriran pay(Long kaznaId); 14 Kaznazaregistriran findById(Long id); 12 15 } -
src/main/java/mk/ukim/finki/busngo/service/VozenjeService.java
rbde8b13 re272096 2 2 3 3 import mk.ukim.finki.busngo.model.entities.Vozenje; 4 import mk.ukim.finki.busngo.model.enums.VOZENJE_STATUS; 4 5 5 6 import java.util.List; … … 7 8 public interface VozenjeService { 8 9 List<Vozenje> findVozenjaByPatnik(String email); 10 List<Vozenje> findVozenjaByPatnikAndStatus(String email, VOZENJE_STATUS status); 9 11 Vozenje start(String email, Long bId, Long pnlId, Long inlId); 10 12 Vozenje end(Long vozenjeId, Long pnlId); -
src/main/java/mk/ukim/finki/busngo/service/impl/AuthServiceImpl.java
rbde8b13 re272096 1 1 package mk.ukim.finki.busngo.service.impl; 2 2 3 import mk.ukim.finki.busngo.model.entities.Kondukter; 3 4 import mk.ukim.finki.busngo.model.entities.Korisnik; 4 5 import mk.ukim.finki.busngo.model.entities.Patnik; 6 import mk.ukim.finki.busngo.model.entities.Vozac; 7 import mk.ukim.finki.busngo.model.enums.VrabotenType; 5 8 import mk.ukim.finki.busngo.model.exceptions.InvalidCredentialsException; 6 9 import mk.ukim.finki.busngo.model.exceptions.UserAlreadyExistsException; 10 import mk.ukim.finki.busngo.repository.KondukterRepository; 7 11 import mk.ukim.finki.busngo.repository.KorisnikRepository; 8 12 import mk.ukim.finki.busngo.repository.PatnikRepository; 9 import mk.ukim.finki.busngo.service.AuthService; 13 import mk.ukim.finki.busngo.repository.VozacRepository; 14 import mk.ukim.finki.busngo.service.*; 10 15 import org.springframework.security.crypto.password.PasswordEncoder; 11 16 import org.springframework.stereotype.Service; 17 18 import java.sql.Date; 19 import java.time.LocalDate; 12 20 13 21 @Service … … 15 23 private final KorisnikRepository korisnikRepository; 16 24 private final PatnikRepository patnikRepository; 25 private final VozacRepository vozacRepository; 26 private final KondukterRepository kondukterRepository; 17 27 private final PasswordEncoder passwordEncoder; 28 private final PatnikService patnikService; 29 private final KondukterService kondukterService; 30 private final VozacService vozacService; 18 31 19 public AuthServiceImpl(KorisnikRepository korisnikRepository, PatnikRepository patnikRepository, PasswordEncoder passwordEncoder) {32 public AuthServiceImpl(KorisnikRepository korisnikRepository, PatnikRepository patnikRepository, VozacRepository vozacRepository, KondukterRepository kondukterRepository, PasswordEncoder passwordEncoder, PatnikService patnikService, KondukterService kondukterService, VozacService vozacService) { 20 33 this.korisnikRepository = korisnikRepository; 21 34 this.patnikRepository = patnikRepository; 35 this.vozacRepository = vozacRepository; 36 this.kondukterRepository = kondukterRepository; 22 37 this.passwordEncoder = passwordEncoder; 38 this.patnikService = patnikService; 39 this.kondukterService = kondukterService; 40 this.vozacService = vozacService; 23 41 } 24 42 … … 52 70 korisnik.setKIsAdmin(false); 53 71 72 return patnikRepository.save(korisnik); 73 } 54 74 55 return patnikRepository.save(korisnik); 75 @Override 76 public Korisnik registerVraboten(String ime, String email, String password, String confirmPassword, String address, String telefon, VrabotenType type, Double salary) { 77 if (email == null || password == null || email.isEmpty() || password.isEmpty()) { 78 throw new InvalidCredentialsException(); 79 } 80 81 if (!password.equals(confirmPassword)) { 82 throw new InvalidCredentialsException(); 83 } 84 85 if(this.korisnikRepository.findByKEmail(email).isPresent()) { 86 throw new UserAlreadyExistsException(email); 87 } 88 89 90 switch (type){ 91 case ADMIN: 92 Korisnik korisnik = new Korisnik(); 93 korisnik.setKIme(ime); 94 korisnik.setKAdresa(address); 95 korisnik.setKLozinka(passwordEncoder.encode(password)); 96 korisnik.setKEmail(email); 97 korisnik.setKTelefon(telefon); 98 korisnik.setKIsAdmin(true); 99 return korisnikRepository.save(korisnik); 100 case VOZAC: 101 Vozac vozac = new Vozac(); 102 vozac.setKIme(ime); 103 vozac.setKAdresa(address); 104 vozac.setKLozinka(passwordEncoder.encode(password)); 105 vozac.setKEmail(email); 106 vozac.setKTelefon(telefon); 107 vozac.setKIsAdmin(false); 108 vozac.setVPlata(salary); 109 vozac.setVDatumNaVrabotuvanje(Date.valueOf(LocalDate.now())); 110 this.korisnikRepository.save(vozac); 111 112 return vozacRepository.save(vozac); 113 case KONDUKTER: 114 Kondukter kondukter = new Kondukter(); 115 kondukter.setKIme(ime); 116 kondukter.setKAdresa(address); 117 kondukter.setKLozinka(passwordEncoder.encode(password)); 118 kondukter.setKEmail(email); 119 kondukter.setKTelefon(telefon); 120 kondukter.setKIsAdmin(false); 121 kondukter.setVPlata(salary); 122 kondukter.setVDatumNaVrabotuvanje(Date.valueOf(LocalDate.now())); 123 this.korisnikRepository.save(kondukter); 124 125 return kondukterRepository.save(kondukter); 126 } 127 return null; 56 128 } 57 129 -
src/main/java/mk/ukim/finki/busngo/service/impl/BiletServiceImpl.java
rbde8b13 re272096 16 16 import org.springframework.security.crypto.password.PasswordEncoder; 17 17 import org.springframework.stereotype.Service; 18 import org.thymeleaf.expression.Lists; 18 19 19 20 import java.sql.Timestamp; … … 75 76 } 76 77 78 // @Override 79 // public List<Bilet> findAllByPatnikEmailACTIVE(String email) { 80 // Patnik patnik = patnikService.loadUserByEmail(email); 81 // List<Bilet> allByKorisnikByPatnikKIdAndBStatus = biletRepository.findAllByKorisnikByPatnikKIdAndBStatus(patnik, BILET_STATUS.ACTIVE); 82 // List<Bilet> allByKorisnikByPatnikKIdAndBStatus1 = biletRepository.findAllByKorisnikByPatnikKIdAndBStatus(patnik, BILET_STATUS.INACTIVE); 83 // allByKorisnikByPatnikKIdAndBStatus1.addAll(allByKorisnikByPatnikKIdAndBStatus); 84 // return allByKorisnikByPatnikKIdAndBStatus1; 85 // } 86 77 87 @Override 78 88 public Bilet findBybIdAndPatnikEmail(Long bId, String email) { -
src/main/java/mk/ukim/finki/busngo/service/impl/InstancaNaLinijaServiceImpl.java
rbde8b13 re272096 52 52 53 53 @Override 54 public Instancanalinija end(Long inlId) { 54 public Instancanalinija end(Long inlId, String email) { 55 Vozac vozac = vozacService.findByEmail(email); 55 56 Instancanalinija instancanalinija = this.findById(inlId); 56 57 instancanalinija.setInlDatumEnd(Timestamp.valueOf(LocalDateTime.now())); -
src/main/java/mk/ukim/finki/busngo/service/impl/KaznaServiceImpl.java
rbde8b13 re272096 8 8 import org.springframework.stereotype.Service; 9 9 10 import java.sql.Timestamp; 11 import java.time.LocalDateTime; 10 12 import java.util.List; 11 13 … … 30 32 return kaznaRepository.findAllByKontroliByKontrolaId(kontroli); 31 33 } 34 35 @Override 36 public Kazna pay(Long kaznaId) { 37 Kazna kazna = this.findById(kaznaId); 38 kazna.setKzPlateno(true); 39 kazna.setKzDatumPlateno(Timestamp.valueOf(LocalDateTime.now())); 40 return kaznaRepository.save(kazna); 41 } 42 43 @Override 44 public Kazna findById(Long id) { 45 return kaznaRepository.findById(id).orElseThrow(RuntimeException::new); 46 } 32 47 } -
src/main/java/mk/ukim/finki/busngo/service/impl/KaznaZaRegistriranServiceImpl.java
rbde8b13 re272096 59 59 kontroli.getInstancanalinijaByInlId().getInlId())); 60 60 } 61 62 @Override 63 public Kaznazaregistriran pay(Long kaznaId) { 64 Kaznazaregistriran kazna = this.findById(kaznaId); 65 if(!kazna.getKzPlateno()){ 66 kazna.setKzPlateno(true); 67 kazna.setKzDatumPlateno(Timestamp.valueOf(LocalDateTime.now())); 68 } 69 return kaznaZaRegistriranRepository.save(kazna); 70 } 71 72 @Override 73 public Kaznazaregistriran findById(Long id) { 74 return kaznaZaRegistriranRepository.findById(id).orElseThrow(RuntimeException::new); 75 } 61 76 } -
src/main/java/mk/ukim/finki/busngo/service/impl/VozenjeServiceImpl.java
rbde8b13 re272096 33 33 Patnik patnik = patnikService.loadUserByEmail(email); 34 34 return vozenjeRepository.findAllByKorisnikByPatnikKId(patnik); 35 } 36 37 @Override 38 public List<Vozenje> findVozenjaByPatnikAndStatus(String email, VOZENJE_STATUS status) { 39 Patnik patnik = patnikService.loadUserByEmail(email); 40 return vozenjeRepository.findAllByKorisnikByPatnikKIdAndAndVozenjeStatus(patnik, status); 35 41 } 36 42 -
src/main/java/mk/ukim/finki/busngo/web/BiletController.java
rbde8b13 re272096 41 41 Patnik patnik = null; 42 42 try{ 43 patnik = patnikService.loadUserByEmail(authentication.getName()); 43 44 model.addAttribute("bileti", biletService.findAllByPatnikEmail(authentication.getName())); 44 45 } -
src/main/java/mk/ukim/finki/busngo/web/InstancaNaLinijaController.java
rbde8b13 re272096 71 71 72 72 @PostMapping("/{inlId}/end") 73 public String endInstanca(@PathVariable Long inlId){ 74 Instancanalinija ended = instancaNaLinijaService.end(inlId); 73 public String endInstanca(@PathVariable Long inlId, 74 Authentication authentication){ 75 Instancanalinija ended = instancaNaLinijaService.end(inlId, authentication.getName()); 75 76 return "redirect:/instanca-na-linija/" + ended.getInlId(); 76 77 } -
src/main/java/mk/ukim/finki/busngo/web/KaznaController.java
rbde8b13 re272096 9 9 import org.springframework.ui.Model; 10 10 import org.springframework.web.bind.annotation.GetMapping; 11 import org.springframework.web.bind.annotation.PathVariable; 12 import org.springframework.web.bind.annotation.PostMapping; 11 13 import org.springframework.web.bind.annotation.RequestMapping; 12 14 … … 37 39 return "master-template"; 38 40 } 41 42 @PostMapping("/{id}/pay") 43 public String pay(@PathVariable Long id, 44 Model model){ 45 kaznaZaRegistriranService.pay(id); 46 return "redirect:/kazna"; 47 } 48 39 49 } -
src/main/java/mk/ukim/finki/busngo/web/RegisterController.java
rbde8b13 re272096 2 2 3 3 import mk.ukim.finki.busngo.model.entities.Korisnik; 4 import mk.ukim.finki.busngo.model.enums.VrabotenType; 4 5 import mk.ukim.finki.busngo.model.exceptions.InvalidCredentialsException; 5 6 import mk.ukim.finki.busngo.model.exceptions.UserAlreadyExistsException; … … 34 35 } 35 36 37 model.addAttribute("types", VrabotenType.values()); 38 36 39 model.addAttribute("bodyContent", "register"); 37 40 return "master-template"; … … 44 47 @RequestParam String confirmPassword, 45 48 @RequestParam String address, 46 @RequestParam String phone 47 ) { 49 @RequestParam String phone, 50 @RequestParam(required = false)VrabotenType vrabotenType, 51 @RequestParam(required = false) Double salary 52 ) { 48 53 try{ 49 Korisnik korisnik = this.authService.registerPatnik(name, email, password, confirmPassword, address, phone); 50 this.patnikService.save(korisnik); 54 Korisnik korisnik; 55 if(vrabotenType != null){ 56 korisnik = this.authService.registerVraboten(name, email, password, confirmPassword, address, phone, vrabotenType, salary); 57 58 } 59 else 60 korisnik = this.authService.registerPatnik(name, email, password, confirmPassword, address, phone); 51 61 return "redirect:/login"; 52 62 } catch (InvalidCredentialsException | UserAlreadyExistsException exception) { -
src/main/java/mk/ukim/finki/busngo/web/VozenjeController.java
rbde8b13 re272096 4 4 import mk.ukim.finki.busngo.model.entities.Patnik; 5 5 import mk.ukim.finki.busngo.model.entities.Vozenje; 6 import mk.ukim.finki.busngo.model.enums.VOZENJE_STATUS; 6 7 import mk.ukim.finki.busngo.model.exceptions.InvalidPatnikIdException; 7 8 import mk.ukim.finki.busngo.model.exceptions.InvalidPostojkaNaLinijaIdException; … … 29 30 @GetMapping() 30 31 public String getVozenjePage(Model model, 31 Authentication authentication){ 32 Authentication authentication, 33 @RequestParam(required = false) VOZENJE_STATUS status){ 32 34 model.addAttribute("bodyContent", "listVozenja"); 33 35 Patnik patnik = null; 34 36 try{ 35 model.addAttribute("vozenja", vozenjeService.findVozenjaByPatnik(authentication.getName())); 37 if(status != null) 38 model.addAttribute("vozenja", vozenjeService.findVozenjaByPatnikAndStatus(authentication.getName(), status)); 39 else 40 model.addAttribute("vozenja", vozenjeService.findVozenjaByPatnikAndStatus(authentication.getName(), VOZENJE_STATUS.ACTIVE)); 41 model.addAttribute("vozStatus", VOZENJE_STATUS.values()); 36 42 } 37 43 catch (InvalidPatnikIdException e){ -
src/main/resources/templates/fragments/header.html
rbde8b13 re272096 10 10 <div class="collapse navbar-collapse justify-content-end" id="navbarsExampleDefault"> 11 11 <ul class="navbar-nav m-auto"> 12 <li class="nav-item m-auto">12 <li sec:hasRole class="nav-item m-auto"> 13 13 <a class="nav-link active" href="/bilet">Bileti</a> 14 14 </li> … … 42 42 <a class="nav-link" href="#"></a> 43 43 </li> 44 <li class="nav-item"> 45 <a class="btn btn-success btn-sm ml-3" href="/shopping-cart"> 46 <i class="fa fa-shopping-cart"></i> Cart 47 </a> 48 </li> 44 49 45 <li class="nav-item" sec:authorize="isAuthenticated()"> 50 46 <a href="#" class="btn btn-light btn-sm ml-3" sec:authentication="name"> -
src/main/resources/templates/kontrola.html
rbde8b13 re272096 1 1 <div xmlns:th="http://www.thymeleaf.org"> 2 <section class="jumbotron text-center">3 <div class="container">4 <h1 class="jumbotron-heading">WEB PROGRAMMING SHOP</h1>5 <h3 class="jumbotron-heading">All products</h3>6 </div>7 </section>8 2 3 <div class="container mb-4"> 4 <div class="row"> 5 <div class="col-12" > 9 6 10 7 <form class="form-signin mt-xl-5" method="post" th:action="@{'/kontrola/{id}/kazni-neregistriran'(id=${kontrola.kontrolaId})}"> … … 12 9 13 10 <p> 14 <label for="dokument" class="sr-only">Email</label>11 <label for="dokument" >Dokument</label> 15 12 <input class="form-control" name="dokument" id="dokument" type="text"> 16 13 </p> … … 18 15 19 16 <p> 20 <label for="telefon" class="sr-only">Telefon</label>17 <label for="telefon" >Telefon</label> 21 18 <input class="form-control" name="telefon" id="telefon" type="text"> 22 19 </p> 23 20 24 21 <p> 25 <label for="ime" class="sr-only">Ime</label>22 <label for="ime" >Ime</label> 26 23 <input class="form-control" name="ime" id="ime" type="text"> 27 24 </p> 28 25 29 26 <p> 30 <label for="adresa" class="sr-only">Adresa</label>27 <label for="adresa" >Adresa</label> 31 28 <input class="form-control" name="adresa" id="adresa" type="text"> 32 29 </p> … … 34 31 35 32 <p> 36 <label for="iznos" class="sr-only">Iznos</label>33 <label for="iznos" >Iznos</label> 37 34 <input class="form-control" name="iznos" id="iznos" type="number"> 38 35 </p> … … 49 46 50 47 48 51 49 <form class="form-signin mt-xl-5" method="post" th:action="@{'/kontrola/{id}/kazni-registriran'(id=${kontrola.kontrolaId})}"> 52 50 <h2 class="form-signin-heading">Kazna za regirstiran</h2> 53 51 54 52 <p> 55 <label for="dk" class="sr-only">Dokument</label>53 <label for="dk" >Dokument</label> 56 54 <input class="form-control" name="dokument" id="dk" type="text"> 57 55 </p> 58 56 59 57 <p> 60 <label for="iz" class="sr-only">Iznos</label>58 <label for="iz" >Iznos</label> 61 59 <input class="form-control" name="iznos" id="iz" type="number"> 62 60 </p> 63 61 64 62 <p> 65 <label for="patnik" class="sr-only">Patnik</label>63 <label for="patnik" >Patnik</label> 66 64 <select id="patnik" name="patnik" class="form-control"> 67 65 <option th:each="patnik : ${patnici}" … … 82 80 </div> 83 81 </form> 82 83 </div> 84 </div> 85 </div> 86 84 87 85 88 … … 114 117 115 118 <td class="text-right"> 116 <th:block sec:authorize="hasRole('ROLE_ADMIN')">117 <form th:action="@{'/products/delete/{id}' (id=${kazna.kzId})}" 118 th:method="DELETE">119 <button type="submit" 120 class="btn btn-sm btn-danger delete-product">121 <i class="fas fa-trash-alt"></i> Delete 122 </button>123 </form>124 </th:block>119 <!-- <th:block sec:authorize="hasRole('ROLE_ADMIN')">--> 120 <!-- <form th:action="@{'/products/delete/{id}' (id=${kazna.kzId})}"--> 121 <!-- th:method="DELETE">--> 122 <!-- <button type="submit"--> 123 <!-- class="btn btn-sm btn-danger delete-product">--> 124 <!-- <i class="fas fa-trash-alt"></i> Delete--> 125 <!-- </button>--> 126 <!-- </form>--> 127 <!-- </th:block>--> 125 128 </td> 126 129 <td> 127 <th:block sec:authorize="hasRole('ROLE_ADMIN')">128 <a th:href="@{'/products/edit-form/{id}' (id=${kazna.kzId})}" 129 class="btn btn-sm btn-info edit-product">130 <i class="fas fa-edit"></i> Edit 131 </a>132 </th:block>130 <!-- <th:block sec:authorize="hasRole('ROLE_ADMIN')">--> 131 <!-- <a th:href="@{'/products/edit-form/{id}' (id=${kazna.kzId})}"--> 132 <!-- class="btn btn-sm btn-info edit-product">--> 133 <!-- <i class="fas fa-edit"></i> Edit--> 134 <!-- </a>--> 135 <!-- </th:block>--> 133 136 </td> 134 137 <td> 135 <form th:action="@{'/shopping-cart/add-product/{id}' (id=${kazna.kzId})}" 136 th:method="POST"> 137 <button type="submit" class="btn btn-sm btn-success add-to-cart"> 138 <i class="fas fa-shopping-cart"></i> Add to cart 139 </button> 140 </form> 138 141 139 </td> 142 140 </tr> -
src/main/resources/templates/kupiBilet.html
rbde8b13 re272096 1 1 <div xmlns:th="http://www.thymeleaf.org"> 2 <section class="jumbotron text-center"> 3 <div class="container"> 4 <h1 class="jumbotron-heading">WEB PROGRAMMING SHOP</h1> 5 <h3 class="jumbotron-heading">All products</h3> 6 </div> 7 </section> 2 8 3 9 4 <div style="width: 500px"> -
src/main/resources/templates/listBileti.html
rbde8b13 re272096 1 1 <div xmlns:th="http://www.thymeleaf.org"> 2 <section class="jumbotron text-center"> 3 <div class="container"> 4 <h1 class="jumbotron-heading">WEB PROGRAMMING SHOP</h1> 5 <h3 class="jumbotron-heading">All products</h3> 6 </div> 7 </section> 2 8 3 9 4 <div class="container mb-4"> … … 31 26 32 27 <td class="text-right"> 33 <th:block sec:authorize="hasRole('ROLE_ADMIN')">34 <form th:action="@{'/products/delete/{id}' (id=${bilet.bId})}" 35 th:method="DELETE">36 <button type="submit" 37 class="btn btn-sm btn-danger delete-product">38 <i class="fas fa-trash-alt"></i> Delete 39 </button>40 </form>41 </th:block>28 <!-- <th:block sec:authorize="hasRole('ROLE_ADMIN')">--> 29 <!-- <form th:action="@{'/products/delete/{id}' (id=${bilet.bId})}"--> 30 <!-- th:method="DELETE">--> 31 <!-- <button type="submit"--> 32 <!-- class="btn btn-sm btn-danger delete-product">--> 33 <!-- <i class="fas fa-trash-alt"></i> Delete--> 34 <!-- </button>--> 35 <!-- </form>--> 36 <!-- </th:block>--> 42 37 </td> 43 38 <td> 44 <th:block sec:authorize="hasRole('ROLE_ADMIN')">45 <a th:href="@{'/products/edit-form/{id}' (id=${bilet.bId})}" 46 class="btn btn-sm btn-info edit-product">47 <i class="fas fa-edit"></i> Edit 48 </a>49 </th:block>39 <!-- <th:block sec:authorize="hasRole('ROLE_ADMIN')">--> 40 <!-- <a th:href="@{'/products/edit-form/{id}' (id=${bilet.bId})}"--> 41 <!-- class="btn btn-sm btn-info edit-product">--> 42 <!-- <i class="fas fa-edit"></i> Edit--> 43 <!-- </a>--> 44 <!-- </th:block>--> 50 45 </td> 51 46 <td> 52 <form th:action="@{'/shopping-cart/add-product/{id}' (id=${bilet.bId})}" 53 th:method="POST"> 54 <button type="submit" class="btn btn-sm btn-success add-to-cart"> 55 <i class="fas fa-shopping-cart"></i> Add to cart 56 </button> 57 </form> 47 58 48 </td> 59 49 </tr> -
src/main/resources/templates/listInstanci.html
rbde8b13 re272096 1 1 <div xmlns:th="http://www.thymeleaf.org"> 2 <section class="jumbotron text-center"> 3 <div class="container"> 4 <h1 class="jumbotron-heading">WEB PROGRAMMING SHOP</h1> 5 <h3 class="jumbotron-heading">All products</h3> 6 </div> 7 </section> 2 8 3 9 4 <div class="container mb-4"> … … 61 56 th:method="GET"> 62 57 <button type="submit" class="btn btn-sm btn-success add-to-cart"> 63 <i class="fas fa-shopping-cart"></i>Kontrola58 Kontrola 64 59 </button> 65 60 </form> -
src/main/resources/templates/listKazni.html
rbde8b13 re272096 1 1 <div xmlns:th="http://www.thymeleaf.org"> 2 <section class="jumbotron text-center"> 3 <div class="container"> 4 <h1 class="jumbotron-heading">WEB PROGRAMMING SHOP</h1> 5 <h3 class="jumbotron-heading">All products</h3> 6 </div> 7 </section> 2 8 3 9 4 <div class="container mb-4"> … … 16 11 <th scope="col">#</th> 17 12 <th scope="col">Iznos</th> 13 <th scope="col">Datum</th> 18 14 <th scope="col">Plateno</th> 15 <th scope="col">Datum plateno</th> 19 16 <th scope="col">Dokument</th> 20 17 <th scope="col"></th> … … 27 24 <td th:text="${kazna.kzId}"></td> 28 25 <td th:text="${kazna.kzIznos}"></td> 26 <td th:text="${kazna.kzDatum}"></td> 29 27 <td th:text="${kazna.kzPlateno}"></td> 28 <td th:text="${kazna.kzDatumPlateno}"></td> 30 29 <td th:text="${kazna.kzDokument}"></td> 31 30 32 31 <td class="text-right"> 33 <th:block sec:authorize="hasRole('ROLE_ADMIN')">34 <form th:action="@{'/products/delete/{id}' (id=${kazna.kzId})}" 35 th:method="DELETE">36 <button type="submit" 37 class="btn btn-sm btn-danger delete-product">38 <i class="fas fa-trash-alt"></i> Delete 39 </button>40 </form>41 </th:block>32 <!-- <th:block sec:authorize="hasRole('ROLE_ADMIN')">--> 33 <!-- <form th:action="@{'/products/delete/{id}' (id=${kazna.kzId})}"--> 34 <!-- th:method="DELETE">--> 35 <!-- <button type="submit"--> 36 <!-- class="btn btn-sm btn-danger delete-product">--> 37 <!-- <i class="fas fa-trash-alt"></i> Delete--> 38 <!-- </button>--> 39 <!-- </form>--> 40 <!-- </th:block>--> 42 41 </td> 43 42 <td> 44 <th:block sec:authorize="hasRole('ROLE_ADMIN')">45 <a th:href="@{'/products/edit-form/{id}' (id=${kazna.kzId})}" 46 class="btn btn-sm btn-info edit-product">47 <i class="fas fa-edit"></i> Edit 48 </a>49 </th:block>43 <!-- <th:block sec:authorize="hasRole('ROLE_ADMIN')">--> 44 <!-- <a th:href="@{'/products/edit-form/{id}' (id=${kazna.kzId})}"--> 45 <!-- class="btn btn-sm btn-info edit-product">--> 46 <!-- <i class="fas fa-edit"></i> Edit--> 47 <!-- </a>--> 48 <!-- </th:block>--> 50 49 </td> 51 50 <td> 52 <form th:action="@{'/ shopping-cart/add-product/{id}' (id=${kazna.kzId})}"51 <form th:action="@{'/kazna/{id}/pay' (id=${kazna.kzId})}" 53 52 th:method="POST"> 54 53 <button type="submit" class="btn btn-sm btn-success add-to-cart"> 55 <i class="fas fa-shopping-cart"></i> Add to cart54 Pay 56 55 </button> 57 56 </form> -
src/main/resources/templates/listVozenja.html
rbde8b13 re272096 6 6 </div> 7 7 </section> 8 9 <form method="get" action="/vozenje"> 10 <select name="status"> 11 <option th:each="status : ${vozStatus}" th:value="${status}" th:text="${status.name()}"></option> 12 </select> 13 14 <input type="submit" value="Search"> 15 </form> 8 16 9 17 <div class="container mb-4"> … … 33 41 34 42 <td class="text-right"> 35 <th:block sec:authorize="hasRole('ROLE_ADMIN')"> 36 <form th:action="@{'/products/delete/{id}' (id=${vozenje.vozenjeId})}" 37 th:method="DELETE"> 43 <th:block > 44 <form th:action="@{'/vozenje/{id}/end' (id=${vozenje.vozenjeId})}" 45 th:hidden="${vozenje.vozenjeStatus.name().equals('FINISHED')} ? 'true' : 'false'" 46 th:method="GET"> 38 47 <button type="submit" 39 48 class="btn btn-sm btn-danger delete-product"> 40 <i class="fas fa-trash-alt"></i> Delete49 <i class="fas fa-trash-alt"></i> End 41 50 </button> 42 51 </form> … … 44 53 </td> 45 54 <td> 46 <th:block sec:authorize="hasRole('ROLE_ADMIN')">47 <a th:href="@{'/products/edit-form/{id}' (id=${vozenje.vozenjeId})}" 48 class="btn btn-sm btn-info edit-product">49 <i class="fas fa-edit"></i> Edit 50 </a>51 </th:block>55 <!-- <th:block sec:authorize="hasRole('ROLE_ADMIN')">--> 56 <!-- <a th:href="@{'/products/edit-form/{id}' (id=${vozenje.vozenjeId})}"--> 57 <!-- class="btn btn-sm btn-info edit-product">--> 58 <!-- <i class="fas fa-edit"></i> Edit--> 59 <!-- </a>--> 60 <!-- </th:block>--> 52 61 </td> 53 62 <td> 54 <form th:action="@{'/vozenje/{vozenjeId}/end'(vozenjeId=${vozenje.vozenjeId})}" 55 th:method="GET"> 56 <button type="submit" class="btn btn-sm btn-success add-to-cart"> 57 <i class="fas fa-shopping-cart"></i> End vozenje 58 </button> 59 </form> 63 60 64 </td> 61 65 </tr> -
src/main/resources/templates/master-template.html
rbde8b13 re272096 20 20 <header th:replace="fragments/header"/> 21 21 22 <div th:text="${error}"></div> 23 22 24 <section th:include="${bodyContent}"> 23 25 -
src/main/resources/templates/register.html
rbde8b13 re272096 1 1 <div xmlns:th="http://www.thymeleaf.org"> 2 <section class="jumbotron text-center">3 <div class="container">4 <h1 class="jumbotron-heading">WEB PROGRAMMING SHOP</h1>5 <h3 class="jumbotron-heading">All products</h3>6 </div>7 </section>8 2 9 3 <div class="container mb-4"> … … 35 29 </p> 36 30 31 <p sec:authorize="hasRole('ROLE_ADMIN')"> 32 <label for="vrabotenType" class="sr-only">Vraboten Type</label> 33 <select name="vrabotenType" id="vrabotenType"> 34 <option th:each="type : ${types}" 35 th:text="${type.name()}" 36 th:value="${type}" ></option> 37 </select> 38 </p> 39 40 <p sec:authorize="hasRole('ROLE_ADMIN')"> 41 <label for="salary" class="sr-only">Salary</label> 42 <input type="number" id="salary" name="salary"> 43 </p> 44 45 37 46 38 47
Note:
See TracChangeset
for help on using the changeset viewer.