<!-- include header -->
<%- include('include/_header') %>
<!-- /include header -->

<!-- Main Site -->
<main id="site-main">
    <div class="container">
        <div class="box-nav d-flex justify-between">
            <div class="filter">
                <a href="/"><i class="fas fa-angle-double-left"></i> All Games</a>
            </div>
         </div>
         <div class="form-title text-center">
             <h2 class="text-dark">Update Game</h2>
             <span class="text-light">Use the below form to create a game</span>
         </div>

         <!-- form handling -->
         <form action="/" method="POST" id="update_game">
            <div class="new_game">
                <div class="form-group">
                    <label for="name" class="text-light">Game title</label>
                    <input type="hidden" name="id" value="<%= game._id %>">
                    <input type="text" name="name" value="<%= game.name %>">
                </div>
                <div class="form-group">
                    <label for="genre" class="text-light">Genre</label>
                    <input type="text" name="genre" value="<%= game.genre %>">
                </div>
                <div class="form-group">
                    <label for="price" class="text-light">Price</label>
                    <input type="text" name="price" value="<%= game.price %>">
                </div>
                <div class="form-group">
                    <label for="publisher" class="text-light">Publisher</label>
                    <input type="text" name="publisher" value="<%= game.publisher %>">
                </div>
                <div class="form-group">
                    <label for="time" class="text-light">Hours to finish</label>
                    <input type="text" name="time" value="<%= game.time %>">
                </div>

                <div class="form-group">
                    <button type="submit" class="btn text-dark update">Save</button>
                </div>

            </div>
        </form>
    </div>
</main>
<!-- /Main Site -->

<!-- include footer -->
<%- include('include/_footer') %>
<!-- /include footer -->