<!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>People </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">
    <title>Grants - Census Entry List</title>
</head>
<body>
<div th:insert="~{fragments/layout::banner}"></div>


<div class="container text-center">
    <!--/*@thymesVar id="censusEntry" type="scot.carricksoftware.grants.domains.census.CensusEntry"*/-->
    <!--/*@thymesVar id="person" type="scot.carricksoftware.grants.domains.people.Person"*/-->
    <!--/*@thymesVar id="census" type="scot.carricksoftware.grants.domains.census.Census"*/-->

    <div class="container border border-info
                    rounded-3 text-center p-4">
        <h3>Census Entries</h3>
        <table class="table table-striped table-bordered">
            <thead class="table-dark">
            <tr>
                <th>ID</th
                ><th>Person</th>
                <th>Untracked Person</th>
                <th>Census</th>
                <th></th>
            </tr>
            </thead>

            <tr th:each="entry   : ${censusEntries}">
                <td th:text="${entry.id}">123</td>
                <td th:text="${entry.person?.toString()}">123</td>
                <td th:text="${entry.name}">123</td>
                <td th:text="${entry.toString()}">123</td>

                <td><span>
                        <a th:action="delete" class="btn btn-danger btn-sm" href=""
                           th:href="@{/censusEntry/{id}/delete(id=${entry.id})}"
                           th:text="Delete"></a>
                    <a th:action="edit" class="btn btn-warning btn-sm"
                       th:href="@{/censusEntry/{id}/edit(id=${entry.id})}"
                       th:text="Edit"></a>
                    </span></td>
            </tr>
            <tfoot>
            <tr>
                <td colspan="4"><span>
                        <a th:action="rewind" class="btn btn-secondary btn-sm" th:href="@{/censusEntries/rewind}"
                           th:text="'<<'"></a>
                         <a th:action="back" class="btn btn-secondary btn-sm"
                            th:href="@{/censusEntries/prev}" th:text="'<'"></a>
                         <a th:action="new" class="btn btn-primary btn-sm" th:href="@{/censusEntry/new}"
                            th:text="'New Entry'"></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="@{/censusEntries/next}" th:text="'>'"></a>
                         <a th:action="end" class="btn btn-secondary btn-sm" th:href="@{/censusEntries/ff}"
                            th:text="'>>'"></a>
                        </span></td>
            </tr>
            </tfoot>
        </table>
    </div>
</div>
</body>
</html>

