<!DOCTYPE html>
<!--suppress XmlHighlighting -->
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <!-- Required meta tags -->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

    <!-- Bootstrap CSS -->
    <!--suppress SpellCheckingInspection -->
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css"
          integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">

    <!--suppress SpellCheckingInspection -->
    <script src="https://code.jquery.com/jquery-3.6.0.min.js"
            integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
    <title>Grants - person</title>

</head>
<body>
<!--/*@thymesVar id="marriageCertificateCommand" type="scot.carricksoftware.grants.commands.certificates.marriagecertificates.MarriageCertificateCommand"*/-->
<div th:insert="~{fragments/layout::banner}"></div>

<div class="container border border-info rounded-3 text-center p-4">
    <h3>Marriage Certificate Details</h3>
    <form th:object="${marriageCertificateCommand}" th:action="@{/marriageCertificate}" method="post">
        <div th:if="${#fields.hasErrors('*')}" class="alert alert-danger">
            <p>Please Correct The Errors Below</p>
        </div>
        <table style="width:100%;">
            <tr>
                <td style="text-align: right;">
                    <label for="id"><span style="color: rgb(255,0,0);">*</span>Database Id :&nbsp;</label>
                </td>
                <td style="text-align: left;">
                    <input class="form-control" id="id"
                           th:field="*{id}" type="text" readonly>
                </td>
            </tr>
            <tr>
                <td style="text-align: right;">
                    <label for="certificateNumber">Certificate Number :&nbsp;</label>
                </td>
                <td style="text-align: left;">
                    <input class="form-control" id="certificateNumber"
                           th:field="*{certificateNumber}" type="text">
                    <div th:if="${#fields.hasErrors('certificateNumber')}">
                        <ul class="text-danger">
                            <li th:each="err : ${#fields.errors('certificateNumber')}" th:text="${err}"/>
                        </ul>
                    </div>
                </td>
            </tr>
            <tr>
                <td style="text-align: right;">
                    <label for="certificateSource">Certificate Source&nbsp;:&nbsp;</label>
                </td>
                <td style="text-align: left;">
                    <div>
                        <select id="certificateSource" name="certificateSource" th:field="*{certificateSource}">
                            <option th:value="${''}" th:text="${''}"></option>
                            <!--/*@thymesVar id="organisations" type="scot.carricksoftware.grants.domains.places.Organisation"*/-->
                            <option th:each="organisation : ${organisations}"
                                    th:value="${organisation.id}" th:text="${organisation.toString()}"></option>
                        </select>
                        <div th:if="${#fields.hasErrors('certificateSource')}">
                            <ul class="text-danger">
                                <li th:each="err : ${#fields.errors('certificateSource')}" th:text="${err}"/>
                            </ul>
                        </div>
                    </div>
                </td>
            </tr>
            <tr>
                <td style="text-align: right;">
                    <label for="certificateDate">Certificate Date (dd/mm/yyyy) :&nbsp;</label>
                </td>
                <td style="text-align: left;">
                    <input class="form-control" id="certificateDate"
                           th:field="*{certificateDate}" type="text">
                    <div th:if="${#fields.hasErrors('certificateDate')}">
                        <ul class="text-danger">
                            <li th:each="err : ${#fields.errors('certificateDate')}" th:text="${err}"/>
                        </ul>
                    </div>
                </td>
            </tr>
            <tr style="border-bottom: 5px solid #ccc;">
                <td style="text-align: right;">
                    <label for="certificateType">Certificate Type :&nbsp;</label>
                </td>
                <td style="text-align: left;">
                    <div>
                        <select id="certificateType" style="width: 200px;" name="certificateType"
                                th:field="*{certificateType}">
                            <option th:value="${''}" th:text="${''}"></option>
                            <option th:each="value : ${T(scot.carricksoftware.grants.enums.certificates.CertificateType).values()}"
                                    th:value="${value}" th:text="${value.label}"></option>
                        </select>
                    </div>
                    <div th:if="${#fields.hasErrors('certificateType')}">
                        <ul class="text-danger">
                            <li th:each="err : ${#fields.errors('certificateType')}" th:text="${err}"/>
                        </ul>
                    </div>
            </tr>
            <tr>
                <td style="text-align: right;">
                    <label for="registrationAuthority">Registration Authority :&nbsp;</label>
                </td>
                <td style="text-align: left;">
                    <div>
                        <select id="registrationAuthority" style="width: 200px;" name="registrationAuthority"
                                th:field="*{registrationAuthority}">
                            <option th:value="${''}" th:text="${''}"></option>
                            <!--/*@thymesVar id="organisations" type="scot.carricksoftware.grants.domains.places.Organisation"*/-->
                            <option th:each="organisation : ${organisations}"
                                    th:value="${organisation.id}" th:text="${organisation.name}"></option>
                        </select>
                    </div>
                    <div th:if="${#fields.hasErrors('registrationAuthority')}">
                        <ul class="text-danger">
                            <li th:each="err : ${#fields.errors('registrationAuthority')}" th:text="${err}"/>
                        </ul>
                    </div>
                </td>
            </tr>
            <tr>
                <td style="text-align: right;">
                    <label for="volume">Volume :&nbsp;</label>
                </td>
                <td style="text-align: left;">
                    <div>
                        <input class="volume" id="volume"
                               th:field="*{volume}" type="text">
                        <div th:if="${#fields.hasErrors('volume')}">
                            <ul class="text-danger">
                                <li th:each="err : ${#fields.errors('volume')}" th:text="${err}"/>
                            </ul>
                        </div>
                    </div>
                </td>
            </tr>
            <tr style="border-bottom: 5px solid #ccc;">
                <td style="text-align: right;">
                    <label for="number">Number :&nbsp;</label>
                </td>
                <td style="text-align: left;">
                    <div>
                        <input class="number" id="number"
                               th:field="*{number}" type="text">
                        <div th:if="${#fields.hasErrors('number')}">
                            <ul class="text-danger">
                                <li th:each="err : ${#fields.errors('number')}" th:text="${err}"/>
                            </ul>
                        </div>
                    </div>
                </td>
            </tr>

            <tr>
                <td style="text-align: right;">
                    <label for="whenMarried">When Married (dd/mm/yyyy) :&nbsp;</label>
                </td>
                <td style="text-align: left;">
                    <div>
                        <input class="whenMarried" id="whenMarried"
                               th:field="*{whenMarried}" type="text">
                        <div th:if="${#fields.hasErrors('whenMarried')}">
                            <ul class="text-danger">
                                <li th:each="err : ${#fields.errors('whenMarried')}" th:text="${err}"/>
                            </ul>
                        </div>
                    </div>
                </td>
            </tr>
            <tr>
                <td style="text-align:right; background-color: #FFC300;">
                    <label for="whereMarried">Where Married :&nbsp;</label>
                </td>
                <td style="text-align: left;">
                    <select id="whereMarried" name="whereMarried" th:field="*{whereMarried}">
                        <option th:value="${''}" th:text="${''}"></option>
                        <option th:each="place : ${places}"
                                th:value="${place.id}" th:text="${place.toString()}"></option>
                    </select>
                    <div th:if="${#fields.hasErrors('whereMarried')}">
                        <ul class="text-danger">
                            <li th:each="err : ${#fields.errors('whereMarried')}" th:text="${err}"/>
                        </ul>
                    </div>
                </td>
            </tr>
            <tr>
                <td style="text-align: right; background-color: #FFC300;">
                    <label for="untrackedWhereMarried">Where Married (untracked) :&nbsp;</label>
                </td>
                <td style="text-align: left;">
                    <div>
                        <input class="untrackedWhereMarried" id="untrackedWhereMarried"
                               th:field="*{untrackedWhereMarried}" type="text">
                        <div th:if="${#fields.hasErrors('untrackedWhereMarried')}">
                            <ul class="text-danger">
                                <li th:each="err : ${#fields.errors('untrackedWhereMarried')}" th:text="${err}"/>
                            </ul>
                        </div>
                    </div>
                </td>
            </tr>
            <tr>
                <td style="text-align: right; background-color: #73ff00;">
                    <label for="firstWitness">First Witness :&nbsp;</label>
                </td>
                <td style="text-align: left;">
                    <select id="firstWitness" name="firstWitness" th:field="*{firstWitness}">
                        <option th:value="${''}" th:text="${''}"></option>
                        <option th:each="person : ${people}"
                                th:value="${person.id}" th:text="${person.toString()}"></option>
                    </select>
                    <div th:if="${#fields.hasErrors('firstWitness')}">
                        <ul class="text-danger">
                            <li th:each="err : ${#fields.errors('firstWitness')}" th:text="${err}"/>
                        </ul>
                    </div>
                </td>
            </tr>
            <tr>
                <td style="text-align: right; background-color: #73ff00;">
                    <label for="untrackedFirstWitness">First witness (untracked) :&nbsp;</label>
                </td>
                <td style="text-align: left;">
                    <div>
                        <input class="untrackedFirstWitness" id="untrackedFirstWitness"
                               th:field="*{untrackedFirstWitness}" type="text">
                        <div th:if="${#fields.hasErrors('untrackedFirstWitness')}">
                            <ul class="text-danger">
                                <li th:each="err : ${#fields.errors('untrackedFirstWitness')}" th:text="${err}"/>
                            </ul>
                        </div>
                    </div>
                </td>
            </tr>
            <tr>
                <td style="text-align: right;background-color: #F2F542;">
                    <label for="secondWitness">Second Witness :&nbsp;</label>
                </td>
                <td style="text-align: left;">
                    <select id="secondWitness" name="secondWitness" th:field="*{secondWitness}">
                        <option th:value="${''}" th:text="${''}"></option>
                        <option th:each="person : ${people}"
                                th:value="${person.id}" th:text="${person.toString()}"></option>
                    </select>
                    <div th:if="${#fields.hasErrors('secondWitness')}">
                        <ul class="text-danger">
                            <li th:each="err : ${#fields.errors('secondWitness')}" th:text="${err}"/>
                        </ul>
                    </div>
                </td>
            </tr>
            <tr style="border-bottom: 5px solid #ccc;">
                <td style="text-align: right;background-color: #F2F542;">
                    <label for="untrackedSecondWitness">Second witness (untracked) :&nbsp;</label>
                </td>
                <td style="text-align: left;">
                    <div>
                        <input class="untrackedSecondWitness" id="untrackedSecondWitness"
                               th:field="*{untrackedSecondWitness}" type="text">
                        <div th:if="${#fields.hasErrors('untrackedSecondWitness')}">
                            <ul class="text-danger">
                                <li th:each="err : ${#fields.errors('untrackedSecondWitness')}" th:text="${err}"/>
                            </ul>
                        </div>
                    </div>
                </td>
            </tr>
            <tr>
                <td style="text-align: right;">
                    <label for="bride">Bride :&nbsp;</label>
                </td>
                <td style="text-align: left;">
                    <select id="bride" style="width: 300px;" name="bride" th:field="*{bride}">
                        <option th:value="${''}" th:text="${''}"></option>
                        <option th:each="person : ${people}"
                                th:value="${person.id}" th:text="${person.toString()}"></option>
                    </select>
                    <div th:if="${#fields.hasErrors('bride')}">
                        <ul class="text-danger">
                            <li th:each="err : ${#fields.errors('bride')}" th:text="${err}"/>
                        </ul>
                    </div>
                </td>
            </tr>
            <tr>
                <td style="text-align: right;">
                    <label for="brideCondition">Bride Condition :&nbsp;</label>
                </td>
                <td style="text-align: left;">
                    <select id="brideCondition" style="width: 200px;" name="brideCondition"
                            th:field="*{brideCondition}">
                        <option th:value="${''}" th:text="${''}"></option>
                        <option th:each="value : ${T(scot.carricksoftware.grants.enums.censusentry.CensusEntryCondition).values()}"
                                th:value="${value}" th:text="${value.label}"></option>
                    </select>
                    <div th:if="${#fields.hasErrors('brideCondition')}">
                        <ul class="text-danger">
                            <li th:each="err : ${#fields.errors('brideCondition')}" th:text="${err}"/>
                        </ul>
                    </div>
                </td>
            </tr>
            <tr>
                <td style="text-align: right;">
                    <label for="brideAge">Bride Age :&nbsp;</label>
                </td>
                <td style="text-align: left;">
                    <div>
                        <input class="brideAge" id="brideAge"
                               th:field="*{brideAge}" type="text">
                        <div th:if="${#fields.hasErrors('brideAge')}">
                            <ul class="text-danger">
                                <li th:each="err : ${#fields.errors('brideAge')}" th:text="${err}"/>
                            </ul>
                        </div>
                    </div>
                </td>
            </tr>
            <tr>
                <td style="text-align: right;">
                    <label for="brideRank">Bride Rank :&nbsp;</label>
                </td>
                <td style="text-align: left;">
                    <div>
                        <input class="brideRank" id="brideRank"
                               th:field="*{brideRank}" type="text">
                        <div th:if="${#fields.hasErrors('brideRank')}">
                            <ul class="text-danger">
                                <li th:each="err : ${#fields.errors('brideRank')}" th:text="${err}"/>
                            </ul>
                        </div>
                    </div>
                </td>
            </tr>
            <tr>
                <td style="text-align: right; background-color: #B542A4;">
                    <label for="brideUsualResidence">Bride Residence :&nbsp;</label>
                </td>
                <td style="text-align: left;">
                    <select id="brideUsualResidence" name="brideUsualResidence" th:field="*{brideUsualResidence}">
                        <option th:value="${''}" th:text="${''}"></option>
                        <option th:each="place : ${places}"
                                th:value="${place.id}" th:text="${place.toString()}"></option>
                    </select>
                    <div th:if="${#fields.hasErrors('brideUsualResidence')}">
                        <ul class="text-danger">
                            <li th:each="err : ${#fields.errors('brideUsualResidence')}" th:text="${err}"/>
                        </ul>
                    </div>
                </td>
            </tr>
            <tr>
                <td style="text-align: right; background-color: #B542A4;">
                    <label for="brideUntrackedResidence">Bride Residence (untracked) :&nbsp;</label>
                </td>
                <td style="text-align: left;">
                    <div>
                        <input class="brideUntrackedResidence" id="brideUntrackedResidence"
                               th:field="*{brideUntrackedResidence}" type="text">
                        <div th:if="${#fields.hasErrors('brideUntrackedResidence')}">
                            <ul class="text-danger">
                                <li th:each="err : ${#fields.errors('brideUntrackedResidence')}" th:text="${err}"/>
                            </ul>
                        </div>
                    </div>
                </td>
            </tr>
            <tr>
                <td style="text-align: right; background-color: #E542A4;">
                    <label for="brideFather">Bride's Father :&nbsp;</label>
                </td>
                <td style="text-align: left;">
                    <select id="brideFather" name="brideFather" th:field="*{brideFather}">
                        <option th:value="${''}" th:text="${''}"></option>
                        <option th:each="person : ${people}"
                                th:value="${person.id}" th:text="${person.toString()}"></option>
                    </select>
                    <div th:if="${#fields.hasErrors('brideUsualResidence')}">
                        <ul class="text-danger">
                            <li th:each="err : ${#fields.errors('brideUsualResidence')}" th:text="${err}"/>
                        </ul>
                    </div>
                </td>
            </tr>
            <tr>
                <td style="text-align: right; background-color: #E542A4;">
                    <label for="brideUntrackedFather">Bride's Father (untracked) :&nbsp;</label>
                </td>
                <td style="text-align: left;">
                    <div>
                        <input class="brideUntrackedFather" id="brideUntrackedFather"
                               th:field="*{brideUntrackedFather}" type="text">
                        <div th:if="${#fields.hasErrors('brideUntrackedFather')}">
                            <ul class="text-danger">
                                <li th:each="err : ${#fields.errors('brideUntrackedFather')}" th:text="${err}"/>
                            </ul>
                        </div>
                    </div>
                </td>
            </tr>
            <tr style="border-bottom: 5px solid #ccc;">
                <td style="text-align: right;">
                    <label for="brideFatherRank">Bride's Father's Rank :&nbsp;</label>
                </td>
                <td style="text-align: left;">
                    <div>
                        <input class="brideFatherRank" id="brideFatherRank"
                               th:field="*{brideFatherRank}" type="text">
                        <div th:if="${#fields.hasErrors('brideFatherRank')}">
                            <ul class="text-danger">
                                <li th:each="err : ${#fields.errors('brideFatherRank')}" th:text="${err}"/>
                            </ul>
                        </div>
                    </div>
                </td>
            </tr>

            <tr>
                <td style="text-align: right;">
                    <label for="groom">Groom :&nbsp; </label>
                </td>
                <td style="text-align: left;">
                    <select id="groom" style="width: 300px;" name="groom" th:field="*{groom}">
                        <option th:value="${''}" th:text="${''}"></option>
                        <option th:each="person : ${people}"
                                th:value="${person.id}" th:text="${person.toString()}"></option>
                    </select>
                    <div th:if="${#fields.hasErrors('groom')}">
                        <ul class="text-danger">
                            <li th:each="err : ${#fields.errors('groom')}" th:text="${err}"/>
                        </ul>
                    </div>
                </td>
            </tr>
            <tr>
                <td style="text-align: right;">
                    <label for="groomCondition">Groom Condition :&nbsp;</label>
                </td>
                <td style="text-align: left;">
                    <select id="groomCondition" style="width: 200px;" name="groomCondition"
                            th:field="*{groomCondition}">
                        <option th:value="${''}" th:text="${''}"></option>
                        <option th:each="value : ${T(scot.carricksoftware.grants.enums.censusentry.CensusEntryCondition).values()}"
                                th:value="${value}" th:text="${value.label}"></option>
                    </select>
                    <div th:if="${#fields.hasErrors('groomCondition')}">
                        <ul class="text-danger">
                            <li th:each="err : ${#fields.errors('groomCondition')}" th:text="${err}"/>
                        </ul>
                    </div>
                </td>
            </tr>
            <tr>
                <td style="text-align: right;">
                    <label for="groomAge">Groom Age :&nbsp;</label>
                </td>
                <td style="text-align: left;">
                    <div>
                        <input class="groomAge" id="groomAge"
                               th:field="*{groomAge}" type="text">
                        <div th:if="${#fields.hasErrors('groomAge')}">
                            <ul class="text-danger">
                                <li th:each="err : ${#fields.errors('groomAge')}" th:text="${err}"/>
                            </ul>
                        </div>
                    </div>
                </td>
            </tr>
            <tr>
                <td style="text-align: right;">
                    <label for="groomRank">Groom Rank :&nbsp;</label>
                </td>
                <td style="text-align: left;">
                    <div>
                        <input class="groomRank" id="groomRank"
                               th:field="*{groomRank}" type="text">
                        <div th:if="${#fields.hasErrors('groomRank')}">
                            <ul class="text-danger">
                                <li th:each="err : ${#fields.errors('groomRank')}" th:text="${err}"/>
                            </ul>
                        </div>
                    </div>
                </td>
            </tr>
            <tr>
                <td style="text-align: right; background-color: #86B7FE;">
                    <label for="groomUsualResidence">Groom Residence :&nbsp;</label>
                </td>
                <td style="text-align: left;">
                    <select id="groomUsualResidence" name="groomUsualResidence" th:field="*{groomUsualResidence}">
                        <option th:value="${''}" th:text="${''}"></option>
                        <option th:each="place : ${places}"
                                th:value="${place.id}" th:text="${place.toString()}"></option>
                    </select>
                    <div th:if="${#fields.hasErrors('groomUsualResidence')}">
                        <ul class="text-danger">
                            <li th:each="err : ${#fields.errors('groomUsualResidence')}" th:text="${err}"/>
                        </ul>
                    </div>
                </td>
            </tr>
            <tr>
                <td style="text-align: right; background-color: #86B7FE;">
                    <label for="groomUntrackedResidence">Groom Residence (untracked) :&nbsp;</label>
                </td>
                <td style="text-align: left;">
                    <div>
                        <input class="groomUntrackedResidence" id="groomUntrackedResidence"
                               th:field="*{groomUntrackedResidence}" type="text">
                        <div th:if="${#fields.hasErrors('groomUntrackedResidence')}">
                            <ul class="text-danger">
                                <li th:each="err : ${#fields.errors('groomUntrackedResidence')}" th:text="${err}"/>
                            </ul>
                        </div>
                    </div>
                </td>
            </tr>
            <tr>
                <td style="text-align: right; background-color: #F6B7FE;">
                    <label for="groomFather">Groom's Father :&nbsp;</label>
                </td>
                <td style="text-align: left;">
                    <select id="groomFather" name="groomFather" th:field="*{groomFather}">
                        <option th:value="${''}" th:text="${''}"></option>
                        <option th:each="person : ${people}"
                                th:value="${person.id}" th:text="${person.toString()}"></option>
                    </select>
                    <div th:if="${#fields.hasErrors('groomFather')}">
                        <ul class="text-danger">
                            <li th:each="err : ${#fields.errors('groomFather')}" th:text="${err}"/>
                        </ul>
                    </div>
                </td>
            </tr>
            <tr>
                <td style="text-align: right; background-color: #F6B7FE;">
                    <label for="groomUntrackedFather">Groom's Father (untracked) :&nbsp;</label>
                </td>
                <td style="text-align: left;">
                    <div>
                        <input class="groomUntrackedFather" id="groomUntrackedFather"
                               th:field="*{groomUntrackedFather}" type="text">
                        <div th:if="${#fields.hasErrors('groomUntrackedFather')}">
                            <ul class="text-danger">
                                <li th:each="err : ${#fields.errors('groomUntrackedFather')}" th:text="${err}"/>
                            </ul>
                        </div>
                    </div>
                </td>
            </tr>
            <tr>
                <td style="text-align: right;">
                    <label for="groomFatherRank">Groom's Father's Rank :&nbsp;</label>
                </td>
                <td style="text-align: left;">
                    <div>
                        <input class="groomFatherRank" id="groomFatherRank"
                               th:field="*{groomFatherRank}" type="text">
                        <div th:if="${#fields.hasErrors('groomFatherRank')}">
                            <ul class="text-danger">
                                <li th:each="err : ${#fields.errors('groomFatherRank')}" th:text="${err}"/>
                            </ul>
                        </div>
                    </div>
                </td>
            </tr>
            <tr>
                <td>&nbsp;</td>
            </tr>

        </table>
        <button type="submit" class="btn btn-primary">Commit</button>
        <a class="btn btn-secondary" th:href="@{/marriageCertificates}" th:text="${'List all'}">List all</a>
        <a class="btn btn-success" th:href="@{/}" th:text="${'Home'}">Home</a>
        <h6><span style="color: rgb(255,0,0);">*</span><span> Cannot be edited</span></h6>
    </form>
</div>
</body>
</html>