<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8"/>
    <title>Edit person</title>
    <style type="text/css">
        body {
            padding: 50px;
        }

        label {
            display: inline-block;
            width: 100px;
        }

        input:read-only {
            background: lightgray;
        }

        .row {
            margin-top: 10px;
        }
    </style>
</head>
<body>

<!-- Person edition -->
<form id="edit-form" action="edit.html" th:method="post" th:action="@{/edit(id=${person.id})}"
      th:object="${person}">
    <h3>Person Info:</h3>

    <div class="row">
        <label for="id-input">ID:</label>
        <input id="id-input" type="text" readonly="readonly" value="1" th:value="*{id}"/>
    </div>

    <div class="row">
        <label for="person-name-input">Name:</label>
        <input id="person-name-input" name="name" type="text" value="John Doe" th:value="*{name}"/>
    </div>

    <div class="row">
        <button type="submit">Save</button>
        <a href="list.html" th:href="@{/}"><button type="button">Cancel</button></a>
    </div>
</form>

</body>
</html>
