<div class="navbar navbar-default navbar-fixed-top">
    <div class="container">
        <div class="navbar-header">
            <a href="/" class="navbar-brand">Moma-Django</a>
            <button class="navbar-toggle" type="button" data-toggle="collapse" data-target="#navbar-main">
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
        </div>
        <div class="navbar-collapse collapse" id="navbar-main">
            <ul class="nav navbar-nav">
                <li>
                    <a href="/q/home/">View Questions</a>
                </li>
                <li class="dropdown">
                    <a class="dropdown-toggle" data-toggle="dropdown" href="#" id="viewq">View <span class="caret"></span></a>
                    <ul class="dropdown-menu" aria-labelledby="View Questions">
                        <li><a href="/q/home/">All</a></li>
                        <li class="divider"></li>
                        <li><a href="/q/home/?sort=rank">Ranked</a></li>
                        <li><a href="/q/home/?sort=time">By time</a></li>
                        <li><a href="/q/home/?filter=user">My questions</a></li>
                        <form class="navbar-form navbar-left" action="/q/search/" method="post">{% csrf_token %}
                            <input type="text" class="form-control col-lg-8" placeholder="Search" id="search" name="search">
                        </form>
                    </ul>
                </li>
                <li>
                    <a href="/q/edit/">New Question</a>
                </li>
                <li>
                    <a href="/about/">About</a>
                </li>
                <li>
                    <a href="https://github.com/gadio/moma-django" target="_blank">github</a>
                </li>
            </ul>

            <ul class="nav navbar-nav navbar-right">
                {% if the_user.is_authenticated %}
                    <li class="dropdown">
                        <a class="dropdown-toggle" data-toggle="dropdown" href="#" id="user">{{ the_user.username }} <span class="caret"></span></a>
                        <ul class="dropdown-menu" aria-labelledby="{{ the_user.username }}">
                            <li class="divider"></li>
                            <li><a href="/accounts/logout/">Logout</a></li>
                        </ul>
                    </li>
                {% else %}
                    <li><a href="/accounts/login/" >Login</a></li>
                {% endif %}
            </ul>

        </div>
    </div>
</div>
