<!DOCTYPE html>

<!--
  ~ Copyright (c) 2025 Andrew Grant of Carrick Software .
  ~ All rights reserved.
  -->
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8"/>
    <title>Grants - census list</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet"
          integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
</head>
<body>
<div th:insert="~{fragments/layout::banner}"></div>


<div class="container text-center">
    <!--/*@thymesVar id="census" type="scot.carricksoftware.grants.domains.census.Census"*/-->
    <div class="container border border-info
                    rounded-3 text-center p-4">
        <h3>Censuses</h3>
        <table class="table table-striped table-bordered">
            <thead class="table-dark">
            <tr>
                <th>ID</th>
                <th>Place</th>
                <th>Date</th>
                <th></th>
            </tr>
            </thead>

            <tr th:each="census   : ${censuses}">
                <td th:text="${census.id}">123</td>
                <td th:text="${census.place}">123</td>
                <td th:text="${census.censusDate.label}"></td>
                <td><span>
                        <a th:action="delete" class="btn btn-danger btn-sm"
                           th:href="@{/census/{id}/delete(id=${census.id})}"
                           th:text="Delete"></a>
                    <a th:action="edit" class="btn btn-warning btn-sm"
                       th:href="@{/census/{id}/edit(id=${census.id})}"
                       th:text="Edit"></a>
                     <a th:action="entries" class="btn btn-info btn-sm"
                        th:href="@{/selectedCensus/{id}/entries(id=${census.id})}"
                        th:text="Entries"></a>
                    </span></td>
            </tr>
            <tfoot>
            <tr>
                <td colspan="4"><span>
                        <a th:action="rewind" class="btn btn-secondary btn-sm" th:href="@{/censuses/rewind}"
                           th:text="'<<'"></a>
                         <a th:action="back" class="btn btn-secondary btn-sm"
                            th:href="@{/censuses/prev}" th:text="'<'"></a>
                         <a th:action="new" class="btn btn-primary btn-sm" th:href="@{/census/new}"
                            th:text="'New Census'"></a>
                         <a th:action="home" class="btn btn-success btn-sm"
                            th:href="@{/}" th:text="'Home'"></a>
                         <a th:action="forward" class="btn btn-secondary btn-sm"
                            th:href="@{/censuses/next}" th:text="'>'"></a>
                         <a th:action="end" class="btn btn-secondary btn-sm" th:href="@{/censuses/ff}"
                            th:text="'>>'"></a>
                        </span></td>
            </tr>
            </tfoot>
        </table>
    </div>
</div>
</body>
</html>

