[5b447b0] | 1 | <div xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.w3.org/1999/xhtml">
|
---|
| 2 | <div class="container mb-4">
|
---|
[3fe36de] | 3 | <a sec:authorize="isAuthenticated()" th:href="@{/discussions/add}" class="btn btn-secondary">Додади нова дискусија</a>
|
---|
[5b447b0] | 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>
|
---|
[c02189f] | 11 | <th scope="col">За</th>
|
---|
[5b447b0] | 12 | <th scope="col">Наслов</th>
|
---|
[c02189f] | 13 | <th scope="col">Допаѓања</th>
|
---|
[5b447b0] | 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">
|
---|
[c02189f] | 29 | <td th:text="${disc.getMovie() != null ? 'Филмот ' + disc.getMovie().getTitle() : 'Актерот ' + disc.getPerson().getName() + ' ' + disc.getPerson().getSurname()}"></td>
|
---|
[f25e8dd] | 30 | <td>
|
---|
| 31 | <a th:text="${disc.getTitle()}" th:href="@{'/discussions/{id}' (id=${disc.getDiscussionId()})}"></a>
|
---|
| 32 | </td>
|
---|
[c02189f] | 33 | <td th:each="like : ${likes}" th:if="${like.getDiscussionId().equals(disc.getDiscussionId())}" th:text="${like.getLikes()}" class="likes_count">
|
---|
| 34 | </td>
|
---|
[5b447b0] | 35 | <td th:text="${disc.getDate()}"></td>
|
---|
| 36 | <td th:text="${disc.getUser().getUsername()}"></td>
|
---|
[f25e8dd] | 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>
|
---|
[5b447b0] | 39 |
|
---|
| 40 | <th:block sec:authorize="isAuthenticated()">
|
---|
[f25e8dd] | 41 | <td th:if="${!disc.getUser().equals(user)}"><a class="btn btn-success" th:href="@{'/replies/add/{discussionId}' (discussionId=${disc.getDiscussionId()})}">Реплицирај</a> </td>
|
---|
[5b447b0] | 42 | <td th:if="${!disc.getUser().equals(user)}">
|
---|
[c02189f] | 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>
|
---|
[5b447b0] | 45 | </td>
|
---|
| 46 | </th:block>
|
---|
| 47 |
|
---|
| 48 | </tr>
|
---|
| 49 | </tbody>
|
---|
| 50 | </table>
|
---|
| 51 | </div>
|
---|
| 52 | </div>
|
---|
| 53 | </div>
|
---|
| 54 |
|
---|
| 55 | </div>
|
---|