2025-01-30 16:46:27 +04:00

50 lines
2.7 KiB
HTML

<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-spring4-4.dtd">
<html xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" xmlns:th="http://www.w3.org/1999/xhtml"
xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity5"
layout:decorate="~{default}">
<div class="container" layout:fragment="content">
<div th:each="n : ${news}" class="news">
<div class="row">
<div class="col-md-12">
<div class="row">
<div class="col-md-10">
<a th:if="${n.meeting == null}" th:href="@{'/news/news/' + ${n.id}}" class="link-dark"><h5
th:text="${n.title}"/></a>
<a th:if="${n.meeting != null}" th:href="@{'/meetings/meetings/' + ${n.meeting.id}}"
class="link-dark"><h5 th:text="${n.title}"/></a>
</div>
<div sec:authorize="hasRole('ROLE_ADMIN')" class="col-md-2" style="text-align: right">
<a th:if="${n.meeting == null}" th:href="@{'/news/editNews/' + ${n.id}}" class="link-dark">
<i class="fa fa-pencil" aria-hidden="true"></i>
</a>
<a th:href="@{'/news/deleteNews/' + ${n.id}}" class="link-dark"
onclick="return confirm('Удалить новость?')">
<i class="fa fa-trash" aria-hidden="true"></i>
</a>
</div>
</div>
<div th:if="${n.meeting == null}" th:utext="${n.text}" class="news-item"></div>
<div th:if="${n.meeting != null}" th:text="${'Тема заседания: ' + n.meeting.title}"
class="news-item"></div>
<div th:if="${n.meeting != null}"
th:text="${'Дата: ' + #calendars.format(n.meeting.date, 'dd.MM.yyyy HH:mm')}"
class="news-item"></div>
<div th:if="${n.meeting != null}" th:utext="${n.meeting.text}" class="news-item"></div>
</div>
</div>
<div th:text="${'Опубликовано: ' + #calendars.format(n.date, 'dd.MM.yyyy HH:mm')}"
class="news-date"></div>
<hr/>
</div>
<div th:if="${news.totalPages > 0}" class="pagination">
<span style="float: left; padding: 5px 5px;">Страницы:</span>
</div>
<div th:if="${news.totalPages > 0}" class="pagination"
th:each="pageNumber : ${pageNumbers}">
<a th:href="@{/news/news(size=${news.size}, page=${pageNumber})}"
th:text=${pageNumber}
th:class="${pageNumber == news.number+1} ? active"></a>
</div>
</div>
</html>