source: Git/src/main/resources/templates/moviesListPaged.html@ ad4243e

main
Last change on this file since ad4243e was 3c0f9a9, checked in by Petar Partaloski <ppartaloski@…>, 3 years ago

Added genre liking, fixed counter, improved paging, improved searches

  • Property mode set to 100644
File size: 7.0 KB
Line 
1<div xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.w3.org/1999/xhtml">
2
3 <div style="width: 70%; margin: auto">
4 <div th:replace="fragments/searchBarName"></div>
5 <div th:replace="fragments/searchBarGenre"></div>
6
7 </div>
8
9 <div id="paging-section">
10 <div id="inner-paging" class="input-group">
11 <!--
12 <a class="btn btn-danger" id="button-sub" style="float: left; display: block">Previous</a>
13 <a class="btn btn-success" id="button-add" style="float: left; display: block">Next</a>
14 -->
15 <div class="input-group-prepend">
16 <button class="btn btn-danger" id="button-sub" >Previous</button>
17 </div>
18 <form method="get" action="" style="float: left; display: block">
19 <input type="number" class="form-control" min="1" name="page" th:value="${page}" id="pageInput">
20 <button type="submit" id="button-submit-page" class="btn btn-primary">Check page</button>
21 </form>
22
23 <div class="input-group-append">
24 <button class="btn btn-success" id="button-add" >Next</button>
25 </div>
26 </div>
27 </div><br><br><br>
28
29 <div class="container mb-4">
30 <a sec:authorize="isAuthenticated()" th:href="@{/movies/add}">Додади нов филм</a>
31 </div>
32
33 <div class="container mb-4">
34 <div class="row" th:each="row: ${movie_rows}" >
35 <div class="col-md-3 elements" th:each="movie: ${row}" >
36 <div class="card-body card bg-image" th:style="'background:url(' + ${movie.getImageUrl()} + ') no-repeat center #eee;'">
37 <a class="card-text-center" style="color: white" th:href="@{'/movies/{id}' (id=${movie.getMovieId()})}" >
38 <h3 class="card-title title" th:text="${movie.getTitle()}"></h3>
39 <span th:each="genre: ${movie.getGenres()}" th:text="${genre?.getGenre()?.getGenreType()}" hidden class="card-genre"></span>
40
41 </a>
42 <h3 class="card-text bottom" th:text="${'Rated '+movie.getImdbRating()}"></h3>
43 <th:block sec:authorize="isAuthenticated()">
44 <a class="bottom-heart btn btn-success button-add-favourite-list" th:movie-id="${movie.getMovieId()}" th:user-id="${user.getUserId()}" th:if="${!likedMovies.contains(movie)}">❤</a>
45 <a class="bottom-heart btn btn-danger button-remove-favourite-list" th:movie-id="${movie.getMovieId()}" th:user-id="${user.getUserId()}" th:if="${likedMovies.contains(movie)}">💔</a>
46 </th:block>
47 </div>
48 </div>
49 </div>
50 </div>
51 <!--<div class="container mb-4">
52 <div class="row">
53 <div class="col-12" th:if="${movies.size() > 0}">
54 <div class="table-responsive">
55 <table class="table table-striped">
56 <thead>
57 <tr>
58 <th scope="col">Наслов</th>
59 <th scope="col">Опис</th>
60 <th scope="col">Датум издавање</th>
61 <th scope="col">Допаѓања</th>
62 <th scope="col">Жанрови</th>
63 <th scope="col">Актери</th>
64 <th scope="col">Режисер</th>
65 <th scope="col"></th>
66
67 <th:block sec:authorize="isAuthenticated()">
68 <th scope="col"></th>
69 <th scope="col"></th>
70 <th scope="col"></th>
71 <th scope="col"></th>
72 </th:block>
73
74
75
76 </tr>
77 </thead>
78 <tbody>
79 <tr th:each="movie : ${movies}" class="elements">
80 <td><a th:text="${movie.getTitle()}" th:href="@{'/movies/{id}' (id=${movie.getMovieId()})}"></a></td>
81 <td th:text="${movie.getDescription()}"></td>
82 <td th:text="${movie.getAiringDate()}"></td>
83 <td th:text="${movie.getLikes() != null ? movie.getLikes().size() : 0}">
84
85 </td>
86 <td class="genre">
87 <div th:each="g: ${movie.getGenres()}" th:text="${g.getGenre().genreType }"></div>
88 </td>
89 <td>
90 <div th:each="ac: ${movie.getActors()}">
91 <a th:href="@{'/persons/{id}' (id=${ac.getPerson().getPersonId()})}" th:text="${ac.getPerson().getName() + ' ' + ac.getPerson().getSurname()}"></a>
92 </div>
93 </td>
94 <td th:if="${movie.getDirector() != null}">
95 <a th:href="@{'/persons/{id}' (id=${movie.getDirector().getPersonId()})}" th:text="${movie.getDirector().getName() + ' ' + movie.getDirector().getSurname()}"></a>
96 </td>
97 <td th:if="${movie.getDirector() == null}">
98 Филмот нема режисер.
99 </td>
100 <td>
101 <a class="btn btn-primary" th:href="@{'discussions/all/{id}?type=M' (id=${movie.getMovieId()})}" >Прегледај дискусии</a>
102 </td>
103 <th:block sec:authorize="isAuthenticated()">
104 <td>
105 <a class="btn btn-success button-add-favourite-list" th:movie-id="${movie.getMovieId()}" th:user-id="${user.getUserId()}" th:if="${!likedMovies.contains(movie)}">Додади во омилена листа</a>
106 <a class="btn btn-warning button-remove-favourite-list" th:movie-id="${movie.getMovieId()}" th:user-id="${user.getUserId()}" th:if="${likedMovies.contains(movie)}">Избриши од омилена листа</a>
107 </td>
108 <td>
109 <a class="btn btn-success button-add-grade-movie" th:movie-id="${movie.getMovieId()}">Остави оценка</a>
110 </td>
111 <td>
112 <a class="btn btn-warning" th:href="@{'/movies/{id}/edit' (id=${movie.getMovieId()})}">Измени</a>
113 </td>
114 <td>
115 <a class="btn btn-danger button-delete-movie" th:movie-id="${movie.getMovieId()}">Избриши филм</a>
116 </td>
117 </th:block>
118 </tr>
119 </tbody>
120 </table>
121 </div>
122 </div>
123 </div>
124 </div>-->
125
126</div>
Note: See TracBrowser for help on using the repository browser.