<nav class="navbar navbar-expand-lg navbar-dark py-md-3">
    <div class="container">
        <a class="navbar-brand" href="/">AniTrack</a>
        <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
            <span class="navbar-toggler-icon"></span>
        </button>
        <div class="collapse navbar-collapse" id="navbarSupportedContent">
            <div class="navbar-nav ml-auto">
                <form class="form-inline" action="/anime/search">
                    <input class="form-control mr-sm-2" type="search" placeholder="Search for anime" aria-label="Search" name="name">
                    <input type="hidden" name="genre">
                    <input type="hidden" name="status">
                    <input type="hidden" name="order_by">
                    <input type="hidden" name="sort_by">
                    <button class="btn btn-outline-dark my-2 my-sm-0 mr-1" type="submit">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-search" viewBox="0 0 16 16">
                            <path d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z"/>
                        </svg>
                    </button>
                </form>
                <li class="nav-item dropdown">
                    <a class="nav-link dropdown-toggle" href="#" id="navbarDropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                    </a>
                    <div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
                        <a class="dropdown-item" href="/anime/search">Search (Advanced)</a>
                        <a class="dropdown-item" href="/anime/season-search">Search By Season</a>
                    </div>
                </li>
                <% if(locals.user !== null) { %>
                    <li class="nav-item dropdown">
                        <a class="nav-link dropdown-toggle" href="#" id="navbarDropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                            |  <%= locals.user.name %>
                        </a>
                        <div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
                            <a class="dropdown-item" href="/watchlist">My Watchlist</a>
                            <div class="dropdown-divider"></div>
                            <a class="dropdown-item" href="/logout">Logout</a>
                        </div>
                    </li>
                <% }else { %>
                    <a class="nav-item nav-link" href="/login">Login</a>
                    <a class="btn btn-outline-light nav-item" href="/register" role="button">Register</a>
                <% } %>
            </div>
        </div>
    </div>
    
</nav>