Flask_web-template/app/templates/components/navbar.html
wensheng 5a0cf14d25 優化 部分顯示內容
變更大頭貼上傳路由,支援更多上傳圖片格式
2024-10-28 14:45:16 +08:00

82 lines
4.0 KiB
HTML

<nav class="navbar navbar-expand-lg bg-white border-bottom">
<div class="container">
<a class="navbar-brand fw-bold text-primary" href="{{ url_for('main.index') }}">
Evo論壇
</a>
<button class="navbar-toggler border-0" type="button"
data-bs-toggle="collapse" data-bs-target="#navbarContent">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarContent">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link px-3 {% if request.endpoint and request.endpoint == 'main.index' %}fw-medium text-primary{% endif %}"
href="{{ url_for('main.index') }}">
<i class="bi bi-house"></i> 首頁
</a>
</li>
<li class="nav-item">
<a class="nav-link px-3 {% if request.endpoint and request.endpoint.startswith('post.') %}fw-medium text-primary{% endif %}"
href="{{ url_for('post.index') }}">
<i class="bi bi-file-text"></i> 文章列表
</a>
</li>
<li class="nav-item">
<a class="nav-link px-3 {% if request.endpoint and request.endpoint == 'main.members' %}fw-medium text-primary{% endif %}"
href="{{ url_for('main.members') }}">
<i class="bi bi-people"></i> 會員列表
</a>
</li>
</ul>
<ul class="navbar-nav ms-auto">
{% if current_user.is_authenticated %}
<li class="nav-item">
<a class="nav-link px-3 {% if request.endpoint and request.endpoint == 'settings.index' %}fw-medium text-primary{% endif %}"
href="{{ url_for('settings.index') }}">
<i class="bi bi-gear"></i> 設定
</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link px-3 dropdown-toggle" href="#"
id="navbarDropdown" role="button"
data-bs-toggle="dropdown" aria-expanded="false">
<i class="bi bi-person-circle"></i>
{{ current_user.username }}
</a>
<ul class="dropdown-menu dropdown-menu-end shadow-sm border-0">
<li>
<a class="dropdown-item {% if request.endpoint and request.endpoint == 'auth.profile' %}fw-medium text-primary{% endif %}"
href="{{ url_for('auth.profile') }}">
<i class="bi bi-person me-2"></i> 個人資料
</a>
</li>
<li><hr class="dropdown-divider"></li>
<li>
<a class="dropdown-item text-danger" href="{{ url_for('auth.logout') }}">
<i class="bi bi-box-arrow-right me-2"></i> 登出
</a>
</li>
</ul>
</li>
{% else %}
<li class="nav-item">
<a class="nav-link px-3 {% if request.endpoint and request.endpoint == 'auth.login' %}fw-medium text-primary{% endif %}"
href="{{ url_for('auth.login') }}">
<i class="bi bi-box-arrow-in-right"></i> 登入
</a>
</li>
<li class="nav-item">
<a class="nav-link px-3 {% if request.endpoint and request.endpoint == 'auth.register' %}fw-medium text-primary{% endif %}"
href="{{ url_for('auth.register') }}">
<i class="bi bi-person-plus"></i> 註冊
</a>
</li>
{% endif %}
</ul>
</div>
</div>
</nav>