Changeset 0fb69cc
- Timestamp:
- 02/06/23 20:10:28 (22 months ago)
- Branches:
- master
- Children:
- d09caa7
- Parents:
- b5ce654
- Location:
- src/main
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/com/example/moviezone/model/Event.java
rb5ce654 r0fb69cc 24 24 String duration; 25 25 String repeating; 26 26 String img_url; 27 27 LocalDate start_date; 28 28 29 public Event(String theme, String duration, String repeating, LocalDate start_date ) {29 public Event(String theme, String duration, String repeating, LocalDate start_date,String img_url) { 30 30 this.theme = theme; 31 31 this.duration = duration; 32 this.img_url=img_url; 32 33 this.repeating = repeating; 33 34 this.start_date = start_date; … … 37 38 38 39 } 40 39 41 } -
src/main/java/com/example/moviezone/service/EventService.java
rb5ce654 r0fb69cc 8 8 public interface EventService { 9 9 List<Event> findAllEvents(); 10 Event save(LocalDate start_date,String theme,String duration,String repeating );10 Event save(LocalDate start_date,String theme,String duration,String repeating,String url); 11 11 } -
src/main/java/com/example/moviezone/service/Impl/EventServiceImpl.java
rb5ce654 r0fb69cc 23 23 24 24 @Override 25 public Event save(LocalDate start_date, String theme, String duration, String repeating ) {26 return eventRepository.save(new Event(theme,duration,repeating,start_date ));25 public Event save(LocalDate start_date, String theme, String duration, String repeating,String img_url) { 26 return eventRepository.save(new Event(theme,duration,repeating,start_date,img_url)); 27 27 } 28 28 } -
src/main/java/com/example/moviezone/web/HomeController.java
rb5ce654 r0fb69cc 2 2 3 3 4 import com.example.moviezone.model.Customer; 5 import com.example.moviezone.model.Film; 6 import com.example.moviezone.model.Role; 7 import com.example.moviezone.model.User; 4 import com.example.moviezone.model.*; 8 5 import com.example.moviezone.model.exceptions.PasswordsDoNotMatchException; 9 6 import com.example.moviezone.model.exceptions.UserNotFoundException; … … 45 42 List<Film> films=filmService.findAllFilms(); 46 43 films=films.stream().limit(5).collect(Collectors.toList()); 44 List <Event> events=eventService.findAllEvents().stream().limit(5).collect(Collectors.toList()); 47 45 model.addAttribute("films", films); 46 model.addAttribute("events",events); 48 47 model.addAttribute("bodyContent", "home"); 49 48 … … 177 176 @RequestParam String theme, 178 177 @RequestParam String duration, 178 @RequestParam String img_url, 179 179 @RequestParam String repeating) 180 180 { 181 eventService.save(start_date,theme,duration,repeating );181 eventService.save(start_date,theme,duration,repeating,img_url); 182 182 return "redirect:/home"; 183 183 } -
src/main/resources/templates/addEvent.html
rb5ce654 r0fb69cc 38 38 > 39 39 </div> 40 <div class="form-group"> 41 <label for="img_url">Image Url</label> 42 <input type="text" 43 class="form-control" 44 id="img_url" 45 name="img_url" 46 placeholder="URL"> 47 </div> 40 48 41 <button id="submit" type="submit" class="btn btn-primary">Add Event</button>49 <button style="background-color: #ff5019" id="submit" type="submit" class="btn btn-primary">Add Event</button> 42 50 </form> 43 51 </div> -
src/main/resources/templates/addFilm.html
rb5ce654 r0fb69cc 79 79 </div> 80 80 81 <button id="submit" type="submit" class="btn btn-primary">Add Film</button>81 <button style="background-color: #ff5019" id="submit" type="submit" class="btn btn-primary">Add Film</button> 82 82 </form> 83 83 </div> -
src/main/resources/templates/addProjection.html
rb5ce654 r0fb69cc 42 42 </div> 43 43 44 <button id="submit" type="submit" class="btn btn-primary">Add Projection</button>44 <button style="background-color: #ff5019" id="submit" type="submit" class="btn btn-primary">Add Projection</button> 45 45 </form> 46 46 </div> -
src/main/resources/templates/films.html
rb5ce654 r0fb69cc 221 221 </div> 222 222 </div> 223 <div th:each="film : ${films}" class="container"> 224 <div class="card"> 225 <div class="imgBx"> 226 <img th:src="@{${film.getUrl()}}"/> 227 </div> 228 <div class="contentBx"> 229 <h2 th:text="${film.getName()}"></h2> 230 <div class="size"> 231 <h3>Duration :</h3> 232 <span th:text="${film.getDuration()}"></span> 233 </div> 234 <div class="color"> 235 <h3>Genre:</h3> 236 <span th:text="${film.getGenre()}"></span> 237 </div> 238 <form th:action="@{'/home/getFilm/{id}' (id=${film.getId_film()})}" 239 th:method="GET"> 240 <button class="button" type="submit">Details</button> 241 </form> 242 243 244 </div> 245 </div> 246 </div> 223 247 </div> 224 248 </div> -
src/main/resources/templates/fragments/header.html
rb5ce654 r0fb69cc 61 61 <nav class="menu"> 62 62 <ul class="menu-left"> 63 <li class="begin"><a href=" #!">MovieZone</a></li>63 <li class="begin"><a href="/home">MovieZone</a></li> 64 64 <li class="begin"><a href="/films">Филмови</a></li> 65 65 <li class="begin"><a href="/projections">Програма</a></li> -
src/main/resources/templates/home.html
rb5ce654 r0fb69cc 196 196 </style> 197 197 <div xmlns:th="http://www.thymeleaf.org"> 198 <h1 style="color: white">Нови Филмови</h1> 198 199 <div class="main"> 199 200 <div th:each="film : ${films}" class="container"> … … 221 222 </div> 222 223 </div> 223 </div> 224 </div> 224 225 </div> 226 <h1 style="color: white">Следни Настани:</h1> 227 <div class="main"> 228 <div th:each="event: ${events}" class="container"> 229 <div class="card"> 230 <div class="imgBx"> 231 <img th:src="@{${event.getImg_url()}}"/> 232 </div> 233 <div class="contentBx"> 234 <h2 th:text="${event.getTheme()}"></h2> 235 <div class="size"> 236 <h3>Start Date :</h3> 237 <span th:text="${event.getStart_date()}"></span> 238 </div> 239 <div class="color"> 240 <h3>Duration:</h3> 241 <span th:text="${event.getDuration()}"></span> 242 </div> 243 <form th:action="@{'/home/getFilm/{id}' (id=${event.getId_event()})}" 244 th:method="GET"> 245 <button class="button" type="submit">Details</button> 246 </form> 247 </div> 248 </div> 249 </div> 250 </div> 251 </div>
Note:
See TracChangeset
for help on using the changeset viewer.