source: Git/target/classes/templates/moviesList.html@ 42d565b

main
Last change on this file since 42d565b was 2efe93e, checked in by Petar Partaloski <ppartaloski@…>, 3 years ago

Improved Front-End, added card view of movies

  • Property mode set to 100644
File size: 5.9 KB
RevLine 
[5b447b0]1<div xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.w3.org/1999/xhtml">
2
[f25e8dd]3 <div style="width: 70%; margin: auto">
4 <div th:replace="fragments/searchBarName"></div>
5 <div th:replace="fragments/searchBarGenre"></div>
[5b447b0]6 </div>
7
8 <div class="container mb-4">
9 <a sec:authorize="isAuthenticated()" th:href="@{/movies/add}">Додади нов филм</a>
10 </div>
11
12 <div class="container mb-4">
[2efe93e]13 <div class="row" th:each="row: ${movie_rows}" >
14 <div class="col-md-3" th:each="movie: ${row}" >
15 <div class="card-body card bg-image" th:style="'background:url(' + ${movie.getImageUrl()} + ') no-repeat center #eee;'">
16 <a class="card-text-center" style="color: white" th:href="@{'/movies/{id}' (id=${movie.getMovieId()})}" >
17 <h3 class="card-title title" th:text="${movie.getTitle()}"></h3>
18 </a>
19 <h3 class="card-text bottom" th:text="${'Rated '+movie.getImdbRating()}"></h3>
20 <th:block sec:authorize="isAuthenticated()">
21 <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>
22 <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>
23 </th:block>
24 </div>
25 </div>
26 </div>
27 </div>
28 <!--<div class="container mb-4">
[5b447b0]29 <div class="row">
30 <div class="col-12" th:if="${movies.size() > 0}">
31 <div class="table-responsive">
32 <table class="table table-striped">
33 <thead>
34 <tr>
35 <th scope="col">Наслов</th>
[2efe93e]36 <th scope="col">Опис</th>
[5b447b0]37 <th scope="col">Датум издавање</th>
38 <th scope="col">Допаѓања</th>
[f25e8dd]39 <th scope="col">Жанрови</th>
[5b447b0]40 <th scope="col">Актери</th>
41 <th scope="col">Режисер</th>
42 <th scope="col"></th>
43
44 <th:block sec:authorize="isAuthenticated()">
45 <th scope="col"></th>
46 <th scope="col"></th>
47 <th scope="col"></th>
48 <th scope="col"></th>
49 </th:block>
50
51
52
53 </tr>
54 </thead>
55 <tbody>
56 <tr th:each="movie : ${movies}" class="elements">
[f25e8dd]57 <td><a th:text="${movie.getTitle()}" th:href="@{'/movies/{id}' (id=${movie.getMovieId()})}"></a></td>
[2efe93e]58 <td th:text="${movie.getDescription()}"></td>
[5b447b0]59 <td th:text="${movie.getAiringDate()}"></td>
60 <td th:text="${movie.getLikes() != null ? movie.getLikes().size() : 0}">
61
62 </td>
63 <td class="genre">
64 <div th:each="g: ${movie.getGenres()}" th:text="${g.getGenre().genreType }"></div>
65 </td>
66 <td>
[f25e8dd]67 <div th:each="ac: ${movie.getActors()}">
68 <a th:href="@{'/persons/{id}' (id=${ac.getPerson().getPersonId()})}" th:text="${ac.getPerson().getName() + ' ' + ac.getPerson().getSurname()}"></a>
69 </div>
70 </td>
71 <td th:if="${movie.getDirector() != null}">
72 <a th:href="@{'/persons/{id}' (id=${movie.getDirector().getPersonId()})}" th:text="${movie.getDirector().getName() + ' ' + movie.getDirector().getSurname()}"></a>
73 </td>
74 <td th:if="${movie.getDirector() == null}">
75 Филмот нема режисер.
[5b447b0]76 </td>
77 <td>
78 <a class="btn btn-primary" th:href="@{'discussions/all/{id}?type=M' (id=${movie.getMovieId()})}" >Прегледај дискусии</a>
79 </td>
80 <th:block sec:authorize="isAuthenticated()">
81 <td>
[f25e8dd]82 <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>
83 <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>
[5b447b0]84 </td>
85 <td>
[f25e8dd]86 <a class="btn btn-success button-add-grade-movie" th:movie-id="${movie.getMovieId()}">Остави оценка</a>
[5b447b0]87 </td>
88 <td>
[f25e8dd]89 <a class="btn btn-warning" th:href="@{'/movies/{id}/edit' (id=${movie.getMovieId()})}">Измени</a>
[5b447b0]90 </td>
91 <td>
[f25e8dd]92 <a class="btn btn-danger button-delete-movie" th:movie-id="${movie.getMovieId()}">Избриши филм</a>
[5b447b0]93 </td>
94 </th:block>
95 </tr>
96 </tbody>
97 </table>
98 </div>
99 </div>
100 </div>
[2efe93e]101 </div>-->
[5b447b0]102
103</div>
Note: See TracBrowser for help on using the repository browser.