<%- include("../../../../important/admin/views/_layouts/adminheader") %>
    <h2 class="admin-page__main-title">Edit a blog</h2>
    <% include ../../../../important/admin/views/_layouts/messages/errors %>
    <button class="admin-button admin-button--add-something">
        <a href="/admin/blogs"><i class="fa fa-hand-point-left"></i></a>
    </button>
    <br>
    <br>

    <form method="post" action="/admin/blogs/edit-blog/<%= id %>" class="admin-form">

        <%- include ../../../../important/AristosStuff/AristosTextEditor/AristosTextEditor %>
            <div class="admin-form__form-options--bottom-group">
                <div class="admin-form__form-options">
                    <div class="admin-form__group">
                        <label for="">Title</label>
                        <input type="text" class="form-control" name="title" value="<%= title %>" placeholder="Title">

                    </div>
                    <div class="admin-form__group">
                        <label for="">Slug</label>
                        <input type="text" class="form-control" name="slug" value="<%= slug %>" placeholder="Slug">

                    </div>

                    <div class="admin-form__group">
                        <label for="">Category</label>
                        <select name="category" class="form-control">
                            <% categories.forEach(function(category){ %>
                                <option value="<%= category._id %>" <% if (category.slug == selectedCat) { %>
                                    selected = "selected"
                                    <% } %>
                                >
                                    <%= category.title %>
                                </option>
                                <% }); %>
                        </select>
                    </div>
                    <div class="admin-form__group">
                        <label for="">Allow Comments</label>
                        <input type="checkbox" class="form-control" name="allowComments"
                        <% if(allowComments){ %>
                            checked
                        <% } %>
                        >
                    </div>


                </div>
                <div class="admin-form__form-options admin-form__form-options--second-group">
                    <div class="admin-form__group">
                        <label for="">Meta Description</label>
                        <textarea class="admin-form--disabled-resize" rows="4" name="description" placeholder="Place a brief description of this blog. Max of 320 characters including spaces."
                            maxlength="320"><%= description %></textarea>
                    </div>
                    <div class="admin-form__group">
                        <label for="">Meta Keywords</label>
                        <textarea class="admin-form--disabled-resize" rows="4" name="keywords" placeholder="Place your keywords seperated by a comma. Max of 300 characters. EX. neat blog, neater topic, neatest person"
                            maxlength="300"><%= keywords %></textarea>
                    </div>

                </div>
            </div>

            <button class="admin-button admin-button--submit">Submit</button>
          
    </form>
    <%- include("../../../../important/admin/views/_layouts/adminfooter") %>