<nav class="navbar navbar-expand-lg navbar-transparent navbar-dark bg-dark py-4">
    <div class="container">
        <a class="navbar-brand" href="{% url 'exam:home' %}"><strong>不夜城考试中心</strong><small>请勿通过旧网访问</small></a>
        <button class="navbar-toggler" type="button" data-action="offcanvas-open" data-target="#navbar_main" aria-controls="navbar_main" aria-expanded="false" aria-label="Toggle navigation">
          <span class="navbar-toggler-icon"></span>
        </button>
        <div class="navbar-collapse offcanvas-collapse" id="navbar_main">
            <ul class="navbar-nav ml-auto align-items-lg-center">
                <h6 class="dropdown-header font-weight-600 d-lg-none px-0">菜单</h6>
                <li class="nav-item active">
                    <a class="nav-link" href="{% url 'exam:home' %}">主页</a>
                </li>
                <li class="nav-item dropdown">
                    <a class="nav-link dropdown-toggle" href="#" id="navbar_main_dropdown_1" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">信息库</a>
                    <div class="dropdown-menu" aria-labelledby="navbar_1_dropdown_1">
                        <a class="dropdown-item" href="#">关于不夜城</a>
                        <a class="dropdown-item" href="#">科技公司</a>
                        <a class="dropdown-item" href="#">关于旧网</a>
                        <a class="dropdown-item" href="#">关于帮派</a>
                    </div>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="{% url 'exam:get_question' %}">前往答题</a>
                </li>
                <li class="nav-item">
                    <a href="{% url 'exam:about' %}" target="_blank" class="nav-link d-lg-none">关于这个网站</a>
                    <a href="{% url 'exam:about' %}" target="_blank" class="btn btn-sm bg-white d-none d-lg-inline-flex">关于这个网站</a>
                </li>
                <div class="dropdown-divider d-lg-none my-4"></div>
                {% if user.is_active %}
                    欢迎,{{ user.username }}
                    <li class="nav-item">
                        <a class="nav-link" href="{% url 'exam:logout' %}">退出</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="{% url 'exam:history' %}">历史答题</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="{% url 'exam:create' %}">贡献题目</a>
                    </li>
                {% else %}
                    <li class="nav-item">
                        <a class="nav-link" href="{% url 'exam:login' %}">登陆</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="{% url 'exam:register' %}">注册</a>
                    </li>
                {% endif %}
          </ul>
        </div>
    </div>
</nav>