Newer
Older
simple-opds / src / main / resources / templates / test-main.html
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
      layout:decorate="~{main}">
<head>
    <title>Главная - SOPDS</title>
</head>
<body>
<div layout:fragment="content">
    <!-- Statistics -->
    <div class="row">
        <div class="large-3 columns">
            <div class="sopds-stat">
                <span class="sopds-stat-number" th:text="${stats.booksCount}">0</span>
                <span class="sopds-stat-label">Книг</span>
            </div>
        </div>
        <div class="large-3 columns">
            <div class="sopds-stat">
                <span class="sopds-stat-number" th:text="${stats.authorsCount}">0</span>
                <span class="sopds-stat-label">Авторов</span>
            </div>
        </div>
        <div class="large-3 columns">
            <div class="sopds-stat">
                <span class="sopds-stat-number" th:text="${stats.seriesCount}">0</span>
                <span class="sopds-stat-label">Серий</span>
            </div>
        </div>
        <div class="large-3 columns">
            <div class="sopds-stat">
                <span class="sopds-stat-number" th:text="${stats.genresCount}">0</span>
                <span class="sopds-stat-label">Жанров</span>
            </div>
        </div>
    </div>

    <!-- Recent Books -->
    <div class="row">
        <div class="large-12 columns">
            <h3>Последние добавленные книги</h3>
            <div class="row small-up-1 medium-up-2 large-up-4"
                 th:if="${recentBooks != null and !recentBooks.empty}">
                <div class="column" th:each="book : ${recentBooks}">
                    <div class="sopds-book-card">
                        <div class="sopds-book-title" th:text="${book.title}">
                            Название книги
                        </div>
                        <div class="sopds-book-meta" th:if="${book.authors != null and !book.authors.empty}">
                            Автор: <span th:text="${book.authors[0].fullName}">Автор</span>
                        </div>
                        <div class="sopds-book-meta" th:if="${book.format}">
                            Формат: <span th:text="${book.format}">fb2</span>
                        </div>
                        <a th:href="@{/book/{id}(id=${book.id})}" class="button small expanded">
                            Подробнее
                        </a>
                    </div>
                </div>
            </div>
            <div th:if="${recentBooks == null or recentBooks.empty}" class="callout warning">
                <h5>Книги не найдены</h5>
                <p>В библиотеке пока нет книг. Добавьте книги в папку сканирования.</p>
            </div>
        </div>
    </div>

    <!-- Popular Genres -->
    <div class="row">
        <div class="large-12 columns">
            <h3>Популярные жанры</h3>
            <div class="button-group" th:if="${popularGenres != null and !popularGenres.empty}">
                <a th:each="genre : ${popularGenres}"
                   th:href="@{/books/genre/{id}(id=${genre.id})}"
                   class="button hollow">
                    <span th:text="${genre.genre}">Жанр</span>
                    <span class="badge" th:text="${genre.bookCount}">0</span>
                </a>
            </div>
        </div>
    </div>
</div>
</body>
</html>