<!DOCTYPE html>
<html lang="fr">
    <head>
        <title>Math'Educ</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
        <link rel="stylesheet" href="../css/global.css">
    </head>

    <body id="bodyStyle">
        <div>
            <a href="/" role="button" class="fs-4 btn btn-secondary btn-lg position-absolute top-0 mt-2 end-0 me-2">
                Retour
            </a>
        </div>
        <div class="container mt-5 fs-4 text-light text-center">
            <p class="text-center bg-danger"> {{ error }} </p>
            <div class="row gy-2 mt-0 justify-content-center">
                <div class="col-3 bg-secondary border rounded">
                    <p> Player Nickname : </p>
                    <p>{{ player.nickname }} </p>
                    <a type="button" class="btn btn-primary fs-5" href="/user/players/updatemodal/{{ player.id }}"> Modifier votre mot de passe </a>
                    <a type="button" class="btn btn-primary fs-5" href="/user/players/delete/{{ player.id }}"> Supprimer votre compte </a>
                </div>
            </div>
            {% for maxscore in maxscores %}
                <div class="row gy-2 mt-0 justify-content-center">
                    <div class="col-3 bg-secondary border rounded">
                        <p> Maxscore pour le chapitre {{ maxscore["chapter"] }} : </p>
                        <p>{{ maxscore["maxscore"] }} </p>
                    </div>
                </div>
            {% endfor %}

        </div>

        <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>

        <div class="modal fade" id="modalPlayer">
            <div class="modal-dialog" role="document">
                <div class="modal-content">
                    <div class="modal-header">
                        <h5 class="modal-title" id="exampleModalLabel">Modifier votre mot de passe</h5>
                    </div>
                    <form method="POST" action="/user/players/updatemodal">
                        <div class="modal-body">
                            <div class="form-group">
                                <input type="hidden" class="form-control" id="updateId" name="id">
                            </div>
                            <div class="form-group">
                                <label for="password">Mot de passe :</label>
                                <input type="password" class="form-control" id="updatePassword" name="password">
                            </div>
                        </div>
                        <div class="modal-footer">
                            <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Fermer</button>
                            <button type="submit" class="btn btn-primary">Enregistrer</button>
                        </div>
                    </form>
                </div>
            </div>
        </div>

    </body>
</html>