<!DOCTYPE html>
<html lang="en"
      xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
      layout:decorator="default" xmlns:th="">
<head>
</head>
<body>

<div class="container" layout:fragment="content">
    <form id="papers-form" method="post" th:action="@{'/papers/papers'}">
        <input th:type="hidden" name="paperDeleteId" id="paperDeleteId"/>
        <section id="papers">
            <div class="container">
                <div class="row" id="paper-list">
                    <div class="col-lg-12 text-center">
                        <h2 class="section-heading text-uppercase">Статьи</h2>
                        <div th:replace="papers/fragments/paperNavigationFragment"/>
                    </div>
                </div>
                <div class="row">
                    <div class="col-md-9 col-sm-12">
                        <th:block th:each="paper : ${filteredPapers.papers}">
                            <div th:replace="papers/fragments/paperLineFragment :: paperLine(paper=${paper})"/>
                        </th:block>
                    </div>
                    <div class="col-md-3 col-sm-12">
                        <div class="filter">
                            <h5>Фильтр:</h5>
                            <select class="form-control" th:field="${filteredPapers.filterAuthorId}" id="author"
                                    onchange="this.form.submit();">
                                <option value="">Все авторы</option>
                                <option th:each="author: ${allAuthors}" th:value="${author.id}"
                                        th:text="${author.lastName}">lastName
                                </option>
                            </select>
                            <select class="form-control" id="year" th:field="${filteredPapers.year}"
                                    onchange="this.form.submit();">
                                <option value="">Все годы</option>
                                <option th:each="year: ${allYears}" th:value="${year}"
                                        th:text="${year}">year
                                </option>
                            </select>
                        </div>
                    </div>
                </div>
                <div th:replace="fragments/noRecordsFragment :: noRecords(entities=${filteredPapers.papers}, noRecordsMessage=' одной статьи', url='paper')"/>
            </div>
        </section>

        <div id="modalDelete"/>
    </form>
    <script src="/js/papers.js"></script>
</div>
</body>

</html>
