<!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>Aggiungi libro</title>
    <%- include('./partials/navbar'); %>
</head>
<body>
    <div class="container">

        <div class="title" id="titleleft">
            <h2>Aggiungi</h2>
        </div>

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

        <form method="POST" action="/libreria/aggiungi" id="addForm">
            <div class="form-group row">
                <div class="form-group col-md-6">
                    <label for="inputISBN">Isbn libro che vuoi aggiungere</label>
                    <input type="number" class="form-control" id="inputISBN" placeholder="Isbn" name="Isbn" required>
                </div>
                <div class="form-group col-md-6">
                    <label for="inputPagineLette">Pagine che hai letto</label>
                    <input type="number" class="form-control" id="inputPagineLette" placeholder="0,1,2,3..." name="PagineLette" required>
                </div>
            </div>
            <br>
            <div class="form-group row">
                <div class="form-group col-md-6">
                    <label for="inputImpressioni">Impressioni</label>
                    <textarea class="form-control" id="inputImpressioni" placeholder="Cosa ti è piaciuto?" name="Impressioni"></textarea>
                </div>
                <div class="form-group col-md-6">
                    <label for="inputValutazione">Valutazione</label>
                    <select id="inputValutazione" class="form-select" name="Valutazione">
                        <option selected value="0">0 (non ancora valutato)</option>
                        <option value="1">1 (non mi è piaciuto)</option>
                        <option value="2">2</option>
                        <option value="3">3</option>
                        <option value="4">4</option>
                        <option value="5">5 (mi è piaciuto molto)</option>
                    </select>
                </div>
            </div>
            <br>
            <div class="form-group">
                <label for="completo">Completato?</label>
                    <select id="completo" class="form-select" name="Completato">
                        <option value="0" selected>no</option>
                        <option value="1">si</option>
                    </select>
            </div>
            <br>
            <input type="submit" class="w-100 btn btn-lg btn-primary" value="Aggiungi" />
        </form>
    </div>
</body>
</html>