<!DOCTYPE html>
<html lang="it">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" type="text/css" href="/static/style.css">
    <title>Profilo</title>
    <%- include('../partials/navbar'); %>
</head>
<body>
    <div class="container container-fluid" id="titlecenter">

        <% if(messaggio.length != 0) { %>
            <div class="alert alert-warning alert-dismissible fade show" role="alert">
                <%= messaggio %>
                <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
            </div>
        <% } %>

        <dl>
            <dt>
                Nome: <%= User.Nome %>
            </dt>
            <dt>
                Cognome: <%= User.Cognome %>
            </dt>
            <dt>
                Email: <%= User.Email %>
            </dt>
        </dl>
            <br>
                <h3 id="titleleft">Cambia password</h3>
                <form action="/profilo" method="POST">
                    <div class="form-group row">
                        <div class="form-group col-md-6">
                            <div class="form-floating mb-3">
                                <input class="form-control" type="password" name="currentpassword" id="currentpassword" required>
                                <label for="currentpassword">Password corrente</label>
                            </div>
                        </div>
                        <div class="form-group col-md-6">
                            <div class="form-floating mb-3">
                                <input class="form-control" type="password" name="newpassword" id="newpassword" required>
                                <label for="newpassword">Nuova password</label>
                            </div>
                        </div>
                        <div class="form-group">
                            <input class="btn btn-primary" type="submit" value="Invia" />
                        </div>
                    </div>
                </form>
    </div>
</body>
</html>