158 lines
7.6 KiB
HTML
158 lines
7.6 KiB
HTML
{% load static %}
|
|
{% load i18n %}
|
|
{% load l10n %}
|
|
{% load humanize %}
|
|
{% load mastodon %}
|
|
{% load duration %}
|
|
{% load thumb %}
|
|
<!DOCTYPE html>
|
|
<html lang="zh" class="classic-page">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>{{ site_name }} - {% trans 'Search Results' %} {{ request.GET.q }}</title>
|
|
{% include "common_libs.html" %}
|
|
</head>
|
|
<body>
|
|
{% include '_header.html' %}
|
|
<main>
|
|
<div class="grid__main">
|
|
<div>
|
|
<div>
|
|
{% if request.GET.q %}
|
|
<hgroup>
|
|
<h5>“{{ request.GET.q }}”</h5>
|
|
<div>
|
|
{% visible_categories as cats %}
|
|
{% if request.GET.c and request.GET.c != 'all' %}
|
|
<a href="?q={{ request.GET.q }}&c=all">{% trans "all" %}</a>
|
|
{% else %}
|
|
{% trans "all" %}
|
|
{% endif %}
|
|
{% if 'book' in cats %}
|
|
|
|
|
{% if request.GET.c != 'book' %}
|
|
<a href="?q={{ request.GET.q }}&c=book">{% trans "books" %}</a>
|
|
{% else %}
|
|
{% trans "books" %}
|
|
{% endif %}
|
|
{% endif %}
|
|
{% if 'movie' in cats or 'tv' in cats %}
|
|
|
|
|
{% if request.GET.c != 'movietv' %}
|
|
<a href="?q={{ request.GET.q }}&c=movietv">{% trans "movie & tv" %}</a>
|
|
{% else %}
|
|
{% trans "movie & tv" %}
|
|
{% endif %}
|
|
{% endif %}
|
|
{% if 'podcast' in cats %}
|
|
|
|
|
{% if request.GET.c != 'podcast' %}
|
|
<a href="?q={{ request.GET.q }}&c=podcast">{% trans "podcasts" %}</a>
|
|
{% else %}
|
|
{% trans "podcasts" %}
|
|
{% endif %}
|
|
{% endif %}
|
|
{% if 'music' in cats %}
|
|
|
|
|
{% if request.GET.c != 'music' %}
|
|
<a href="?q={{ request.GET.q }}&c=music">{% trans "music" %}</a>
|
|
{% else %}
|
|
{% trans "music" %}
|
|
{% endif %}
|
|
{% endif %}
|
|
{% if 'game' in cats %}
|
|
|
|
|
{% if request.GET.c != 'game' %}
|
|
<a href="?q={{ request.GET.q }}&c=game">{% trans "games" %}</a>
|
|
{% else %}
|
|
{% trans "games" %}
|
|
{% endif %}
|
|
{% endif %}
|
|
{% if 'performance' in cats %}
|
|
|
|
|
{% if request.GET.c != 'performance' %}
|
|
<a href="?q={{ request.GET.q }}&c=performance">{% trans "performances" %}</a>
|
|
{% else %}
|
|
{% trans "performances" %}
|
|
{% endif %}
|
|
{% endif %}
|
|
</div>
|
|
</hgroup>
|
|
{% endif %}
|
|
{% if request.GET.tag %}
|
|
<h5>{% trans 'tag' %}: “{{ request.GET.tag }}”</h5>
|
|
{% endif %}
|
|
<div class="item-card-list">
|
|
{% for item in items %}
|
|
{% include '_list_item.html' with show_tags=1 %}
|
|
{% empty %}
|
|
<p>
|
|
无站内条目匹配。
|
|
{% if request.user.is_authenticated %}系统会尝试搜索其它网站的条目,点击标题可添加到本站。{% endif %}
|
|
</p>
|
|
<p>
|
|
如果你在
|
|
{% for site in sites %}
|
|
{{ site }}
|
|
{% if not forloop.last %}/{% endif %}
|
|
{% endfor %}
|
|
找到了相关条目,也可以把链接(如 <code>https://movie.douban.com/subject/1309046/</code> )输入到搜索栏中提交保存到本站。
|
|
</p>
|
|
{% endfor %}
|
|
</div>
|
|
{% if dup_items %}
|
|
<p class="empty">
|
|
{% blocktrans with dups=dup_items|length %} {{ dups }} items are from the same work or have the same identifier, they are hidden from the search results, <a _="on click toggle .unfold on #dup">click hereto show them.</a> {% endblocktrans %}
|
|
</p>
|
|
<div class="item-card-list folded" id="dup">
|
|
{% for item in dup_items %}
|
|
{% include '_list_item.html' with show_tags=1 %}
|
|
{% endfor %}
|
|
</div>
|
|
{% endif %}
|
|
<div class="item-card-list">
|
|
{% if request.GET.q and request.user.is_authenticated %}
|
|
<p hx-get="{% url 'catalog:external_search' %}?q={{ request.GET.q }}&c={{ request.GET.c }}&page={% if pagination.current_page %}{{ pagination.current_page }}{% else %}1{% endif %}"
|
|
hx-trigger="load"
|
|
hx-swap="outerHTML">
|
|
<span><i class="fa-solid fa-compact-disc fa-spin loading"></i></span>
|
|
{% trans 'Searching from other sites' %}
|
|
</p>
|
|
{% else %}
|
|
{% trans "Logged in user may see search results from other sites." %}
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
<div class="pagination">
|
|
{% if pagination.has_prev %}
|
|
<a href="?page=1&{% if request.GET.q %}q={{ request.GET.q }}{% elif request.GET.tag %}tag={{ request.GET.tag }}{% endif %}{% if request.GET.c %}&c={{ request.GET.c }}{% endif %}"
|
|
class="pagination__nav-link pagination__nav-link">«</a>
|
|
<a href="?page={{ pagination.previous_page }}&{% if request.GET.q %}q={{ request.GET.q }}{% elif request.GET.tag %}tag={{ request.GET.tag }}{% endif %}{% if request.GET.c %}&c={{ request.GET.c }}{% endif %}"
|
|
class="pagination__nav-link pagination__nav-link--right-margin pagination__nav-link">‹</a>
|
|
{% endif %}
|
|
{% for page in pagination.page_range %}
|
|
{% if page == pagination.current_page %}
|
|
<a href="?page={{ page }}&{% if request.GET.q %}q={{ request.GET.q }}{% elif request.GET.tag %}tag={{ request.GET.tag }}{% endif %}{% if request.GET.c %}&c={{ request.GET.c }}{% endif %}"
|
|
class="pagination__page-link pagination__page-link--current">{{ page }}</a>
|
|
{% else %}
|
|
<a href="?page={{ page }}&{% if request.GET.q %}q={{ request.GET.q }}{% elif request.GET.tag %}tag={{ request.GET.tag }}{% endif %}{% if request.GET.c %}&c={{ request.GET.c }}{% endif %}"
|
|
class="pagination__page-link">{{ page }}</a>
|
|
{% endif %}
|
|
{% endfor %}
|
|
{% if pagination.has_next %}
|
|
<a href="?page={{ pagination.next_page }}&{% if request.GET.q %}q={{ request.GET.q }}{% elif request.GET.tag %}tag={{ request.GET.tag }}{% endif %}{% if request.GET.c %}&c={{ request.GET.c }}{% endif %}"
|
|
class="pagination__nav-link pagination__nav-link--left-margin">›</a>
|
|
<a href="?page={{ pagination.last_page }}&{% if request.GET.q %}q={{ request.GET.q }}{% elif request.GET.tag %}tag={{ request.GET.tag }}{% endif %}{% if request.GET.c %}&c={{ request.GET.c }}{% endif %}"
|
|
class="pagination__nav-link">»</a>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<aside class="grid__aside bottom">
|
|
{% include "_sidebar_search.html" %}
|
|
</aside>
|
|
</main>
|
|
{% include '_footer.html' %}
|
|
</body>
|
|
</html>
|