<nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top">
    <div class="container-fluid">
        <a class="navbar-brand" href="/admin">{{ site_title }}</a>
        <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
            <span class="navbar-toggler-icon"></span>
        </button>
        <div class="collapse navbar-collapse" id="navbarNav">
            <ul class="navbar-nav me-auto">
                <li class="nav-item">
                    <a class="nav-link" href="/admin">{{ 'Home' if language == 'en_US' else '主页' }}</a>
                </li>
            </ul>
            <ul class="navbar-nav">
                <li class="nav-item dropdown">
                    <a class="nav-link dropdown-toggle" href="#" id="languageDropdown" role="button" data-bs-toggle="dropdown">
                        <i class="bi bi-globe"></i>
                        {{ 'English' if language == 'en_US' else '中文' }}
                    </a>
                    <ul class="dropdown-menu dropdown-menu-end">
                        <li><a class="dropdown-item" href="#" onclick="setLanguage('zh_CN')">中文</a></li>
                        <li><a class="dropdown-item" href="#" onclick="setLanguage('en_US')">English</a></li>
                    </ul>
                </li>
                {% if user %}
                <li class="nav-item">
                    <span class="nav-link">{{ get_text('welcome', language) }}, {{ user.username }}</span>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="/admin/logout">{{ get_text('logout', language) }}</a>
                </li>
                {% else %}
                <li class="nav-item">
                    <a class="nav-link" href="/admin/login">{{ get_text('login', language) }}</a>
                </li>
                {% endif %}
            </ul>
        </div>
    </div>
</nav> 