2023-05-20 11:01:18 -04:00
|
|
|
{% load admin_url %}
|
2023-07-12 01:11:15 -04:00
|
|
|
{% load duration %}
|
2023-05-20 11:01:18 -04:00
|
|
|
{% load static %}
|
|
|
|
{% load i18n %}
|
|
|
|
<header class="container-fluid">
|
|
|
|
<nav>
|
|
|
|
<ul class="nav-logo">
|
|
|
|
<a href="{% url 'common:home' %}">
|
2023-08-20 18:27:20 +00:00
|
|
|
<img src="{{ site_logo }}" alt="" />
|
2023-05-20 11:01:18 -04:00
|
|
|
</a>
|
|
|
|
</ul>
|
2023-06-04 11:47:17 -04:00
|
|
|
<ul class="nav-search {% if request.GET.q %}unhide{% endif %}">
|
2023-05-20 11:01:18 -04:00
|
|
|
<li>
|
|
|
|
<form role="search" method="get" action="{% url 'catalog:search' %}">
|
|
|
|
<input type="search"
|
|
|
|
name="q"
|
2023-06-04 11:47:17 -04:00
|
|
|
id="q"
|
2023-08-13 18:00:10 -04:00
|
|
|
placeholder="标题、创作者、ISBN、站外条目链接、@用户名、@用户名@实例"
|
2023-05-20 11:01:18 -04:00
|
|
|
class="search"
|
|
|
|
value="{{ request.GET.q|default:'' }}" />
|
|
|
|
<select name="c">
|
2023-07-12 01:11:15 -04:00
|
|
|
{% visible_categories as cats %}
|
2023-05-20 11:01:18 -04:00
|
|
|
<option value="all">全部</option>
|
2023-07-12 01:11:15 -04:00
|
|
|
{% if 'book' in cats %}
|
|
|
|
<option {% if request.GET.c == 'book' or '/book/' in request.path %}selected{% endif %}
|
|
|
|
value="book">书籍</option>
|
|
|
|
{% endif %}
|
|
|
|
{% if 'movie' in cats or 'tv' in cats %}
|
|
|
|
<option {% if request.GET.c and request.GET.c == 'movietv' or '/movie/' in request.path or '/tv/' in request.path %}selected{% endif %}
|
|
|
|
value="movietv">影视</option>
|
|
|
|
{% endif %}
|
|
|
|
{% if 'podcast' in cats %}
|
|
|
|
<option {% if request.GET.c and request.GET.c == 'podcast' or '/podcast/' in request.path %}selected{% endif %}
|
|
|
|
value="podcast">播客</option>
|
|
|
|
{% endif %}
|
|
|
|
{% if 'music' in cats %}
|
|
|
|
<option {% if request.GET.c and request.GET.c == 'music' or '/album/' in request.path %}selected{% endif %}
|
|
|
|
value="music">音乐</option>
|
|
|
|
{% endif %}
|
|
|
|
{% if 'game' in cats %}
|
|
|
|
<option {% if request.GET.c and request.GET.c == 'game' or '/game/' in request.path %}selected{% endif %}
|
|
|
|
value="game">游戏</option>
|
|
|
|
{% endif %}
|
|
|
|
{% if 'performance' in cats %}
|
|
|
|
<option {% if request.GET.c == 'performance' or '/performance/' in request.path %}selected{% endif %}
|
|
|
|
value="performance">演出</option>
|
|
|
|
{% endif %}
|
2023-05-20 11:01:18 -04:00
|
|
|
</select>
|
|
|
|
<input type="submit" value="" class="fa-solid" />
|
|
|
|
</form>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
<ul>
|
|
|
|
<li class="small-only">
|
2023-06-04 11:47:17 -04:00
|
|
|
<a _="on click toggle .unhide on .nav-search then call #q.focus()">搜索</a>
|
2023-05-20 11:01:18 -04:00
|
|
|
</li>
|
|
|
|
<li>
|
2023-05-26 16:14:07 -04:00
|
|
|
<a class="{% if current == 'discover' %}secondary{% endif %}"
|
2023-05-20 11:01:18 -04:00
|
|
|
href="{% url 'catalog:discover' %}">发现</a>
|
|
|
|
</li>
|
|
|
|
<li>
|
2023-05-26 16:14:07 -04:00
|
|
|
<a class="{% if current == 'timeline' %}secondary{% endif %}"
|
2023-05-20 11:01:18 -04:00
|
|
|
href="{% url 'social:feed' %}">动态</a>
|
|
|
|
</li>
|
2023-06-08 23:37:50 -04:00
|
|
|
<li>
|
2023-05-26 16:14:07 -04:00
|
|
|
<a class="{% if current == 'home' %}secondary{% endif %}"
|
2023-05-20 11:01:18 -04:00
|
|
|
href="{% url 'common:me' %}">个人</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
<ul class="nav-dropdown">
|
|
|
|
<li>
|
|
|
|
<details class="dropdown">
|
|
|
|
<summary aria-haspopup="listbox">
|
|
|
|
<span class="avatar">
|
|
|
|
<img alt=""
|
2023-08-24 05:48:14 +00:00
|
|
|
src="{% if request.user.is_authenticated %}{{ request.user.avatar }}{% else %}{{ user_icon }}{% endif %}" />
|
2023-05-20 11:01:18 -04:00
|
|
|
</span>
|
|
|
|
</summary>
|
|
|
|
<ul role="listbox" style="min-width:-webkit-max-content;" dir="rtl">
|
|
|
|
{% if request.user.is_authenticated %}
|
|
|
|
<li>
|
2023-07-05 00:47:54 -04:00
|
|
|
<a href="{% url 'users:data' %}">数据</a>
|
2023-05-20 11:01:18 -04:00
|
|
|
</li>
|
|
|
|
<li>
|
2023-07-05 00:47:54 -04:00
|
|
|
<a href="{% url 'users:preferences' %}">设置</a>
|
2023-07-04 17:21:17 -04:00
|
|
|
</li>
|
|
|
|
<li>
|
2023-07-05 00:47:54 -04:00
|
|
|
<a href="{% url 'users:info' %}">账号</a>
|
2023-05-20 11:01:18 -04:00
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<a href="{% url 'users:logout' %}">登出</a>
|
|
|
|
</li>
|
|
|
|
{% if request.user.is_superuser %}
|
|
|
|
<li>
|
2024-04-13 00:57:17 -04:00
|
|
|
<a href="{% admin_url %}">django</a>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<a href="/admin/">admin</a>
|
2023-05-20 11:01:18 -04:00
|
|
|
</li>
|
|
|
|
{% endif %}
|
|
|
|
{% else %}
|
|
|
|
<li>
|
|
|
|
<a href="{% url 'users:login' %}?next={{ request.path }}">登录</a>
|
|
|
|
</li>
|
|
|
|
{% endif %}
|
|
|
|
</ul>
|
|
|
|
</details>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</nav>
|
|
|
|
</header>
|
2023-07-12 16:33:15 -04:00
|
|
|
{% if request.user.is_authenticated and not request.user.mastodon_username and not request.user.username %}
|
|
|
|
<ul class="messages" style="text-align:center">
|
2023-07-05 00:47:54 -04:00
|
|
|
<li class="error">
|
|
|
|
请<a href="{% url 'users:info' %}">设置用户名</a>
|
|
|
|
</li>
|
2023-07-12 16:33:15 -04:00
|
|
|
</ul>
|
|
|
|
{% endif %}
|
2023-05-20 11:01:18 -04:00
|
|
|
{% if messages %}
|
2023-07-05 00:47:54 -04:00
|
|
|
<ul class="messages" style="text-align:center">
|
|
|
|
{% for message in messages %}
|
|
|
|
<li {% if message.tags %}class="{{ message.tags }}"{% endif %}>{{ message }}</li>
|
|
|
|
{% endfor %}
|
|
|
|
</ul>
|
2023-05-20 11:01:18 -04:00
|
|
|
{% endif %}
|