<!DOCTYPE html>

<html xmlns:th="https://www.thymeleaf.org" th:replace="~{fragments/layout :: layout (~{::body},'owners')}">

  <body>

    <h2>Owners</h2>

    <table id="owners" class="table table-striped">
        <thead>
        <tr>
            <th style="width: 150px;">Name</th>
            <th style="width: 200px;">Address</th>
            <th>City</th>
            <th style="width: 120px">Telephone</th>
            <th>Pets</th>
        </tr>
        </thead>
        <tbody>
          <tr th:each="owner : ${selections}">
              <td>
                  <a th:href="@{/owners/__${owner.id}__}" th:text="${owner.firstName + ' ' + owner.lastName}"/></a>
              </td>
              <td th:text="${owner.address}"/>
              <td th:text="${owner.city}"/>
              <td th:text="${owner.telephone}"/>
              <td><span th:each="pet : ${owner.pets}" th:text="${pet.name} "/></td>
          </tr>
        </tbody>
    </table>

  </body>
</html>
