<!DOCTYPE html>
<html lang="de" dir="ltr" xmlns:th="http://www.thymeleaf.org">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=0.75, user-scalable=no">

    <title>Einstellungen</title>
    <link rel="stylesheet" th:href="@{/css/ecom.css}"/>
</head>

<body>
<nav th:replace="fragments/header :: header">Header</nav>

<div class="sidebar-layout content-width">
    <nav></nav>
    <div>
        <h1>Einstellungen</h1>
    </div>
</div>
<main class="sidebar-layout content-width">
    <nav th:replace="fragments/customer :: sidebar"></nav>
    <div class="content-width">
        <form method="POST" th:action="@{/user/settings/changeMail}">
            <div>
                <h2> Login Daten </h2>
            </div>
            <div>
                <div class="input-icon">
                    <input class="full-width" type="text" name="email" th:value="${user.email}" required/>
                    <button> Email-Adresse ändern</button>
                </div>
            </div>
        </form>

        <form class="detailflex" method="POST" th:action="@{/user/settings/changePwd}">
            <div>
                <h2> Sicherheit </h2>
            </div>
            <div>
                <label for="password">Altes Passwort</label>
                <input class="full-width" type="password" name="old-password" placeholder="Passwort" id="password"
                       required>

                <label for="password1">Neues Passwort</label>
                <input class="full-width" type="password" name="password1" placeholder="Passwort" id="password1" required>
                <label for="password2">Neues Passwort wiederholen</label>
                <input class="full-width" type="password" name="password2" placeholder="Passwort" id="password2"
                       required>
                <button> Passwort Daten ändern</button>
            </div>
        </form>

        <form class="detailflex" method="POST" th:action="@{/user/settings/changeAddress}">
            <div>
                <h2> Rechungs- und Lieferinformation </h2>
            </div>

            <div class="col-2">
                <div>
                    <label for="salutation">Anrede</label>
                    <input class="full-width" list="salutationsOpt" name="salutation" id="salutation" placeholder="Anrede" th:value="${user.salutation}"
                           required/>
                    <datalist id="salutationsOpt">
                        <option value="Herr">
                        <option value="Frau">
                        <option value="Herr Dr.">
                        <option value="Frau Dr.">
                    </datalist>
                </div>
                <div>
                    <label for="name">Name</label>
                    <input class="full-width" type="text" name="name" id="name" placeholder="Nachname Vorname" th:value="${user.name}"
                           required/>
                </div>
            </div>

            <div>
                <label for="address">Anschrift</label>
                <textarea rows="5" class="full-width" type="text" name="address" id="address"
                          placeholder="Optional: Zusatz&#10;Optional: Unternehmen&#10;Straße Hausnummer&#10;Postleitzeit Ort&#10;Land" th:text="${user.defaultDeliveryAddress.addressString}"/>
            </div>
            <div>
                <button> Lieferinformation ändern</button>
            </div>
        </form>

        <form class="detailflex" method="POST" th:action="@{/user/settings/changePaymentInfo}">
            <div>
                <h2> Zahlungsinformation</h2>
            </div>
            <div>
                <div class="input-icon">
                    <input class="full-width" type="text" name="creditCardNumber" th:value="${user.defaultPayment.creditCardNumber}"/>
                    <button> Kreditkartennummer ändern</button>
                </div>
            </div>
        </form>
    </div>
</main>
<footer th:replace="fragments/footer :: footer"></footer>
</body>

</html>
