1 | <div xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.w3.org/1999/xhtml">
|
---|
2 | <div class="container mb-4">
|
---|
3 | <a sec:authorize="isAuthenticated()" th:href="@{/discussions/add}" class="btn btn-secondary">Додади нова дискусија</a>
|
---|
4 | </div>
|
---|
5 | <div class="container mb-4">
|
---|
6 | <div class="col-12" th:if="${discussions.size() > 0}">
|
---|
7 | <div class="table-responsive">
|
---|
8 | <table class="table table-striped">
|
---|
9 | <thead>
|
---|
10 | <tr>
|
---|
11 | <th scope="col">За</th>
|
---|
12 | <th scope="col">Наслов</th>
|
---|
13 | <th scope="col">Допаѓања</th>
|
---|
14 | <th scope="col">Датум</th>
|
---|
15 | <th scope="col">Корисник</th>
|
---|
16 | <th:block sec:authorize="isAuthenticated()">
|
---|
17 | <th:block>
|
---|
18 | <th scope="col"></th>
|
---|
19 | <th scope="col"></th>
|
---|
20 | </th:block>
|
---|
21 | <th scope="col"></th>
|
---|
22 | <th scope="col"></th>
|
---|
23 | </th:block>
|
---|
24 |
|
---|
25 | </tr>
|
---|
26 | </thead>
|
---|
27 | <tbody>
|
---|
28 | <tr th:each="disc : ${discussions}" class="movie">
|
---|
29 | <td th:text="${disc.getMovie() != null ? 'Филмот ' + disc.getMovie().getTitle() : 'Актерот ' + disc.getPerson().getName() + ' ' + disc.getPerson().getSurname()}"></td>
|
---|
30 | <td>
|
---|
31 | <a th:text="${disc.getTitle()}" th:href="@{'/discussions/{id}' (id=${disc.getDiscussionId()})}"></a>
|
---|
32 | </td>
|
---|
33 | <td th:text="${disc.getLikes() != null ? disc.getLikes() : 0}" class="likes_count">
|
---|
34 | </td>
|
---|
35 | <td th:text="${disc.getDate()}"></td>
|
---|
36 | <td th:text="${disc.getUser().getUsername()}"></td>
|
---|
37 | <td th:if="${disc.getUser().equals(user)}"><a class="btn btn-warning" th:href="@{'/discussions/add/{id}' (id=${disc.getDiscussionId()})}">Измени</a> </td>
|
---|
38 | <td th:if="${disc.getUser().equals(user)}"><a class="btn btn-danger button-delete-discussion" th:discussion-id="${disc.getDiscussionId()}">Избриши</a> </td>
|
---|
39 |
|
---|
40 | <th:block sec:authorize="isAuthenticated()">
|
---|
41 | <td th:if="${!disc.getUser().equals(user)}"><a class="btn btn-success" th:href="@{'/replies/add/{discussionId}' (discussionId=${disc.getDiscussionId()})}">Реплицирај</a> </td>
|
---|
42 | <td th:if="${!disc.getUser().equals(user)}">
|
---|
43 | <a class='btn btn-success button-like-discussion-alt' th:if="${!likedDiscussions.contains(disc)}" th:discussion-id="${disc?.getDiscussionId()}" th:user-id="${user.getUserId()}" >❤</a>
|
---|
44 | <a class='btn btn-danger button-unlike-discussion-alt' th:if="${likedDiscussions.contains(disc)}" th:discussion-id="${disc?.getDiscussionId()}" th:user-id="${user.getUserId()}" >💔</a>
|
---|
45 | </td>
|
---|
46 | </th:block>
|
---|
47 |
|
---|
48 | </tr>
|
---|
49 | </tbody>
|
---|
50 | </table>
|
---|
51 | </div>
|
---|
52 | </div>
|
---|
53 | </div>
|
---|
54 |
|
---|
55 | </div>
|
---|