source: Git/src/main/resources/templates/discussion.html@ 3fe36de

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

Added User profiles, improved clarity, improved UI

  • Property mode set to 100644
File size: 3.9 KB
Line 
1<div xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.w3.org/1999/xhtml">
2 <div style="width: 85%; text-align: justify; margin: auto; clear: both">
3 <div style="background-color: rgba(128,128,128, 0.2); border-radius: 20px; padding: 20px">
4 <h1 th:text="${disc.getTitle()}" style="width: 80%; display: inline; height: fit-content; clear: both"></h1>
5 </div>
6 <hr>
7 <div>
8 <h5 th:text="${disc.getText()}" style="width: 90%; margin: auto; background-color: lightblue; border-radius: 4px; padding: 20px"></h5>
9 </div>
10 <br>
11 <h4>
12 <span th:if="${!disc.getUser().equals(user)}" sec:authorize="isAuthenticated()">
13 <a class='btn btn-success button-like-discussion' th:if="${!likedDiscussions.contains(disc)}" th:discussion-id="${disc.getDiscussionId()}" th:user-id="${user.getUserId()}" >❤</a>
14 <a class='btn btn-danger button-unlike-discussion' th:if="${likedDiscussions.contains(disc)}" th:discussion-id="${disc.getDiscussionId()}" th:user-id="${user.getUserId()}" >💔</a>
15 </span>
16 <span>Број на допаѓања:</span>
17 <span th:text="${likes}" id="likes_count"></span>
18 </h4>
19 <br>
20 <h6 style="width: 60%; float:left;">
21 <a th:href="@{'/profiles/{id}' (id=${disc.getUser().getUserId()})}" >
22 <span th:text="${'Поставено од: '+disc.getUser().getUsername()}"></span>
23 </a>
24 <span th:text="${', на датум '+ disc.getDate()}"></span>
25 <br>
26 <span>Поставено за </span>
27 <span th:text="${disc.getMovie() != null ? 'Филмот ' + disc.getMovie().getTitle() : 'Актерот ' + disc.getPerson().getName() + ' ' + disc.getPerson().getSurname()}" ></span>
28 </h6>
29 <div style="float: right" sec:authorize="isAuthenticated()">
30 <a th:if="${disc.getUser().equals(user)}" class="btn btn-warning" th:href="@{'/discussions/add/{id}' (id=${disc.getDiscussionId()})}">Промени</a>
31 <a th:if="${disc.getUser().equals(user)}" class="btn btn-danger button-delete-discussion" th:discussion-id="${disc.getDiscussionId()}">Избриши</a>
32 <a class="btn btn-success" th:href="@{'/replies/add/{discussionId}' (discussionId=${disc.getDiscussionId()})}">Реплицирај</a>
33
34 </div><br>
35 </div>
36 <table class="table table-striped" style="width: 70%; margin: auto;">
37 <thead>
38 <tr>
39 <th scope="col">Реплика</th>
40 <th scope="col">Поставена на</th>
41 <th scope="col">Поставена од</th>
42 <th:block sec:authorize="isAuthenticated()">
43 <th scope="col"></th>
44 <th scope="col"></th>
45 </th:block>
46 </tr>
47 </thead>
48 <tbody>
49 <tr th:each="reply : ${replies}" class="movie">
50 <td th:text="${reply.getText()}"></td>
51 <td th:text="${reply.getDate()}"></td>
52 <td >
53 <a th:href="@{'/profiles/{id}' (id=${reply.getUser().getUserId()})}" th:text="${reply.getUser().getUsername()}"></a>
54 </td>
55 <td th:if="${reply.getUser().equals(user)}"><a class="btn btn-warning" th:href="@{'/replies/edit/{discussionId}/{replyId}' (discussionId=${disc.getDiscussionId()},replyId=${reply.getReplyId()})}">Промени</a> </td>
56 <td th:if="${reply.getUser().equals(user)}"><a class="btn btn-danger button-delete-reply" th:reply-id="${reply.getReplyId()}" th:dicsussion-id="${disc.getDiscussionId()}">Избриши</a> </td>
57 <th:block sec:authorize="isAuthenticated()">
58 <td th:if="${!reply.getUser().equals(user)}">
59 <a class="btn btn-success">👍 </a>
60 <a class="btn btn-danger">👎</a>
61 </td>
62 </th:block>
63 </tr>
64 </tbody>
65 </table>
66</div>
Note: See TracBrowser for help on using the repository browser.