<%- include ('../../partials/header.ejs') %>
    <%- include ('../../partials/navbar.ejs') %>
        <div class="container">
            <div class="card my-2">
                <div class="card-header">


                    <h2 class="my-2">Novo artigo </h2>

                </div>
                <div class="card-body">
                    <form class="mb-2" action="/article/save" method="post">

                        <div class="form-group">
                            <lable for="title" class="form-label">TÃ­tulo</lable>
                            <input type="text" name="title" id="title" placeholder="Defina o nome do seu artigo"
                                class="form-control">
                        </div>
                        <div class="form-group">
                            <!-- <label for="article">Corpo</label> -->
                            <textarea name="body" id="article" cols="30" rows="10" class="form-control"
                                placeholder="Escreva aqui o seu artigo"></textarea>
                        </div>
                        <div class="form-group">
                            <label for="category">
                                Categoria
                            </label>
                            <select name="category" id="category" class="form-control">
                                <option value="" selected>selecione</option>
                                <% categories.forEach(cat=> { %>

                                    <option value="<%= cat.id %>">
                                        <%= cat.title %>
                                    </option>
                                    <% }) %>
                            </select>
                        </div>
                        <div class="row">

                            <button type="submit" class="btn col-md-12 mt-2 btn-primary">
                                Salvar
                            </button>
                        </div>
                    </form>


                </div>

            </div>

        </div>
        <%- include ('../../partials/footer.ejs') %>