more i18n

This commit is contained in:
Your Name 2024-05-19 16:32:59 -04:00 committed by Henri Dickson
parent 5ed7193200
commit a6b0134b29
66 changed files with 1432 additions and 1477 deletions

View file

@ -113,7 +113,7 @@ class Edition(Item):
_("language"), null=True, blank=True, default=None, max_length=500
)
pub_house = jsondata.CharField(
_("publisher"), null=True, blank=False, default=None, max_length=500
_("publishing house"), null=True, blank=False, default=None, max_length=500
)
pub_year = jsondata.IntegerField(
_("publication year"),

View file

@ -94,7 +94,7 @@ class Album(Item):
media = jsondata.CharField(_("media type"), blank=True, default="", max_length=500)
bandcamp_album_id = jsondata.CharField(blank=True, default="", max_length=500)
disc_count = jsondata.IntegerField(
_("number of disc"), blank=True, default="", max_length=500
_("number of discs"), blank=True, default="", max_length=500
)
def get_embed_link(self):

View file

@ -1,14 +1,17 @@
{% load i18n %}
{% if people %}
<span>
{% if role %}{{ role }}{% endif %}
{% if role %}
{% trans role %}:
{% endif %}
{% for p in people %}
{% if forloop.counter <= max %}
{% if not forloop.first %}{% endif %}
{% if not forloop.first %}/{% endif %}
<span>{{ p.name }}
{% if p.role.strip %}({{ p.role }}){% endif %}
{% if p.role.strip %}(as {{ p.role }}){% endif %}
</span>
{% elif forloop.last %}
{% endif %}
{% endfor %}
</span>

View file

@ -1,12 +1,13 @@
{% load i18n %}
{% for role, list in people.items %}
<div class="crew-list">
{{ role }}
{% trans role %}:
{% for p in list %}
{% if forloop.counter <= max %}
{% if not forloop.first %}{% endif %}
{% if not forloop.first %}/{% endif %}
<span>{{ p }}</span>
{% elif forloop.last %}
{% endif %}
{% endfor %}
</div>

View file

@ -1,5 +1,4 @@
<p>
<i class="fa-solid fa-triangle-exclamation"></i>
无法加载条目,请确认链接正确。
部分网站可能删除条目或隐藏条目为仅登录可见,欢迎在本站手工添加这些条目。
{% trans "Unable to fetch from the link, please check again. Some sites may require login for certain links, please manually create them here." %}
</p>

View file

@ -4,16 +4,18 @@
{% block brief %}
<div class="multi-fields">
{% if item.rating %}
<span class="solo-hidden">{{ item.rating | floatformat:1 }} <small>({{ item.rating_count }}人评分)</small></span>
<span class="solo-hidden">{{ item.rating | floatformat:1 }} <small>({{ item.rating_count }} {% trans "ratings" %})</small></span>
{% endif %}
{% include '_people.html' with people=item.artist role='' max=2 %}
{% include '_people.html' with people=item.genre role='流派' max=5 %}
{% include '_people.html' with people=item.genre role='genre' max=5 %}
</div>
{% endblock brief %}
{% block full %}
<div class="multi-fields">
{% if item.release_date %}<span>发行时间:{{ item.release_date }}</span>{% endif %}
{% include '_people.html' with people=item.company role='发行方' max=2 %}
{% if item.release_date %}
<span>{% trans "release date" %} {{ item.release_date }}</span>
{% endif %}
{% include '_people.html' with people=item.company role='publisher' max=2 %}
</div>
<div>
<div>

View file

@ -29,7 +29,7 @@
</span>
{% endif %}
{% if item.parent_item %}
<span>所属{{ item.parent_item.type.label }}<a href="{{ item.parent_item.url }}">{{ item.parent_item.title }}</a></span>
<span>{% trans "part of" %} {{ item.parent_item.type.label }}: <a href="{{ item.parent_item.url }}">{{ item.parent_item.title }}</a></span>
{% endif %}
</small>
</hgroup>

View file

@ -2,22 +2,21 @@
{% load humanize %}
{% load i18n %}
{% block brief %}
<div class="multi-fields">
{% if item.rating %}
<span class="solo-hidden">{{ item.rating | floatformat:1 }} <small>({{ item.rating_count }}人评分)</small></span>
<span class="solo-hidden">{{ item.rating | floatformat:1 }} <small>({{ item.rating_count }} {% trans "ratings" %})</small></span>
{% endif %}
{% include '_people.html' with people=item.author role='作者' max=2 %}
{% include '_people.html' with people=item.translator role='译者' max=2 %}
{% include '_people.html' with people=item.director role='导演' max=2 %}
{% include '_people.html' with people=item.author role='author' max=2 %}
{% include '_people.html' with people=item.translator role='translator' max=2 %}
{% include '_people.html' with people=item.director role='director' max=2 %}
{% include '_people.html' with people=item.hosts role='' max=2 %}
{% include '_people.html' with people=item.artist role='' max=2 %}
{% include '_people.html' with people=item.developer role='' max=2 %}
{% if item.pub_house %}<span>{{ item.pub_house }}</span>{% endif %}
{% if item.pub_year %}
<span>
{{ item.pub_year }}{% trans '年' %}
{% if item.pub_month %}
{{ item.pub_month }}{% trans '月' %}
{% endif %}
{{ item.pub_year }}
{% if item.pub_month %}-{{ item.pub_month }}{% endif %}
</span>
{% endif %}
{% if item.release_date %}<span>{{ item.release_date }}</span>{% endif %}
@ -27,19 +26,18 @@
{% comment %} {% include '_people.html' with people=item.language role='' max=5 %} {% endcomment %}
{% include '_people.html' with people=item.platform role='' max=5 %}
{% if item.show %}
<span>{{ item.show.type.label }}<a href="{{ item.show.url }}">{{ item.show.title }}</a></span>
<span>{{ item.show.type.label }}: <a href="{{ item.show.url }}">{{ item.show.title }}</a></span>
{% endif %}
</div>
{% endblock brief %}
{% block full %}
{% comment %} {% if item.actor %}
{% include '_people.html' with people=item.actor role='主演' max=2 %}
{% include '_people.html' with people=item.actor role='actor' max=2 %}
<br>
{% endif %} {% endcomment %}
{% if item.other_title %}
{% include '_people.html' with people=item.other_title role='又名' max=2 %}
<br>
{% endif %}
<div>
{% include '_people.html' with people=item.other_title role='other title' max=2 %}
{% endif %}
<div>
{% if not hide_brief %}{{ item.brief | linebreaksbr }}{% endif %}
</div>
</div>
{% endblock full %}

View file

@ -4,20 +4,18 @@
{% block brief %}
<div class="multi-fields">
{% if item.rating %}
<span class="solo-hidden">{{ item.rating | floatformat:1 }} <small>({{ item.rating_count }}人评分)</small></span>
{% endif %}
{% if item.other_title %}
{% include '_people.html' with people=item.other_title role='又名' max=2 %}
<span class="solo-hidden">{{ item.rating | floatformat:1 }} <small>({{ item.rating_count }} {% trans "ratings" %})</small></span>
{% endif %}
{% include '_people.html' with people=item.other_title role='other title' max=2 %}
{% if item.release_date %}<span>{{ item.release_date }}</span>{% endif %}
</div>
{% endblock brief %}
{% block full %}
<div class="multi-fields">
{% include '_people.html' with people=item.genre role='类型' max=2 %}
{% include '_people.html' with people=item.platform role='平台' max=5 %}
{% include '_people.html' with people=item.developer role='研发' max=2 %}
{% include '_people.html' with people=item.publisher role='发行' max=2 %}
{% include '_people.html' with people=item.genre role='genre' max=2 %}
{% include '_people.html' with people=item.platform role='platform' max=5 %}
{% include '_people.html' with people=item.developer role='developer' max=2 %}
{% include '_people.html' with people=item.publisher role='publisher' max=2 %}
</div>
<div>
{% if not hide_brief %}{{ item.brief | linebreaksbr }}{% endif %}

View file

@ -4,18 +4,14 @@
{% block brief %}
<div class="multi-fields">
{% if item.rating %}
<span class="solo-hidden">{{ item.rating | floatformat:1 }} <small>({{ item.rating_count }}人评分)</small></span>
<span class="solo-hidden">{{ item.rating | floatformat:1 }} <small>({{ item.rating_count }} {% trans "ratings" %})</small></span>
{% endif %}
{% include '_people.html' with people=item.director role='导演' max=2 %}
{% include '_people.html' with people=item.actor role='主演' max=2 %}
{% include '_people.html' with people=item.director role='director' max=2 %}
{% include '_people.html' with people=item.actor role='actor' max=2 %}
</div>
{% endblock brief %}
{% block full %}
<div class="multi-fields">
{% if item.other_title %}
{% include '_people.html' with people=item.other_title role='又名' max=5 %}
{% endif %}
</div>
<div class="multi-fields">{% include '_people.html' with people=item.other_title role='other title' max=2 %}</div>
<div>
{% if not hide_brief %}{{ item.brief | linebreaksbr }}{% endif %}
</div>

View file

@ -4,24 +4,24 @@
{% block brief %}
<div class="multi-fields">
{% if item.rating %}
<span class="solo-hidden">{{ item.rating | floatformat:1 }} <small>({{ item.rating_count }}人评分)</small></span>
<span class="solo-hidden">{{ item.rating | floatformat:1 }} <small>({{ item.rating_count }} {% trans "ratings" %})</small></span>
{% endif %}
{% include '_people.html' with people=item.genre role='类型' max=2 %}
{% include '_people.html' with people=item.playwright role='编剧' max=2 %}
{% include '_people.html' with people=item.composer role='作曲' max=2 %}
{% include '_people.html' with people=item.choreographer role='编舞' max=2 %}
{% include '_people.html' with people=item.orig_creator role='原作' max=2 %}
{% include '_people.html' with people=item.genre role='genre' max=2 %}
{% include '_people.html' with people=item.playwright role='playwright' max=2 %}
{% include '_people.html' with people=item.composer role='composer' max=2 %}
{% include '_people.html' with people=item.choreographer role='choreographer' max=2 %}
{% include '_people.html' with people=item.orig_creator role='original creator' max=2 %}
</div>
{% endblock brief %}
{% block full %}
<div class="multi-fields">
{% include '_people.html' with people=item.other_title role='又名' max=2 %}
{% include '_people.html' with people=item.language role='语言' max=5 %}
{% include '_people.html' with people=item.troupe role='剧团' max=2 %}
{% include '_people.html' with people=item.location role='剧院' max=2 %}
{% include '_people.html' with people=item.director role='导演' max=2 %}
{% include '_actor.html' with people=item.actor role='主演' max=5 %}
{% include '_people.html' with people=item.performer role='表演者' max=5 %}
{% include '_people.html' with people=item.other_title role='other title' max=2 %}
{% include '_people.html' with people=item.language role='language' max=5 %}
{% include '_people.html' with people=item.troupe role='troupe' max=2 %}
{% include '_people.html' with people=item.location role='theater' max=2 %}
{% include '_people.html' with people=item.director role='director' max=2 %}
{% include '_actor.html' with people=item.actor role='actor' max=5 %}
{% include '_people.html' with people=item.performer role='performer' max=5 %}
</div>
<div>
{% if not hide_brief %}{{ item.brief | linebreaksbr }}{% endif %}

View file

@ -4,24 +4,24 @@
{% block brief %}
<div class="multi-fields">
{% if item.rating %}
<span class="solo-hidden">{{ item.rating | floatformat:1 }} <small>({{ item.rating_count }}人评分)</small></span>
<span class="solo-hidden">{{ item.rating | floatformat:1 }} <small>({{ item.rating_count }} {% trans "ratings" %})</small></span>
{% endif %}
{% include '_people.html' with people=item.genre role='类型' max=2 %}
{% include '_people.html' with people=item.language role='语言' max=5 %}
{% include '_people.html' with people=item.troupe role='剧团' max=2 %}
{% include '_people.html' with people=item.location role='剧院' max=2 %}
{% include '_people.html' with people=item.director role='导演' max=2 %}
{% include '_people.html' with people=item.orig_creator role='原作' max=2 %}
{% include '_people.html' with people=item.genre role='genre' max=2 %}
{% include '_people.html' with people=item.language role='language' max=5 %}
{% include '_people.html' with people=item.troupe role='troupe' max=2 %}
{% include '_people.html' with people=item.location role='theater' max=2 %}
{% include '_people.html' with people=item.director role='director' max=2 %}
{% include '_people.html' with people=item.orig_creator role='original creator' max=2 %}
</div>
{% endblock brief %}
{% block full %}
<div class="multi-fields">
{% include '_people.html' with people=item.other_title role='又名' max=2 %}
{% include '_people.html' with people=item.playwright role='编剧' max=2 %}
{% include '_people.html' with people=item.composer role='作曲' max=2 %}
{% include '_people.html' with people=item.choreographer role='编舞' max=2 %}
{% include '_actor.html' with people=item.actor role='主演' max=2 %}
{% include '_people.html' with people=item.performer role='表演者' max=2 %}
{% include '_people.html' with people=item.other_title role='other title' max=2 %}
{% include '_people.html' with people=item.playwright role='playwright' max=2 %}
{% include '_people.html' with people=item.composer role='composer' max=2 %}
{% include '_people.html' with people=item.choreographer role='choreographer' max=2 %}
{% include '_actor.html' with people=item.actor role='actor' max=2 %}
{% include '_people.html' with people=item.performer role='performer' max=2 %}
</div>
<div>
{% if not hide_brief %}{{ item.brief | default:item.parent_item.brief | linebreaksbr }}{% endif %}

View file

@ -4,9 +4,9 @@
{% block brief %}
<div class="multi-fields">
{% if item.rating %}
<span class="solo-hidden">{{ item.rating | floatformat:1 }} <small>({{ item.rating_count }}人评分)</small></span>
<span class="solo-hidden">{{ item.rating | floatformat:1 }} <small>({{ item.rating_count }} {% trans "ratings" %})</small></span>
{% endif %}
{% include '_people.html' with people=item.hosts role='主播' max=5 %}
{% include '_people.html' with people=item.hosts role='host' max=5 %}
</div>
{% endblock brief %}
{% block full %}

View file

@ -4,18 +4,14 @@
{% block brief %}
<div class="multi-fields">
{% if item.rating %}
<span class="solo-hidden">{{ item.rating | floatformat:1 }} <small>({{ item.rating_count }}人评分)</small></span>
<span class="solo-hidden">{{ item.rating | floatformat:1 }} <small>({{ item.rating_count }} {% trans "ratings" %})</small></span>
{% endif %}
{% include '_people.html' with people=item.director role='导演' max=2 %}
{% include '_people.html' with people=item.actor role='主演' max=2 %}
{% include '_people.html' with people=item.director role='director' max=2 %}
{% include '_people.html' with people=item.actor role='actor' max=2 %}
</div>
{% endblock brief %}
{% block full %}
<div class="multi-fields">
{% if item.other_title %}
{% include '_people.html' with people=item.other_title role='又名' max=5 %}
{% endif %}
</div>
<div class="multi-fields">{% include '_people.html' with people=item.other_title role='other title' max=2 %}</div>
<div>
{% if not hide_brief %}{{ item.brief | linebreaksbr }}{% endif %}
</div>

View file

@ -4,18 +4,14 @@
{% block brief %}
<div class="multi-fields">
{% if item.rating %}
<span class="solo-hidden">{{ item.rating | floatformat:1 }} <small>({{ item.rating_count }}人评分)</small></span>
<span class="solo-hidden">{{ item.rating | floatformat:1 }} <small>({{ item.rating_count }} {% trans "ratings" %})</small></span>
{% endif %}
{% include '_people.html' with people=item.director role='导演' max=2 %}
{% include '_people.html' with people=item.actor role='主演' max=2 %}
{% include '_people.html' with people=item.director role='director' max=2 %}
{% include '_people.html' with people=item.actor role='actor' max=2 %}
</div>
{% endblock brief %}
{% block full %}
<div class="multi-fields">
{% if item.other_title %}
{% include '_people.html' with people=item.other_title role='又名' max=5 %}
{% endif %}
</div>
<div class="multi-fields">{% include '_people.html' with people=item.other_title role='other title' max=2 %}</div>
<div>
{% if not hide_brief %}{{ item.brief | linebreaksbr }}{% endif %}
</div>

View file

@ -4,17 +4,13 @@
{% block brief %}
<div class="multi-fields">
{% if item.rating %}
<span class="solo-hidden">{{ item.rating | floatformat:1 }} <small>({{ item.rating_count }}人评分)</small></span>
<span class="solo-hidden">{{ item.rating | floatformat:1 }} <small>({{ item.rating_count }} {% trans "ratings" %})</small></span>
{% endif %}
{% include '_people.html' with people=item.author role='作者' max=2 %}
{% include '_people.html' with people=item.author role='author' max=2 %}
</div>
{% endblock brief %}
{% block full %}
<div class="multi-fields">
{% if item.other_title %}
{% include '_people.html' with people=item.other_title role='又名' max=5 %}
{% endif %}
</div>
<div class="multi-fields">{% include '_people.html' with people=item.other_title role='other title' max=2 %}</div>
<div>
{% if not hide_brief %}{{ item.brief | linebreaksbr }}{% endif %}
</div>

View file

@ -7,7 +7,7 @@
{% if item.class_name == "tvseason" and not request.GET.last %}
{% if item.all_episodes %}
<div class="season-picker">
<span class="season-number"><a class="current">全部</a></span>
<span class="season-number"><a class="current">{% trans "all" %}</a></span>
{% for ep in item.all_episodes %}
<span class="season-number" id="ci_{{ ep.uuid }}">
<a hx-swap="innerHTML"
@ -21,8 +21,10 @@
<p _="init get localStorage.getItem('x_add_episode') then if it then add .hidden to #x_add_episode"
id="x_add_episode"
class="hint">
<a href={% url 'catalog:edit' item.url_path item.uuid %}>使用编辑功能</a>批量获取或手工添加单集子条目后可开启分集短评。
[<a _="on click add .hidden to #x_add_episode then call localStorage.setItem('x_add_episode', 1)">不再提示</a>]
<a href={% url 'catalog:edit' item.url_path item.uuid %}>
{% trans "edit this item to fetch or add episode list here" %}
</a>
[<a _="on click add .hidden to #x_add_episode then call localStorage.setItem('x_add_episode', 1)">{% trans "hide this tooltip" %}</a>]
</p>
{% endif %}
{% endif %}
@ -77,9 +79,9 @@
<a hx-get="{% url 'catalog:comments' comment.item.url_path comment.item.uuid %}?last={{ comment.created_time|date:'Y-m-d H:i:s.uO'|urlencode }}"
hx-trigger="click"
hx-swap="outerHTML">
<button class="outline">显示更多</button>
<button class="outline">{% trans "show more" %}</button>
</a>
{% endif %}
{% empty %}
<div class="empty">{% trans '暂无' %}</div>
<div class="empty">{% trans 'nothing more.' %}</div>
{% endfor %}

View file

@ -10,7 +10,7 @@
<span class="season-number">
<a hx-swap="innerHTML"
hx-get="{% url "catalog:comments" item.url_path item.uuid %}"
hx-target="#comments">全部</a>
hx-target="#comments">{% trans "all" %}</a>
</span>
{% for ep in item.all_episodes %}
<span class="season-number" id="ci_{{ ep.uuid }}">
@ -32,7 +32,7 @@
{% else %}
<i class="fa-regular fa-square-plus"></i>
{% endif %}
写该集短评
{% trans "comment this episode" %}
</a>
</small>
</p>
@ -75,10 +75,10 @@
<a hx-get="{% url "catalog:comments_by_episode" item.url_path item.uuid %}?episode_uuid={{ episode_uuid }}&last={{ comment.created_time|date:'Y-m-d H:i:s.uO'|urlencode }}"
hx-trigger="click"
hx-swap="outerHTML">
<button class="outline">显示更多</button>
<button class="outline">{% trans "show more" %}</button>
</a>
{% endif %}
{% empty %}
<div class="empty">{% trans '暂无' %}</div>
<div class="empty">{% trans 'nothing more.' %}</div>
{% endfor %}
</div>

View file

@ -23,7 +23,7 @@
</span>
<span class="action inline">
<span class="timestamp">{{ review.created_time|date }}</span>
<span class="timestamp">评论</span>
<span class="timestamp">{% trans "review" %}</span>
</span>
{% if review.item != item %}
<a href="{{ review.item.url }}">{{ review.item.title }}</a><small class="title_deco">{{ comment.item.title_deco }}</small>
@ -40,9 +40,9 @@
<a hx-get="{% url 'catalog:reviews' review.item.url_path review.item.uuid %}?last={{ review.created_time|date:'Y-m-d H:i:s.uO'|urlencode }}"
hx-trigger="click"
hx-swap="outerHTML">
<button class="outline">显示更多</button>
<button class="outline">{% trans "show more" %}</button>
</a>
{% endif %}
{% empty %}
<div class="empty">{% trans '暂无' %}</div>
<div class="empty">{% trans 'nothing more.' %}</div>
{% endfor %}

View file

@ -11,7 +11,7 @@
</span>
</li>
{% empty %}
<li _="init transition #mark-history opacity to 0 then remove #mark-history">无标记历史</li>
<li _="init transition #mark-history opacity to 0 then remove #mark-history">{% trans "no history." %}</li>
{% endfor %}
</ul>
<div class="action inline">
@ -19,7 +19,7 @@
<button class="secondary outline"
hx-post="{% url 'journal:mark_log' mark.item.uuid 0 %}?delete=1"
hx-target="#log-list"
hx-confirm="确定清除所有标记历史吗?">清除所有标记历史</button>
hx-confirm="{% trans "sure to clear mark history?" %}">{% trans "clear mark history" %}</button>
</ul>
<p>清除标记历史不会删除或改变现有标记</p>
<p>{% trans "clear history will not remove current mark" %}</p>
</div>

View file

@ -1,7 +1,7 @@
{% load user_actions %}
<section>
<h5>
我的标签
{% trans "my tags" %}
{% if not mark.tags %}
<small>
<span class="action inline">
@ -36,7 +36,7 @@
</section>
<section>
<h5>
我的短评
{% trans "my comments" %}
{% if not mark.comment %}
<small>
<span class="action inline">
@ -88,13 +88,13 @@
{% comment %} <span class="timestamp">{{ comment.created_time|date }}</span> {% endcomment %}
</span>
<p>
<a href="{{ comment.item.url }}">{{ comment.item.title }}</a>: {{ comment.html|safe }}
<a href="{{ comment.item.url }}">{{ comment.item.title }}</a>: {{ comment.html|safe }}
</p>
{% endfor %}
</section>
<section>
<h5>
我的评论
{% trans "my review" %}
{% if not review %}
<small>
<span class="action inline">
@ -127,12 +127,14 @@
<a href="{% url 'journal:review_retrieve' review.uuid %}">{{ review.title }}</a>
</p>
{% else %}
<!-- <span class="empty">暂无</span> -->
{% comment %}
<span class="empty">{% trans "nothing so far." %}</span>
{% endcomment %}
{% endif %}
</section>
<section>
<h5>
我的收藏单
{% trans "my collection" %}
<small>
<span class="action inline item-mark-icon">
<a href="#"
@ -152,14 +154,16 @@
{% if c.visibility > 0 %}<i class="fa-solid fa-lock"></i>{% endif %}
</p>
{% empty %}
<!-- <span class="empty">暂无</span> -->
{% comment %}
<span class="empty">{% trans "nothing so far." %}</span>
{% endcomment %}
{% endfor %}
</div>
</section>
{% if mark.logs %}
<section id="mark-history">
<h5>
标记历史
{% trans "mark history" %}
<small>
<span class="action inline">
<a _="on click toggle .hide-action on #log-list then toggle .activated"><i class="fa-solid fa-pen-to-square"></i></a>

View file

@ -1,12 +1,15 @@
{% load i18n %}
{% if people %}
<span>
{% if role %}{{ role }}{% endif %}
{% if role %}
{% trans role %}:
{% endif %}
{% for p in people %}
{% if forloop.counter <= max %}
{% if not forloop.first %}/{% endif %}
<span>{{ p }}</span>
{% elif forloop.last %}
{% endif %}
{% endfor %}
</span>

View file

@ -1,43 +1,37 @@
{% load static %}
{% load i18n %}
{% load l10n %}
<style>
.add-entity-entries__button {
margin: 4px;
}
</style>
<article>
<div class="add-entity-entries__label">{% trans '没有想要的结果?' %}</div>
<div>{% trans 'Not the result you are looking for?' %}</div>
<p>
如果在
Paste the link into the search box if you have found the entry you are looking for on these sites:
{% for site in sites %}
{{ site }}
{% if not forloop.last %}/{% endif %}
{% endfor %}
找到了条目,可以在搜索栏中输入完整链接提交。
</p>
<p>当然也可以手工创建条目:</p>
<p>{% trans "Or you may create items manually" %}:</p>
<ul>
<li>
<a href="{% url 'catalog:create' 'Edition' %}?title={{ request.GET.q | default:'' }}">{% trans '添加图书' %}</a>
<a href="{% url 'catalog:create' 'Edition' %}?title={{ request.GET.q | default:'' }}">{% trans 'Add books' %}</a>
</li>
<li>
<a href="{% url 'catalog:create' 'Movie' %}?title={{ request.GET.q | default:'' }}">{% trans '添加电影' %}</a>
<a href="{% url 'catalog:create' 'Movie' %}?title={{ request.GET.q | default:'' }}">{% trans 'Add movies' %}</a>
</li>
<li>
<a href="{% url 'catalog:create' 'TVShow' %}?title={{ request.GET.q | default:'' }}">{% trans '添加电视剧集' %}</a>
<a href="{% url 'catalog:create' 'TVShow' %}?title={{ request.GET.q | default:'' }}">{% trans 'Add tv series' %}</a>
</li>
<li>
<a href="{% url 'catalog:create' 'Podcast' %}?title={{ request.GET.q | default:'' }}">{% trans '添加播客' %}</a>
<a href="{% url 'catalog:create' 'Podcast' %}?title={{ request.GET.q | default:'' }}">{% trans 'Add podcasts' %}</a>
</li>
<li>
<a href="{% url 'catalog:create' 'Album' %}?title={{ request.GET.q | default:'' }}">{% trans '添加音乐专辑' %}</a>
<a href="{% url 'catalog:create' 'Album' %}?title={{ request.GET.q | default:'' }}">{% trans 'Add albums' %}</a>
</li>
<li>
<a href="{% url 'catalog:create' 'Game' %}?title={{ request.GET.q | default:'' }}">{% trans '添加游戏' %}</a>
<a href="{% url 'catalog:create' 'Game' %}?title={{ request.GET.q | default:'' }}">{% trans 'Add games' %}</a>
</li>
<li>
<a href="{% url 'catalog:create' 'Performance' %}?title={{ request.GET.q | default:'' }}">{% trans '添加表演或戏剧作品' %}</a>
<a href="{% url 'catalog:create' 'Performance' %}?title={{ request.GET.q | default:'' }}">{% trans 'Add performance or theater pieces' %}</a>
</li>
</ul>
</article>

View file

@ -9,109 +9,49 @@
{% load duration %}
<!-- class specific details -->
{% block details %}
<div>
{% if item.artist %}
{% trans '艺术家:' %}
{% for artist in item.artist %}
<span {% if forloop.counter > 5 %}style="display: none;"{% endif %}>
<span class="artist">{{ artist }}</span>
{% if not forloop.last %}/{% endif %}
</span>
{% endfor %}
{% if item.artist|length > 5 %}
<a href="javascript:void(0);" id="artistMore">{% trans '更多' %}</a>
<script>
$("#artistMore").on('click', function (e) {
$("span.artist:not(:visible)").each(function (e) {
$(this).parent().removeAttr('style');
});
$(this).remove();
})
</script>
{% endif %}
{% endif %}
</div>
<div>
{% if item.company %}
{% trans '发行方:' %}
{% for company in item.company %}
<span {% if forloop.counter > 5 %}style="display: none;"{% endif %}>
<span class="company">{{ company }}</span>
{% if not forloop.last %}/{% endif %}
</span>
{% endfor %}
{% if item.company|length > 5 %}
<a href="javascript:void(0);" id="companyMore">{% trans '更多' %}</a>
<script>
$("#companyMore").on('click', function (e) {
$("span.company:not(:visible)").each(function (e) {
$(this).parent().removeAttr('style');
});
$(this).remove();
})
</script>
{% endif %}
{% endif %}
</div>
<div>{% include '_people.html' with people=item.other_title role='other title' max=5 %}</div>
<div>{% include '_people.html' with people=item.artist role='artist' max=5 %}</div>
<div>{% include '_people.html' with people=item.company role='publisher' max=5 %}</div>
<div>
{% if item.release_date %}
{% trans '发行日期:' %}{{ item.release_date }}
{% trans 'release date' %}: {{ item.release_date }}
{% endif %}
</div>
<div>
{% if item.duration %}
{% trans '时长:' %}{{ item.duration|duration_format:1000 }}
{% endif %}
</div>
<div>
{% if item.genre %}
{% trans '流派:' %}
{% for genre in item.genre %}
<span>{{ genre }}</span>
{% if not forloop.last %}/{% endif %}
{% endfor %}
{% trans 'duration' %}: {{ item.duration|duration_format:1000 }}
{% endif %}
</div>
<div>{% include '_people.html' with people=item.genre role='genre' max=5 %}</div>
<div>
{% if item.barcode %}
{% trans '条形码:' %}{{ item.barcode }}
{% endif %}
</div>
<div>
{% if item.other_title %}
{% trans '又名:' %}
{% for t in item.other_title %}
<span>{{ t }}</span>
{% if not forloop.last %}/{% endif %}
{% endfor %}
{% trans 'barcode' %}{{ item.barcode }}
{% endif %}
</div>
<div>
{% if item.album_type %}
{% trans '专辑类型:' %}{{ item.album_type }}
{% trans 'album type' %}: {{ item.album_type }}
{% endif %}
</div>
<div>
{% if item.media %}
{% trans '介质:' %}{{ item.media }}
{% trans 'album media' %}: {{ item.media }}
{% endif %}
</div>
<div>
{% if item.disc_count %}
{% trans '碟片数:' %}{{ item.disc_count }}
{% trans 'number of discs' %}: {{ item.disc_count }}
{% endif %}
</div>
{% endblock %}
<!-- class specific sidebar -->
{% block content %}
{% if item.track_list %}
<h5>曲目</h5>
<h5>tracks</h5>
<p class="tldr" _="on click toggle .tldr on me">{{ item.track_list | linebreaksbr }}</p>
{% endif %}
{% if item.get_embed_link %}
<h5>播放</h5>
<h5>play this album</h5>
<iframe src="{{ item.get_embed_link }}"
frameborder="0"
allowtransparency="true"

View file

@ -6,7 +6,7 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{ site_name }} - 编辑历史 {{ item.title }}</title>
<title>{{ site_name }} - {{ item.title }} - {% trans "revision history" %}</title>
{% include "common_libs.html" %}
<style>
aside details {
@ -27,7 +27,7 @@
{% include "_header.html" %}
<main>
<div class="grid__main">
<h4>{{ item.title }} 编辑历史</h4>
<h4>{{ item.title }} - {% trans "revision history" %}</h4>
<table class="table table-striped table-bordered">
<thead>
<tr style="background:#eee;">

View file

@ -7,7 +7,7 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta property="og:title" content="{{ site_name }} - 分布式书影音播客游戏收藏评论交流社区">
<meta property="og:title" content="{{ site_name }}">
<meta name="description"
property="og:description"
content="{{ site_description }}">
@ -15,7 +15,7 @@
<meta property="og:url" content="{{ site_url }}">
<meta property="og:image" content="{{ site_logo }}">
<meta property="og:site_name" content="{{ site_name }}">
<title>{{ site_name }} - {% trans '发现' %}</title>
<title>{{ site_name }} - {% trans 'Discover' %}</title>
{% include "common_libs.html" %}
<script src="{{ cdn_url }}/npm/shikwasa@2.2.1/dist/shikwasa.min.js"></script>
<link href="{{ cdn_url }}/npm/shikwasa@2.2.1/dist/style.min.css"
@ -70,10 +70,10 @@
{% if request.user.is_authenticated %}
<div class="entity-sort-control">
<div class="entity-sort-control__button" id="sortEditButton">
<span class="entity-sort-control__text" id="sortEditText">{% trans '编辑布局' %}</span>
<span class="entity-sort-control__text" id="sortEditText">{% trans 'edit layout' %}</span>
<span class="entity-sort-control__text"
id="sortSaveText"
style="display: none">{% trans '保存' %}</span>
style="display: none">{% trans 'save' %}</span>
<span class="icon-edit" id="sortEditIcon">
<i class="fa-solid fa-pencil"></i>
</span>
@ -84,14 +84,14 @@
<div class="entity-sort-control__button"
id="sortExitButton"
style="display: none">
<span class="entity-sort-control__text">{% trans '取消' %}</span>
<span class="entity-sort-control__text">{% trans 'cancel' %}</span>
</div>
</div>
<div class="entity-sort-control__button entity-sort-control__button--float-right"
id="toggleDisplayButtonTemplate"
style="display: none">
<span class="showText" style="display: none;">{% trans '显示' %}</span>
<span class="hideText" style="display: none;">{% trans '隐藏' %}</span>
<span class="showText" style="display: none;">{% trans 'show' %}</span>
<span class="hideText" style="display: none;">{% trans 'hide' %}</span>
</div>
<form action="{% url 'users:set_layout' %}" method="post" id="sortForm">
{% csrf_token %}

View file

@ -14,81 +14,61 @@
{% if item.isbn %}<meta property="og:book:isbn" content="{{ item.isbn }}">{% endif %}
{% endblock %}
{% block details %}
<!-- <div>{% if item.subtitle %}{% trans '副标题:' %}{{ item.subtitle }}{% endif %}</div>
<div>{% if item.orig_title %}{% trans '原作名:' %}{{ item.orig_title }}{% endif %}</div> -->
<div>
{% if item.isbn %}
{% trans 'ISBN' %}{{ item.isbn }}
{% endif %}
</div>
<div>
{% if item.author %}
{% trans '作者:' %}
{% for author in item.author %}
<span>{{ author }}</span>
{% if not forloop.last %}/{% endif %}
{% endfor %}
{% endif %}
</div>
<div>
{% if item.translator %}
{% trans '译者:' %}
{% for translator in item.translator %}
<span>{{ translator }}</span>
{% if not forloop.last %}/{% endif %}
{% endfor %}
{% trans 'ISBN' %}: {{ item.isbn }}
{% endif %}
</div>
<div>{% include '_people.html' with people=item.author role='author' max=5 %}</div>
<div>{% include '_people.html' with people=item.translator role='translator' max=5 %}</div>
<div>
{% if item.pub_house %}
{% trans '出版社:' %}{{ item.pub_house }}
{% trans 'publishing house' %}: {{ item.pub_house }}
{% endif %}
</div>
<div>
{% if item.imprint %}
{% trans '出品方:' %}{{ item.imprint }}
{% trans 'imprint' %}: {{ item.imprint }}
{% endif %}
</div>
<div>
{% if item.pub_year %}
{% trans '出版时间:' %}{{ item.pub_year }}{% trans '年' %}
{% if item.pub_month %}
{{ item.pub_month }}{% trans '月' %}
{% endif %}
{% trans 'publication date' %}: {{ item.pub_year }}
{% if item.pub_month %}-{{ item.pub_month }}{% endif %}
{% endif %}
</div>
<div>
{% if item.series %}
{% trans '丛书系列:' %}{{ item.series }}
{% trans 'series' %}: {{ item.series }}
{% endif %}
</div>
<div>
{% if item.language %}
{% trans '语言:' %}{{ item.language }}
{% trans 'language' %}: {{ item.language }}
{% endif %}
</div>
<div>
{% if item.binding %}
{% trans '装帧:' %}{{ item.binding }}
{% trans 'binding' %}: {{ item.binding }}
{% endif %}
</div>
<div>
{% if item.price %}
{% trans '定价:' %}{{ item.price }}
{% trans 'price' %}: {{ item.price }}
{% endif %}
</div>
<div>
{% if item.pages %}
{% trans '页数:' %}{{ item.pages }}
{% trans 'number of pages' %}: {{ item.pages }}
{% endif %}
</div>
{% if item.other_info %}
{% for k, v in item.other_info.items %}<div>{{ k }}{{ v|urlizetrunc:24 }}</div>{% endfor %}
{% for k, v in item.other_info.items %}<div>{{ k }}: {{ v|urlizetrunc:24 }}</div>{% endfor %}
{% endif %}
{% endblock %}
{% block content %}
{% if item.contents %}
<h5>目录</h5>
<h5>contents</h5>
<p class="tldr" _="on click toggle .tldr on me">{{ item.contents | linebreaksbr }}</p>
{% endif %}
{% endblock %}
@ -111,7 +91,7 @@
{% if related_books.count > 0 %}
<section>
<details class="auto-collapse" open>
<summary>{% trans '这本书还有其它版本' %}</summary>
<summary>{% trans 'other editions' %}</summary>
{% for b in related_books %}
<div>
<a href="{{ b.url }}">{{ b.title }}</a>
@ -130,7 +110,7 @@
{% if item.isbn %}
<section>
<details class="auto-collapse" open>
<summary>{% trans '借阅或购买' %}</summary>
<summary>{% trans 'Borrow or Buy' %}</summary>
<div>
<div>
<a target="_blank"

View file

@ -9,7 +9,7 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{ site_name }} - {% trans '搜索结果' %}</title>
<title>{{ site_name }} - {% trans 'Search results' %}</title>
{% include "common_libs.html" %}
</head>
<body>
@ -18,14 +18,14 @@
<div class="grid__main">
<article>
{% if job_id %}
<h5>正在从{{ site.SITE_NAME.label }}获取</h5>
<h5>{% blocktrans with site_label=site.SITE_NAME.label %}Fetching from {{ site_label }}{% endblocktrans %}</h5>
<div hx-get="{% url 'catalog:fetch_refresh' job_id %}"
hx-trigger="load delay:2s"
hx-swap="outerHTML">
<i class="fa-solid fa-compact-disc fa-spin loading"></i>
</div>
{% else %}
<h5>获取系统繁忙,请稍等几秒钟再搜索</h5>
<h5>{% trans "System busy, please try again in a minute." %}</h5>
{% endif %}
</article>
</div>

View file

@ -9,24 +9,24 @@
<!-- class specific details -->
{% block details %}
<div class="tldr-2" _="on click toggle .tldr-2 on me">
{% include '_people.html' with people=item.other_title _role='别名' max=99 %}
{% include '_people.html' with people=item.other_title _role='other title' max=99 %}
</div>
<div>
{% if item.release_date %}
{% trans '发行时间:' %}{{ item.release_date }}
{% trans 'release date' %}: {{ item.release_date }}
{% elif item.release_year %}
{% trans '发行时间:' %}{{ item.release_year }}
{% trans 'release year' %}: {{ item.release_year }}
{% endif %}
</div>
<div>{% include '_people.html' with people=item.platform role='平台' max=8 %}</div>
<div>{% include '_people.html' with people=item.genre role='类型' max=5 %}</div>
<div>{% include '_people.html' with people=item.designer role='设计者' max=3 %}</div>
<div>{% include '_people.html' with people=item.artist role='艺术家' max=3 %}</div>
<div>{% include '_people.html' with people=item.developer role='开发商' max=1 %}</div>
<div>{% include '_people.html' with people=item.publisher role='发行商' max=1 %}</div>
<div>{% include '_people.html' with people=item.platform role='platform' max=8 %}</div>
<div>{% include '_people.html' with people=item.genre role='genre' max=5 %}</div>
<div>{% include '_people.html' with people=item.designer role='designer' max=3 %}</div>
<div>{% include '_people.html' with people=item.artist role='artist' max=3 %}</div>
<div>{% include '_people.html' with people=item.developer role='developer' max=2 %}</div>
<div>{% include '_people.html' with people=item.publisher role='publisher' max=2 %}</div>
<div>
{% if item.official_site %}
{% trans '官方网站:' %}{{ item.official_site|urlizetrunc:24 }}
{% trans 'website' %}{{ item.official_site|urlizetrunc:24 }}
{% endif %}
</div>
{% endblock %}

View file

@ -62,7 +62,7 @@
{% endfor %}
</div>
<div class="tv-tip" style="display:none;">
这是全剧条目,以下是可标记的单季
{% trans 'select one of the seasons to comment' %}
{% if item.class_name == 'tvshow' %}
{% with item.all_seasons as seasons %}
{% if seasons %}
@ -97,7 +97,7 @@
</button>
</div>
<div class="small-only" style="margin-top:2vh;">
<a href="#item-sidebar">标签 · 短评 · 评论 · 收藏</a>
<a href="#item-sidebar">{% trans 'mark, comment and collect' %}</a>
</div>
</div>
{% endif %}
@ -107,14 +107,16 @@
{% else %}
<section>
<p class="empty">
<span><a href="{% url 'users:login' %}?next={{ request.path }}">登录</a>后可管理标记收藏</span>
<span><a href="{% url 'users:login' %}?next={{ request.path }}">
{% trans 'Login or register to review or add this item to your collection.' %}
</a></span>
</p>
</section>
{% endif %}
{% block sidebar %}{% endblock %}
{% if collection_list %}
<section>
<h5>相关收藏单</h5>
<h5>{% trans 'Related Collections' %}</h5>
<div>
{% for c in collection_list %}
<p>
@ -129,20 +131,20 @@
<div id="item-metadata" class="left">
<section>
{% block details %}
<div>此类数据尚未支持</div>
<div>uuid: {{ item.uuid }}</div>
<div>class: {{ item.class_name }}</div>
<div>category: {{ item.category }}</div>
<div>{% trans 'Unsupported item type.' %}</div>
<div>UUID: {{ item.uuid }}</div>
<div>Class: {{ item.class_name }}</div>
<div>Category: {{ item.category }}</div>
{% endblock %}
{% if request.user.is_authenticated %}
<div class="item-edit">
<span class="action inline">
<a href="{% url 'catalog:edit' item.url_path item.uuid %}"
title="{% trans '编辑这个条目' %}"><i class="fa-solid fa-pen-to-square"></i></a>
title="{% trans 'Edit this item' %}"><i class="fa-solid fa-pen-to-square"></i></a>
</span>
{% if item.last_editor and item.last_editor.preference.show_last_edit %}
<span>
{% trans '最近编辑:' %}
{% trans 'Last edited' %}:
<a href="{{ item.last_editor.url }}">{{ item.last_editor.display_name | default:"" }}</a>
</span>
{% endif %}
@ -155,7 +157,7 @@
<h3>
{{ item.rating | floatformat:1 }} <small>/ 10</small>
</h3>
<p>{{ item.rating_count }}个评分</p>
<p>{{ item.rating_count }} {% trans 'ratings' %}</p>
</hgroup>
</div>
<div data-placement="top">
@ -179,7 +181,7 @@
</div>
</div>
<div class="undisplay">
<span>评分人数不足</span>
<span>{% trans 'No enough ratings' %}</span>
</div>
</div>
<div class="tag-list solo-hidden">
@ -205,17 +207,17 @@
{% endif %}
{% if item.parent_item %}
<p>
{% trans '所属' %}{{ item.parent_item.type.label }} <span><a href="{{ item.parent_item.url }}"></span>{{ item.parent_item.title }}</a>
{% trans 'part of' %} {{ item.parent_item.type.label }}: <span><a href="{{ item.parent_item.url }}"></span>{{ item.parent_item.title }}</a>
</p>
{% endif %}
{% if item.author or item.translator %}
<p>
<i>
{% include '_people.html' with people=item.author _role='作者' max=2 %}
{% include '_people.html' with people=item.author _role='author' max=2 %}
</i>
&nbsp;&nbsp;
<i>
{% include '_people.html' with people=item.translator role='译者' max=2 %}
{% include '_people.html' with people=item.translator role='translated by' max=2 %}
</i>
</p>
{% endif %}
@ -223,24 +225,24 @@
</div>
<div id="item-detail" class="middle">
<section id="item-content">
<h5>简介</h5>
<h5>{% trans 'overview' %}</h5>
{% if item.brief %}
<p class="tldr" _="on click toggle .tldr on me">{{ item.brief | linebreaksbr }}</p>
{% elif item.parent_item.brief %}
<p class="tldr" _="on click toggle .tldr on me">{{ item.parent_item.brief | linebreaksbr }}</p>
{% else %}
<p class="empty">暂缺</p>
<p class="empty">{% trans 'nothing so far.' %}</p>
{% endif %}
{% block content %}{% endblock %}
</section>
<section class="solo-hidden">
<div>
<h5>
短评
{% trans 'comments' %}
<small>
{% if request.user.is_authenticated %}
| <a href="{% url 'catalog:mark_list' item.url_path item.uuid %}">{% trans '全部标记' %}</a>
| <a href="{% url 'catalog:mark_list' item.url_path item.uuid 'following' %}">{% trans '关注的人的标记' %}</a>
| <a href="{% url 'catalog:mark_list' item.url_path item.uuid %}">{% trans 'marks' %}</a>
| <a href="{% url 'catalog:mark_list' item.url_path item.uuid 'following' %}">{% trans 'marks from who you follow' %}</a>
{% endif %}
</small>
</h5>
@ -254,7 +256,7 @@
</div>
</section>
<section class="solo-hidden">
<h5>{% trans '评论' %}</h5>
<h5>{% trans 'reviews' %}</h5>
<div>
<div hx-get="{% url 'catalog:reviews' item.url_path item.uuid %}"
hx-trigger="intersect once"

View file

@ -8,124 +8,36 @@
{% load thumb %}
<!-- class specific details -->
{% block details %}
<div>
{% if item.director %}
{% trans '导演:' %}
{% for director in item.director %}
<span {% if forloop.counter > 5 %}style="display: none;"{% endif %}>
<span class="director">{{ director }}</span>
{% if not forloop.last %}/{% endif %}
</span>
{% endfor %}
{% if item.director|length > 5 %}
<a href="javascript:void(0);" id="directorMore">{% trans '更多' %}</a>
<script>
$("#directorMore").on('click', function (e) {
$("span.director:not(:visible)").each(function (e) {
$(this).parent().removeAttr('style');
});
$(this).remove();
})
</script>
{% endif %}
{% endif %}
</div>
<div>
{% if item.playwright %}
{% trans '编剧:' %}
{% for playwright in item.playwright %}
<span {% if forloop.counter > 5 %}style="display: none;"{% endif %}>
<span class="playwright">{{ playwright }}</span>
{% if not forloop.last %}/{% endif %}
</span>
{% endfor %}
{% if item.playwright|length > 5 %}
<a href="javascript:void(0);" id="playwrightMore">{% trans '更多' %}</a>
<script>
$("#playwrightMore").on('click', function (e) {
$("span.playwright:not(:visible)").each(function (e) {
$(this).parent().removeAttr('style');
});
$(this).remove();
})
</script>
{% endif %}
{% endif %}
</div>
<div>
{% if item.actor %}
{% trans '主演:' %}
{% for actor in item.actor %}
<span {% if forloop.counter > 5 %}style="display: none;"{% endif %}>
<span class="actor">{{ actor }}</span>
{% if not forloop.last %}/{% endif %}
</span>
{% endfor %}
{% if item.actor|length > 5 %}
<a href="javascript:void(0);" id="actorMore">{% trans '更多' %}</a>
<script>
$("#actorMore").on('click', function(e) {
$("span.actor:not(:visible)").each(function(e){
$(this).parent().removeAttr('style');
});
$(this).remove();
})
</script>
{% endif %}
{% endif %}
</div>
<div>
{% if item.genre %}
{% trans '类型:' %}
{% for genre in item.genre %}
<span>{{ genre }}</span>
{% if not forloop.last %}/{% endif %}
{% endfor %}
{% endif %}
</div>
<div>
{% if item.area %}
{% trans '制片国家/地区:' %}
{% for area in item.area %}
<span>{{ area }}</span>
{% if not forloop.last %}/{% endif %}
{% endfor %}
{% endif %}
</div>
<div>
{% if item.language %}
{% trans '语言:' %}
{% for language in item.language %}
<span>{{ language }}</span>
{% if not forloop.last %}/{% endif %}
{% endfor %}
{% endif %}
</div>
<div>{% include '_people.html' with people=item.other_title role='other title' max=5 %}</div>
<div>{% include '_people.html' with people=item.director role='director' max=5 %}</div>
<div>{% include '_people.html' with people=item.playwright role='playwright' max=5 %}</div>
<div>{% include '_people.html' with people=item.actor role='actor' max=5 %}</div>
<div>{% include '_people.html' with people=item.genre role='genre' max=10 %}</div>
<div>{% include '_people.html' with people=item.area role='production area' max=10 %}</div>
<div>{% include '_people.html' with people=item.language role='language' max=5 %}</div>
<div>
{% if item.duration %}
{% trans '片长:' %}{{ item.duration }}
{% trans 'length' %}: {{ item.duration }}
{% endif %}
</div>
<div>
{% if item.season_count %}
{% trans '季数:' %}{{ item.season_count }}
{% trans 'number of Seasons' %}: {{ item.season_count }}
{% endif %}
</div>
<div>
{% if item.episode_count %}
{% trans '集数:' %}{{ item.episode_count }}
{% trans 'number of Episodes' %}: {{ item.episode_count }}
{% endif %}
</div>
<div>
{% if item.single_episode_length %}
{% trans '单集长度:' %}{{ item.single_episode_length }}
{% trans 'episode Length' %}: {{ item.single_episode_length }}
{% endif %}
</div>
<div>
{% if item.showtime %}
{% trans '上映时间:' %}
{% trans 'release date' %}:
{% for showtime in item.showtime %}
<span>{{ showtime.time }}
{% if showtime.region %}({{ showtime.region }}){% endif %}
@ -134,29 +46,20 @@
{% endfor %}
{% endif %}
</div>
<div>
{% if item.other_title %}
{% trans '又名:' %}
{% for t in item.other_title %}
<span>{{ t }}</span>
{% if not forloop.last %}/{% endif %}
{% endfor %}
{% endif %}
</div>
<div>
{% if item.imdb %}
{% trans 'IMDb' %}<a href="https://www.imdb.com/title/{{ item.imdb }}/"
{% trans 'IMDb' %}: <a href="https://www.imdb.com/title/{{ item.imdb }}/"
target="_blank"
rel="noopener">{{ item.imdb }}</a>
{% endif %}
</div>
<div>
{% if item.site %}
{% trans '网站:' %}
{% trans 'website' %}:
<a href="{{ item.site }}" target="_blank" rel="noopener">{{ item.site|strip_scheme }}</a>
{% endif %}
</div>
{% if item.other_info %}
{% for k, v in item.other_info.items %}<div>{{ k }}{{ v|urlizetrunc:24 }}</div>{% endfor %}
{% for k, v in item.other_info.items %}<div>{{ k }}: {{ v|urlizetrunc:24 }}</div>{% endfor %}
{% endif %}
{% endblock %}

View file

@ -8,35 +8,36 @@
{% load thumb %}
<!-- class specific details -->
{% block details %}
<div>{% include '_people.html' with people=item.other_title _role='其他标题' max=5 %}</div>
<div>{% include '_people.html' with people=item.other_title _role='other title' max=5 %}</div>
<div>
{% if item.opening_date %}
上演时间:<span>{{ item.opening_date }}</span>
{% trans "opening date" %}:
<span>{{ item.opening_date }}</span>
{% if item.closing_date %}~ <span>{{ item.closing_date }}</span>{% endif %}
{% endif %}
</div>
<div>{% include '_people.html' with people=item.genre role='类型' max=5 %}</div>
<div>{% include '_people.html' with people=item.troupe role='剧团' max=5 %}</div>
<div>{% include '_people.html' with people=item.location role='剧院' max=5 %}</div>
<div>{% include '_people.html' with people=item.language role='语言' max=5 %}</div>
<div>{% include '_people.html' with people=item.orig_creator role='原作' max=5 %}</div>
<div>{% include '_people.html' with people=item.director role='导演' max=5 %}</div>
<div>{% include '_people.html' with people=item.playwright role='编剧' max=5 %}</div>
<div>{% include '_people.html' with people=item.composer role='作曲' max=5 %}</div>
<div>{% include '_people.html' with people=item.choreographer role='编舞' max=5 %}</div>
<div>{% include '_actor.html' with people=item.actor role='演员' max=10 %}</div>
<div>{% include '_people.html' with people=item.performer role='表演者' max=10 %}</div>
<div>{% include '_crew.html' with people=item.crew_by_role role='演职人员' max=10 %}</div>
<div>{% include '_people.html' with people=item.genre role='genre' max=5 %}</div>
<div>{% include '_people.html' with people=item.troupe role='troupe' max=5 %}</div>
<div>{% include '_people.html' with people=item.location role='theater' max=5 %}</div>
<div>{% include '_people.html' with people=item.language role='language' max=5 %}</div>
<div>{% include '_people.html' with people=item.orig_creator role='original creator' max=5 %}</div>
<div>{% include '_people.html' with people=item.director role='director' max=5 %}</div>
<div>{% include '_people.html' with people=item.playwright role='playwright' max=5 %}</div>
<div>{% include '_people.html' with people=item.composer role='composer' max=5 %}</div>
<div>{% include '_people.html' with people=item.choreographer role='choreographer' max=5 %}</div>
<div>{% include '_actor.html' with people=item.actor role='actor' max=10 %}</div>
<div>{% include '_people.html' with people=item.performer role='performer' max=10 %}</div>
<div>{% include '_crew.html' with people=item.crew_by_role role='crew' max=10 %}</div>
<div>
{% if item.official_site %}
{% trans '官方网站' %} <span>{{ item.official_site|urlizetrunc:24 }}</span>
{% trans 'website' %} <span>{{ item.official_site|urlizetrunc:24 }}</span>
{% endif %}
</div>
{% endblock %}
{% block content %}
{% with item.all_productions as productions %}
{% if productions %}
<h5>{% trans '上演版本' %}</h5>
<h5>{% trans 'production' %}</h5>
<div>
{% for prod in productions %}
<hgroup>
@ -48,18 +49,17 @@
<span>{{ prod.opening_date }}</span>
{% if prod.closing_date %}~ <span>{{ prod.closing_date }}</span>{% endif %}
{% endif %}
{% include '_people.html' with people=prod.troupe _role='剧团' max=2 %}
{% include '_people.html' with people=prod.location _role='上演剧院' max=2 %}
{% include '_people.html' with people=prod.language _role='语言' max=5 %}
{% include '_people.html' with people=prod.troupe _role='troupe' max=2 %}
{% include '_people.html' with people=prod.location _role='production theater' max=2 %}
{% include '_people.html' with people=prod.language _role='language' max=5 %}
</div>
<div class="tldr-2">
{% include '_people.html' with people=prod.orig_creator role='原作' max=2 %}
{% include '_people.html' with people=prod.director role='导演' max=2 %}
{% include '_people.html' with people=prod.playwright role='编剧' max=2 %}
{% include '_actor.html' with people=prod.actor role='演员' max=5 %}
{% include '_people.html' with people=prod.performer role='表演者' max=5 %}
{% include '_people.html' with people=prod.composer role='作曲' max=2 %}
{% include '_people.html' with people=prod.choreographer role='编舞' max=2 %}
{% include '_people.html' with people=prod.director role='director' max=2 %}
{% include '_people.html' with people=prod.playwright role='playwright' max=2 %}
{% include '_actor.html' with people=prod.actor role='actor' max=5 %}
{% include '_people.html' with people=prod.performer role='performer' max=5 %}
{% include '_people.html' with people=prod.composer role='composer' max=2 %}
{% include '_people.html' with people=prod.choreographer role='choreographer' max=2 %}
</div>
</hgroup>
{% endfor %}

View file

@ -10,26 +10,27 @@
{% block details %}
<div>
{% if item.opening_date %}
上演时间:<span>{{ item.opening_date }}</span>
{% trans "opening date" %}:
<span>{{ item.opening_date }}</span>
{% if item.closing_date %}~ <span>{{ item.closing_date }}</span>{% endif %}
{% endif %}
</div>
<div>{% include '_people.html' with people=item.other_title _role='其他标题' max=5 %}</div>
<div>{% include '_people.html' with people=item.genre role='类型' max=5 %}</div>
<div>{% include '_people.html' with people=item.troupe role='剧团' max=5 %}</div>
<div>{% include '_people.html' with people=item.location role='剧院' max=5 %}</div>
<div>{% include '_people.html' with people=item.language role='语言' max=5 %}</div>
<div>{% include '_people.html' with people=item.orig_creator role='原作' max=5 %}</div>
<div>{% include '_people.html' with people=item.director role='导演' max=5 %}</div>
<div>{% include '_people.html' with people=item.playwright role='编剧' max=5 %}</div>
<div>{% include '_people.html' with people=item.composer role='作曲' max=5 %}</div>
<div>{% include '_people.html' with people=item.choreographer role='编舞' max=5 %}</div>
<div>{% include '_actor.html' with people=item.actor role='演员' max=50 %}</div>
<div>{% include '_people.html' with people=item.performer role='表演者' max=50 %}</div>
<div>{% include '_crew.html' with people=item.crew role='演职人员' max=50 %}</div>
<div>{% include '_people.html' with people=item.other_title _role='other title' max=5 %}</div>
<div>{% include '_people.html' with people=item.genre role='genre' max=5 %}</div>
<div>{% include '_people.html' with people=item.troupe role='troupe' max=5 %}</div>
<div>{% include '_people.html' with people=item.location role='theater' max=5 %}</div>
<div>{% include '_people.html' with people=item.language role='language' max=5 %}</div>
<div>{% include '_people.html' with people=item.orig_creator role='orginal creator' max=5 %}</div>
<div>{% include '_people.html' with people=item.director role='director' max=5 %}</div>
<div>{% include '_people.html' with people=item.playwright role='playwright' max=5 %}</div>
<div>{% include '_people.html' with people=item.composer role='composer' max=5 %}</div>
<div>{% include '_people.html' with people=item.choreographer role='choreographer' max=5 %}</div>
<div>{% include '_actor.html' with people=item.actor role='actor' max=50 %}</div>
<div>{% include '_people.html' with people=item.performer role='performer' max=50 %}</div>
<div>{% include '_crew.html' with people=item.crew role='crew' max=50 %}</div>
<div>
{% if item.official_site %}
{% trans '官方网站' %} <span>{{ item.official_site|urlizetrunc:24 }}</span>
{% trans 'website' %} <span>{{ item.official_site|urlizetrunc:24 }}</span>
{% endif %}
</div>
{% endblock %}

View file

@ -13,46 +13,16 @@
<script src="{% static 'js/podcast.js' %}"></script>
{% endblock %}
{% block details %}
<div>
{% if item.genre %}
{% trans '类型:' %}
{% for genre in item.genre %}
<span>{{ genre }}</span>
{% if not forloop.last %}/{% endif %}
{% endfor %}
{% endif %}
</div>
<div>{% include '_people.html' with people=item.genre role='genre' max=5 %}</div>
<div>{% include '_people.html' with people=item.hosts role='podcast host' max=5 %}</div>
<div>
{% if item.official_site %}
{% trans '网站:' %}{{ item.official_site|urlizetrunc:24 }}
{% endif %}
</div>
<div>
{% if item.hosts %}
{% trans '主播:' %}
{% for host in item.hosts %}
<span {% if forloop.counter > 5 %}style="display: none;"{% endif %}>
<span class="other_title">{{ host }}</span>
{% if not forloop.last %}/{% endif %}
</span>
{% endfor %}
{% if item.hosts|length > 5 %}
<a href="javascript:void(0);" id="otherTitleMore">{% trans '更多' %}</a>
<script>
$("#otherTitleMore").on('click', function (e) {
$("span.other_title:not(:visible)").each(function (e) {
$(this).parent().removeAttr('style');
});
$(this).remove();
})
</script>
{% endif %}
{% trans 'website' %}: {{ item.official_site|urlizetrunc:24 }}
{% endif %}
</div>
{% endblock %}
{% block content %}
<h5>{% trans '近期节目' %}</h5>
<h5>{% trans 'recent episodes' %}</h5>
<div hx-get="{% url 'catalog:episode_data' item.uuid %}"
hx-trigger="load"
hx-swap="outerHTML"></div>
@ -61,7 +31,7 @@
{% block left_sidebar %}
<section>
<center>
<button href="#" class="podlove-subscribe-button-primary outline">{% trans '用播客应用订阅' %}</button>
<button href="#" class="podlove-subscribe-button-primary outline">{% trans 'subscribe in apps' %}</button>
</center>
</section>
<script>

View file

@ -19,13 +19,16 @@
&nbsp;
{% if request.user.is_authenticated %}
<a style="margin-right: 10px"
title="评论单集"
title="{% trans "comment this episode" %}"
href="#"
hx-get="{% url 'journal:comment' ep.uuid %}"
hx-target="body"
hx-swap="beforeend"><i class="fa-regular fa-comment-dots"></i></a>
{% endif %}
<a title="打开源网站" target="_blank" rel="noopener" href="{{ ep.link }}"><i class="fa-solid fa-link"></i></a>
<a title="{% trans "original website" %}"
target="_blank"
rel="noopener"
href="{{ ep.link }}"><i class="fa-solid fa-link"></i></a>
{{ ep.title }}
<small style="color:lightgrey;">{{ ep.pub_date|date }}</small>
</h6>
@ -35,8 +38,8 @@
<button class="outline"
hx-get="{% url 'catalog:episode_data' item.uuid %}?last={{ ep.pub_date|date:'Y-m-d H:i:s.uO'|urlencode }}"
hx-trigger="click"
hx-swap="outerHTML">显示更多</button>
hx-swap="outerHTML">{% trans "show more" %}</button>
{% endif %}
{% empty %}
<div>{% trans '目前没有更多内容了' %}</div>
<div>{% trans 'nothing more.' %}</div>
{% endfor %}

View file

@ -10,7 +10,7 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{ site_name }} - {% trans '搜索' %} {{ request.GET.q }}</title>
<title>{{ site_name }} - {% trans 'Search Results' %} {{ request.GET.q }}</title>
{% include "common_libs.html" %}
</head>
<body>
@ -21,67 +21,67 @@
<div>
{% if request.GET.q %}
<hgroup>
<h5>“{{ request.GET.q }}” {% trans '的搜索结果' %}</h5>
<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 }}&amp;c=all">全部</a>
<a href="?q={{ request.GET.q }}&amp;c=all">{% trans "all" %}</a>
{% else %}
全部
{% trans "all" %}
{% endif %}
{% if 'book' in cats %}
|
{% if request.GET.c != 'book' %}
<a href="?q={{ request.GET.q }}&amp;c=book">书籍</a>
<a href="?q={{ request.GET.q }}&amp;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 }}&amp;c=movietv">影视</a>
<a href="?q={{ request.GET.q }}&amp;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 }}&amp;c=podcast">播客</a>
<a href="?q={{ request.GET.q }}&amp;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 }}&amp;c=music">音乐</a>
<a href="?q={{ request.GET.q }}&amp;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 }}&amp;c=game">游戏</a>
<a href="?q={{ request.GET.q }}&amp;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 }}&amp;c=performance">演出</a>
<a href="?q={{ request.GET.q }}&amp;c=performance">{% trans "performances" %}</a>
{% else %}
演出
{% trans "performances" %}
{% endif %}
{% endif %}
</div>
</hgroup>
{% endif %}
{% if request.GET.tag %}
<h5>{% trans '含有标签' %} “{{ request.GET.tag }}” {% trans '的结果' %}</h5>
<h5>{% trans 'tag' %}: “{{ request.GET.tag }}”</h5>
{% endif %}
<div class="item-card-list">
{% for item in items %}
@ -103,7 +103,7 @@
</div>
{% if dup_items %}
<p class="empty">
已从结果中略去了来自同一著作或有相同标识号的 {{ dup_items|length }}个条目,<a _="on click toggle .unfold on #dup">点击这里可重新显示</a>
{% 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 %}
@ -113,14 +113,14 @@
{% 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 %}"
<p hx-get="{% url 'catalog:external_search' %}?q={{ request.GET.q }}&amp;c={{ request.GET.c }}&amp;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 '正在实时搜索站外条目' %}
{% trans 'Searching from other sites' %}
</p>
{% else %}
登录用户可看到来自其它网站的搜索结果。
{% trans "Logged in user may see search results from other sites." %}
{% endif %}
</div>
</div>

View file

@ -6,11 +6,12 @@
{% load mastodon %}
{% load strip_scheme %}
{% load thumb %}
<!-- class specific details -->
{% block details %}
{% with item.all_seasons as seasons %}
{% if seasons %}
<div>
{% trans '本剧所有季:' %}
{% trans 'all seasons' %}:
{% for s in seasons %}
<span class="season-number">
<a {% if s == item %}class="current" {% else %} href="{{ s.url }}" {% endif %}>{{ s.season_number|default:"#" }}</a>
@ -19,105 +20,41 @@
</div>
{% endif %}
{% endwith %}
<div>{% include '_people.html' with people=item.other_title role='other title' max=5 %}</div>
<div>{% include '_people.html' with people=item.director role='director' max=5 %}</div>
<div>{% include '_people.html' with people=item.playwright role='playwright' max=5 %}</div>
<div>{% include '_people.html' with people=item.actor role='actor' max=5 %}</div>
<div>{% include '_people.html' with people=item.genre role='genre' max=10 %}</div>
<div>{% include '_people.html' with people=item.area role='production area' max=10 %}</div>
<div>{% include '_people.html' with people=item.language role='language' max=5 %}</div>
<div>
{% if item.director %}
{% trans '导演:' %}
{% for director in item.director %}
<span {% if forloop.counter > 5 %}style="display: none;"{% endif %}>
<span class="director">{{ director }}</span>
{% if not forloop.last %}/{% endif %}
</span>
{% endfor %}
{% if item.director|length > 5 %}
<a href="javascript:void(0);" id="directorMore">{% trans '更多' %}</a>
<script>
$("#directorMore").on('click', function (e) {
$("span.director:not(:visible)").each(function (e) {
$(this).parent().removeAttr('style');
});
$(this).remove();
})
</script>
{% endif %}
{% if item.season_number %}
{% trans 'season number' %}: {{ item.season_number }}
{% endif %}
</div>
<div>
{% if item.playwright %}
{% trans '编剧:' %}
{% for playwright in item.playwright %}
<span {% if forloop.counter > 5 %}style="display: none;"{% endif %}>
<span class="playwright">{{ playwright }}</span>
{% if not forloop.last %}/{% endif %}
</span>
{% endfor %}
{% if item.playwright|length > 5 %}
<a href="javascript:void(0);" id="playwrightMore">{% trans '更多' %}</a>
<script>
$("#playwrightMore").on('click', function (e) {
$("span.playwright:not(:visible)").each(function (e) {
$(this).parent().removeAttr('style');
});
$(this).remove();
})
</script>
{% endif %}
{% if item.season_count %}
{% trans 'number of seasons' %}: {{ item.season_count }}
{% endif %}
</div>
<div>
{% if item.actor %}
{% trans '主演:' %}
{% for actor in item.actor %}
<span {% if forloop.counter > 5 %}style="display: none;"{% endif %}>
<span class="actor">{{ actor }}</span>
{% if not forloop.last %}/{% endif %}
</span>
{% endfor %}
{% if item.actor|length > 5 %}
<a href="javascript:void(0);" id="actorMore">{% trans '更多' %}</a>
<script>
$("#actorMore").on('click', function(e) {
$("span.actor:not(:visible)").each(function(e){
$(this).parent().removeAttr('style');
});
$(this).remove();
})
</script>
{% endif %}
{% if item.episode_count %}
{% trans 'number of episodes' %}: {{ item.episode_count }}
{% endif %}
</div>
<div>
{% if item.genre %}
{% trans '类型:' %}
{% for genre in item.genre %}
<span>{{ genre }}</span>
{% if not forloop.last %}/{% endif %}
{% endfor %}
{% if item.single_episode_length %}
{% trans 'episode Length' %}: {{ item.single_episode_length }}
{% endif %}
</div>
<div>
{% if item.area %}
{% trans '制片国家/地区:' %}
{% for area in item.area %}
<span>{{ area }}</span>
{% if not forloop.last %}/{% endif %}
{% endfor %}
{% endif %}
</div>
<div>
{% if item.language %}
{% trans '语言:' %}
{% for language in item.language %}
<span>{{ language }}</span>
{% if not forloop.last %}/{% endif %}
{% endfor %}
{% if item.duration %}
{% trans 'length' %}: {{ item.duration }}
{% endif %}
</div>
<div>
{% if item.showtime %}
{% trans '上映时间:' %}
{% trans 'release date' %}:
{% for showtime in item.showtime %}
<span>{{ showtime.time }}
{% if showtime.region %}({{ showtime.region }}){% endif %}
@ -126,45 +63,16 @@
{% endfor %}
{% endif %}
</div>
<div>
{% if item.other_title %}
{% trans '又名:' %}
{% for t in item.other_title %}
<span>{{ t }}</span>
{% if not forloop.last %}/{% endif %}
{% endfor %}
{% endif %}
</div>
<div>
{% if item.season_count %}
{% trans '总季数:' %}{{ item.season_count }}
{% endif %}
</div>
<div>
{% if item.season_number %}
{% trans '本季序号:' %}{{ item.season_number }}
{% endif %}
</div>
<div>
{% if item.episode_count %}
{% trans '本季集数:' %}{{ item.episode_count }}
{% endif %}
</div>
<div>
{% if item.single_episode_length %}
{% trans '单集长度:' %}{{ item.single_episode_length }}
{% endif %}
</div>
<div>
{% if item.imdb %}
{% trans 'IMDb' %}<a href="https://www.imdb.com/title/{{ item.imdb }}/"
{% trans 'IMDb' %}: <a href="https://www.imdb.com/title/{{ item.imdb }}/"
target="_blank"
rel="noopener">{{ item.imdb }}</a>
{% endif %}
</div>
<div>
{% if item.site %}
{% trans '网站:' %}
{% trans 'website' %}:
<a href="{{ item.site }}" target="_blank" rel="noopener">{{ item.site|strip_scheme }}</a>
{% endif %}
</div>
@ -172,5 +80,3 @@
{% for k, v in item.other_info.items %}<div>{{ k }}{{ v|urlizetrunc:24 }}</div>{% endfor %}
{% endif %}
{% endblock %}
<!-- class specific sidebar -->
{% block sidebar %}{% endblock %}

View file

@ -8,104 +8,17 @@
{% load thumb %}
<!-- class specific details -->
{% block details %}
<div>
{% if item.director %}
{% trans '导演:' %}
{% for director in item.director %}
<span {% if forloop.counter > 5 %}style="display: none;"{% endif %}>
<span class="director">{{ director }}</span>
{% if not forloop.last %}/{% endif %}
</span>
{% endfor %}
{% if item.director|length > 5 %}
<a href="javascript:void(0);" id="directorMore">{% trans '更多' %}</a>
<script>
$("#directorMore").on('click', function (e) {
$("span.director:not(:visible)").each(function (e) {
$(this).parent().removeAttr('style');
});
$(this).remove();
})
</script>
{% endif %}
{% endif %}
</div>
<div>
{% if item.playwright %}
{% trans '编剧:' %}
{% for playwright in item.playwright %}
<span {% if forloop.counter > 5 %}style="display: none;"{% endif %}>
<span class="playwright">{{ playwright }}</span>
{% if not forloop.last %}/{% endif %}
</span>
{% endfor %}
{% if item.playwright|length > 5 %}
<a href="javascript:void(0);" id="playwrightMore">{% trans '更多' %}</a>
<script>
$("#playwrightMore").on('click', function (e) {
$("span.playwright:not(:visible)").each(function (e) {
$(this).parent().removeAttr('style');
});
$(this).remove();
})
</script>
{% endif %}
{% endif %}
</div>
<div>
{% if item.actor %}
{% trans '主演:' %}
{% for actor in item.actor %}
<span {% if forloop.counter > 5 %}style="display: none;"{% endif %}>
<span class="actor">{{ actor }}</span>
{% if not forloop.last %}/{% endif %}
</span>
{% endfor %}
{% if item.actor|length > 5 %}
<a href="javascript:void(0);" id="actorMore">{% trans '更多' %}</a>
<script>
$("#actorMore").on('click', function(e) {
$("span.actor:not(:visible)").each(function(e){
$(this).parent().removeAttr('style');
});
$(this).remove();
})
</script>
{% endif %}
{% endif %}
</div>
<div>
{% if item.genre %}
{% trans '类型:' %}
{% for genre in item.genre %}
<span>{{ genre }}</span>
{% if not forloop.last %}/{% endif %}
{% endfor %}
{% endif %}
</div>
<div>
{% if item.area %}
{% trans '制片国家/地区:' %}
{% for area in item.area %}
<span>{{ area }}</span>
{% if not forloop.last %}/{% endif %}
{% endfor %}
{% endif %}
</div>
<div>
{% if item.language %}
{% trans '语言:' %}
{% for language in item.language %}
<span>{{ language }}</span>
{% if not forloop.last %}/{% endif %}
{% endfor %}
{% endif %}
</div>
<div>{% include '_people.html' with people=item.other_title role='other title' max=5 %}</div>
<div>{% include '_people.html' with people=item.director role='director' max=5 %}</div>
<div>{% include '_people.html' with people=item.playwright role='playwright' max=5 %}</div>
<div>{% include '_people.html' with people=item.actor role='actor' max=5 %}</div>
<div>{% include '_people.html' with people=item.genre role='genre' max=10 %}</div>
<div>{% include '_people.html' with people=item.area role='production area' max=10 %}</div>
<div>{% include '_people.html' with people=item.language role='language' max=5 %}</div>
{% with item.all_seasons as seasons %}
{% if seasons %}
<div>
{% trans '本剧所有季:' %}
{% trans 'all seasons' %}:
{% for s in seasons %}
<span class="season-number">
<a href="{{ s.url }}">{{ s.season_number|default:"#" }}</a>
@ -116,22 +29,27 @@
{% endwith %}
<div>
{% if item.season_count %}
{% trans '季数:' %}{{ item.season_count }}
{% trans 'number of seasons' %}: {{ item.season_count }}
{% endif %}
</div>
<div>
{% if item.episode_count %}
{% trans '集数:' %}{{ item.episode_count }}
{% trans 'number of episodes' %}: {{ item.episode_count }}
{% endif %}
</div>
<div>
{% if item.single_episode_length %}
{% trans '单集长度:' %}{{ item.single_episode_length }}
{% trans 'episode Length' %}: {{ item.single_episode_length }}
{% endif %}
</div>
<div>
{% if item.duration %}
{% trans 'length' %}: {{ item.duration }}
{% endif %}
</div>
<div>
{% if item.showtime %}
{% trans '播出时间:' %}
{% trans 'release date' %}:
{% for showtime in item.showtime %}
<span>{{ showtime.time }}
{% if showtime.region %}({{ showtime.region }}){% endif %}
@ -140,25 +58,16 @@
{% endfor %}
{% endif %}
</div>
<div>
{% if item.other_title %}
{% trans '又名:' %}
{% for t in item.other_title %}
<span>{{ t }}</span>
{% if not forloop.last %}/{% endif %}
{% endfor %}
{% endif %}
</div>
<div>
{% if item.imdb %}
{% trans 'IMDb' %}<a href="https://www.imdb.com/title/{{ item.imdb }}/"
{% trans 'IMDb' %}: <a href="https://www.imdb.com/title/{{ item.imdb }}/"
target="_blank"
rel="noopener">{{ item.imdb }}</a>
{% endif %}
</div>
<div>
{% if item.site %}
{% trans '网站:' %}
{% trans 'website' %}:
<a href="{{ item.site }}" target="_blank" rel="noopener">{{ item.site|strip_scheme }}</a>
{% endif %}
</div>

View file

@ -8,29 +8,13 @@
{% load thumb %}
<!-- class specific details -->
{% block details %}
<div>
{% if item.other_title %}
{% trans '又名:' %}
{% for t in item.other_title %}
<span>{{ t }}</span>
{% if not forloop.last %}/{% endif %}
{% endfor %}
{% endif %}
</div>
<div>
{% if item.author %}
{% trans '作者:' %}
{% for author in item.author %}
<span>{{ author }}</span>
{% if not forloop.last %}/{% endif %}
{% endfor %}
{% endif %}
</div>
<div>{% include '_people.html' with people=item.other_title role='other title' max=5 %}</div>
<div>{% include '_people.html' with people=item.author role='author' max=5 %}</div>
{% endblock %}
{% block left_sidebar %}
<div _="init hide .item-mark-buttons then hide .item-mark-icon end">
<details open>
<summary>{% trans '本著作包含以下图书版本' %}</summary>
<summary>{% trans 'Editions' %}</summary>
{% for b in item.editions.all %}
<div>
<a href="{{ b.url }}">{{ b.title }}</a>

View file

@ -3,13 +3,13 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>☃ NeoDB 升级中...</title>
<title>☃ NeoDB is being renovated...</title>
</head>
<body>
<div class="pl">
<div class="pl__outer-ring"></div>
<div class="pl__inner-ring">
<center>NeoDB 升级中...</center>
<center>NeoDB is being renovated...</center>
</div>
<div class="pl__track-cover"></div>
<div class="pl__ball">

View file

@ -8,7 +8,7 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{ site_name }} - {% trans '错误' %}</title>
<title>{{ site_name }} - {% trans 'Error' %}</title>
{% include "common_libs.html" %}
{% if url %}<meta http-equiv="refresh" content="3;url={{ url }}">{% endif %}
</head>

View file

@ -4,6 +4,7 @@ import zipfile
import pytz
from django.utils.dateparse import parse_datetime
from django.utils.translation import gettext_lazy as _
from loguru import logger
from markdownify import markdownify as md

View file

@ -1,6 +1,7 @@
import django_rq
import listparser
from auditlog.context import set_actor
from django.utils.translation import gettext_lazy as _
from loguru import logger
from user_messages import api as msg

View file

@ -6,7 +6,7 @@
<a hx-post="{% url 'journal:post_boost' post.pk %}"
hx-include="[name='post_url']"
{% if boosted %}class="activated"{% endif %}
title="转播">
title="{% trans "boost" %}">
<input type="hidden" name="post_url" value="{{ post.object_uri }}">
<i class="fa-solid fa-retweet"></i>
{% if post.stats.boosts > 1 %}<span>{{ post.stats.boosts }}</span>{% endif %}

View file

@ -6,12 +6,13 @@
{% if liked %}
<a class="activated"
hx-post="{% url 'journal:post_unlike' post.pk %}"
title="已喜欢">
title="{% trans "liked" %}">
<i class="fa-solid fa-heart }}"></i>
<span>{{ post.stats.likes }}</span>
</a>
{% else %}
<a hx-post="{% url 'journal:post_like' post.pk %}" title="喜欢">
<a hx-post="{% url 'journal:post_like' post.pk %}"
title="{% trans "like" %}">
<i class="fa-regular fa-heart }}"></i>
{% if post.stats.likes %}<span>{{ post.stats.likes }}</span>{% endif %}
</a>

View file

@ -3,7 +3,7 @@
rel="noopener"
href="{{ post.object_uri }}"
onclick="navigator.share({url:'{{ post.object_uri|escapejs }}'});event.preventDefault();"
title="联邦宇宙分享链接">
title="{% trans "link for fediverse" %}">
{% if post.visibility == 1 %}
<i class="fa-solid fa-lock-open"></i>
{% elif post.visibility == 2 %}

View file

@ -1,5 +1,5 @@
<span>
<a title="回应"
<a title="{% trans "reply" %}"
{% if href %} href="{{ href }}" {% else %} {% if not request.user.is_authenticated %}hx-disable{% endif %}
hx-get="{% url 'journal:piece_replies' piece.uuid %}"
hx-swap="outerHTML"

View file

@ -8,7 +8,7 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
{% if me %}
<title>{{ site_name }} - {% trans '我的个人主页' %}</title>
<title>{{ site_name }} - {% trans 'Home' %}</title>
{% else %}
<title>{{ site_name }} - {{ identity.display_name }}</title>
{% endif %}
@ -20,7 +20,7 @@
{% if not identity.anonymous_viewable %}<meta name="robots" content="noindex">{% endif %}
<link rel="alternate"
type="application/rss+xml"
title="{{ site_name }} - @{{ identity.handle }}的评论"
title="{{ site_name }} - @{{ identity.handle }} - Reviews"
href="{{ identity.url }}feed/reviews/">
{% include "common_libs.html" %}
<script src="{% static 'js/calendar_yearview_blocks.js' %}" defer></script>
@ -52,10 +52,10 @@
</span>
</span>
<h5>
书影音日历
{% trans "calendar" %}
{% if year %}
<small>
<a href="{% url 'journal:wrapped' year %}">{{ year }} 年度统计</a>
<a href="{% url 'journal:wrapped' year %}">{{ year }} {% trans "annual summary" %}</a>
</small>
{% endif %}
</h5>
@ -106,7 +106,7 @@
</a>
</li>
{% empty %}
<div>暂无记录</div>
<div>{% trans "nothing so far." %}</div>
{% endfor %}
</ul>
</section>
@ -128,7 +128,7 @@
</span>
</span>
<h5>
{% trans '创建的收藏单' %}
{% trans 'collection' %}
<small>
<a href="{% url 'journal:user_collection_list' identity.handle %}">{{ collections_count }}</a>
{% if identity.user == request.user %}
@ -168,7 +168,7 @@
</span>
</span>
<h5>
{% trans '喜欢的收藏单' %}
{% trans 'liked collection' %}
<small>
<a href="{% url 'journal:user_liked_collection_list' identity.handle %}">{{ liked_collections_count }}</a>
</small>
@ -184,7 +184,7 @@
</a>
</li>
{% empty %}
<div>暂无记录</div>
<div>{% trans "nothing so far." %}</div>
{% endfor %}
</ul>
</section>
@ -192,10 +192,10 @@
{% if identity.user == request.user %}
<div class="entity-sort-control">
<div class="entity-sort-control__button" id="sortEditButton">
<span class="entity-sort-control__text" id="sortEditText">{% trans '编辑布局' %}</span>
<span class="entity-sort-control__text" id="sortEditText">{% trans 'edit layout' %}</span>
<span class="entity-sort-control__text"
id="sortSaveText"
style="display: none">{% trans '保存' %}</span>
style="display: none">{% trans 'save' %}</span>
<span class="icon-edit" id="sortEditIcon">
<i class="fa-solid fa-pencil"></i>
</span>
@ -206,14 +206,14 @@
<div class="entity-sort-control__button"
id="sortExitButton"
style="display: none">
<span class="entity-sort-control__text">{% trans '取消' %}</span>
<span class="entity-sort-control__text">{% trans 'cancel' %}</span>
</div>
</div>
<div class="entity-sort-control__button entity-sort-control__button--float-right"
id="toggleDisplayButtonTemplate"
style="display: none">
<span class="showText" style="display: none;">{% trans '显示' %}</span>
<span class="hideText" style="display: none;">{% trans '隐藏' %}</span>
<span class="showText" style="display: none;">{% trans 'show' %}</span>
<span class="hideText" style="display: none;">{% trans 'hide' %}</span>
</div>
<form action="{% url 'users:set_layout' %}" method="post" id="sortForm">
{% csrf_token %}

View file

@ -7,7 +7,7 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{ site_name }} - {{ item.title }} - {% trans '评论' %}</title>
<title>{{ site_name }} - {% trans 'Review' %} - {{ item.display_title }}</title>
{% include "common_libs.html" %}
<style type="text/css">#id_visibility, #id_visibility li {padding-left:0; margin-bottom:0; display: inline-block !important;}</style>
</head>
@ -30,16 +30,17 @@
<div>
<label for="leading_space" style="display: inline">
<input type="checkbox" name="leading_space" value="1" id="leading_space">
保存时<span data-tooltip="希望行首缩进但不便输全角时可选此替换两半角为一全角">将行首空格替换为全角</span>
{% trans "When saving, replace leading spaces with full-width spaces" %}
<span data-tooltip="希望行首缩进但不便输全角时可选此替换两半角为一全角">?</span>
</label>
</div>
<div>{{ form.visibility }}</div>
<div>{{ form.share_to_mastodon }}{{ form.share_to_mastodon.label }}</div>
</div>
<input class="button float-right" type="submit" value="{% trans '提交' %}">
<input class="button float-right" type="submit" value="{% trans 'Save' %}">
<div>
<label for="mark_anotherday">
更改标记日期:
{% trans "change review date" %}
<input type="checkbox" name="mark_anotherday" value="1" id="mark_anotherday">
<input type="date"
name="mark_date"
@ -63,7 +64,7 @@
</form>
<hr>
<details>
<summary>Markdown语法参考</summary>
<summary>{% trans "Markdown format references" %}</summary>
<pre>
标题
====

File diff suppressed because it is too large Load diff

View file

@ -321,22 +321,24 @@ class TootVisibilityEnum:
UNLISTED = "unlisted"
def detect_server_info(login_domain) -> tuple[str, str, str]:
def detect_server_info(login_domain: str) -> tuple[str, str, str]:
url = f"https://{login_domain}/api/v1/instance"
try:
response = get(url, headers={"User-Agent": USER_AGENT})
except Exception as e:
logger.warning(f"Error connecting {login_domain}: {e}")
raise Exception(f"无法连接实例 {login_domain}")
logger.error(f"Error connecting {login_domain}: {e}")
raise Exception(f"Error connecting to instance {login_domain}")
if response.status_code != 200:
logger.warning(f"Error connecting {login_domain}: {response.status_code}")
raise Exception(f"实例 {login_domain} 返回错误,代码: {response.status_code}")
logger.error(f"Error connecting {login_domain}: {response.status_code}")
raise Exception(
f"Instance {login_domain} returned error code {response.status_code}"
)
try:
j = response.json()
domain = j["uri"].lower().split("//")[-1].split("/")[0]
except Exception as e:
logger.warning(f"Error connecting {login_domain}: {e}")
raise Exception(f"实例 {login_domain} 返回信息无法识别")
logger.error(f"Error connecting {login_domain}: {e}")
raise Exception(f"Instance {login_domain} returned invalid data")
server_version = j["version"]
api_domain = domain
if domain != login_domain:
@ -365,17 +367,17 @@ def get_or_create_fediverse_application(login_domain):
app.delete()
if not settings.MASTODON_ALLOW_ANY_SITE:
logger.warning(f"Disallowed to create app for {domain}")
raise Exception("不支持其它实例登录")
raise ValueError("Unsupported instance")
if login_domain.lower() in settings.SITE_DOMAINS:
raise ValueError("必须使用其它实例登录")
raise ValueError("Unsupported instance")
domain, api_domain, server_version = detect_server_info(login_domain)
if (
domain.lower() in settings.SITE_DOMAINS
or api_domain.lower() in settings.SITE_DOMAINS
):
raise ValueError("必须使用其它实例登录")
raise ValueError("Unsupported instance")
if "neodb/" in server_version:
raise ValueError("必须使用非NeoDB实例登录")
raise ValueError("Unsupported instance")
if login_domain != domain:
app = MastodonApplication.objects.filter(domain_name__iexact=domain).first()
if app:
@ -389,12 +391,12 @@ def get_or_create_fediverse_application(login_domain):
logger.error(
f"Error creating app for {domain} on {api_domain}: {response.status_code}"
)
raise Exception("实例注册应用失败,代码: " + str(response.status_code))
raise Exception("Error creating app, code: " + str(response.status_code))
try:
data = response.json()
except Exception:
logger.error(f"Error creating app for {domain}: unable to parse response")
raise Exception("实例注册应用失败,返回内容无法识别")
raise Exception("Error creating app, invalid response")
app = MastodonApplication.objects.create(
domain_name=domain.lower(),
api_domain=api_domain.lower(),

View file

@ -3,6 +3,13 @@ from django.utils import timezone
from django.utils.translation import gettext_lazy as _
class MastodonError(Exception):
instance: str
def __init__(self, *args: object) -> None:
super().__init__(args)
class MastodonApplication(models.Model):
domain_name = models.CharField(_("site domain name"), max_length=200, unique=True)
api_domain = models.CharField(_("domain for api call"), max_length=200, blank=True)

View file

@ -14,6 +14,6 @@
{% endif %}
</span>
<div class="spacing">
创建了收藏单
{% trans "created collection" %}
<a href="{{ activity.action_object.url }}">{{ activity.action_object.title }}</a>
</div>

View file

@ -15,7 +15,7 @@
{% endif %}
</span>
<div class="spacing">
设置了目标
{% trans "set a target" %}
<a href="{{ collection.url }}">{{ collection.title }}</a>
</div>
<p>

View file

@ -15,9 +15,7 @@
{% endif %}
</span>
<div class="spacing">
关注了
<a href="{{ collection.owner.url }}">{{ collection.owner.display_name }}</a>
的收藏单
{% blocktrans with owner_url=collection.owner.url owner_name=collection.owner.display_name %}liked <a href="{{ owner_url }}">{{ owner_name }}</a>'s collection{% endblocktrans %}
<a href="{{ collection.url }}">{{ collection.title }}</a>
</div>
{% endwith %}

View file

@ -8,7 +8,7 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{ site_name }} - {% trans '动态' %}</title>
<title>{{ site_name }} - {% trans 'Activities from those you follow' %}</title>
{% include "common_libs.html" %}
<script src="{{ cdn_url }}/npm/shikwasa@2.2.1/dist/shikwasa.min.js"></script>
<link href="{{ cdn_url }}/npm/shikwasa@2.2.1/dist/style.min.css"
@ -19,7 +19,7 @@
{% include "_header.html" with current="timeline" %}
<main>
<div class="grid__main">
<h5>好友动态</h5>
<h5>{% trans 'Activities from those you follow' %}</h5>
<div class="feed">
<div hx-get="{% url 'social:data' %}"
hx-trigger="intersect once delay:0.1s"

View file

@ -42,10 +42,11 @@
{% endif %}
{% empty %}
{% if request.GET.last %}
<div class="empty">{% trans '目前没有更多内容了' %}</div>
<div class="empty">{% trans 'nothing more.' %}</div>
{% else %}
<div>
搜索并标记一些书影音/播客/游戏,<a href="{% url 'users:data' %}">导入你的豆瓣或Goodreads记录</a>,去联邦宇宙(长毛象)关注一些正在使用{{ site_name }}的用户,这里就会显示你和她们的近期动态。
<div class="empty">
{% url 'users:data' as import_url %}
{% blocktrans %}Find and mark some books/movies/podcasts/games, <a href="{{ import_url }}">import your data</a> from Goodreads/Letterboxd/Douban, follow some fellow {{ site_name }} users on the fediverse, so their recent activities and yours will show up here.{% endblocktrans %}
</div>
{% endif %}
{% endfor %}

View file

@ -83,7 +83,7 @@ def connect(request):
return render(
request,
"common/error.html",
{"msg": _("无效的电子邮件地址")},
{"msg": _("Invalid email address")},
)
user = User.objects.filter(email__iexact=login_email).first()
code = base62.encode(random.randint(pow(62, 4), pow(62, 5) - 1))
@ -101,8 +101,10 @@ def connect(request):
request,
"common/verify.html",
{
"msg": _("验证邮件已发送"),
"secondary_msg": _("请查阅收件箱"),
"msg": _("Verification"),
"secondary_msg": _(
"Verification email is being sent, please check your inbox."
),
"action": action,
},
)
@ -116,7 +118,7 @@ def connect(request):
request,
"common/error.html",
{
"msg": "未指定实例域名",
"msg": _("Missing instance domain"),
"secondary_msg": "",
},
)
@ -137,8 +139,8 @@ def connect(request):
request,
"common/error.html",
{
"msg": "无法连接指定实例,请检查域名拼写",
"secondary_msg": str(e),
"msg": _("Error connecting to instance"),
"secondary_msg": f"{login_domain} {e}",
},
)
@ -152,14 +154,20 @@ def connect_redirect_back(request):
return render(
request,
"common/error.html",
{"msg": _("认证失败😫"), "secondary_msg": _("Mastodon服务未能返回有效认证信息")},
{
"msg": _("Authentication failed"),
"secondary_msg": _("Invalid response from Mastodon instance."),
},
)
site = request.session.get("mastodon_domain")
if not site:
return render(
request,
"common/error.html",
{"msg": _("认证失败😫"), "secondary_msg": _("无效会话信息")},
{
"msg": _("Authentication failed"),
"secondary_msg": _("Invalid cookie data."),
},
)
try:
token, refresh_token = obtain_token(site, request, code)
@ -169,7 +177,10 @@ def connect_redirect_back(request):
return render(
request,
"common/error.html",
{"msg": _("认证失败😫"), "secondary_msg": _("Mastodon服务未能返回有效认证令牌")},
{
"msg": _("Authentication failed"),
"secondary_msg": _("Invalid token from Mastodon instance."),
},
)
if (
@ -186,7 +197,14 @@ def connect_redirect_back(request):
else: # newly registered user
code, user_data = verify_account(site, token)
if code != 200 or user_data is None:
return render(request, "common/error.html", {"msg": _("联邦宇宙访问失败😫")})
return render(
request,
"common/error.html",
{
"msg": _("Authentication failed"),
"secondary_msg": _("Invalid account data from Mastodon instance."),
},
)
return register_new_user(
request,
username=None
@ -208,8 +226,8 @@ def register_new_user(request, **param):
request,
"common/error.html",
{
"msg": _("注册失败😫"),
"secondary_msg": _("本站仅限邀请注册"),
"msg": _("Authentication failed"),
"secondary_msg": _("Registration is for invitation only"),
},
)
else:
@ -288,27 +306,35 @@ class RegistrationForm(forms.ModelForm):
def send_verification_link(user_id, action, email, code=""):
s = {"i": user_id, "e": email, "a": action}
v = TimestampSigner().sign_object(s)
if action == "verify":
subject = f'{settings.SITE_INFO["site_name"]} - {_("验证电子邮件地址")}'
url = settings.SITE_INFO["site_url"] + "/account/verify_email?c=" + v
msg = f"你好,\n请点击以下链接验证你的电子邮件地址 {email}\n{url}\n\n如果你没有注册过本站,请忽略此邮件。"
elif action == "login":
subject = f'{settings.SITE_INFO["site_name"]} - {_("登录")} {code}'
url = settings.SITE_INFO["site_url"] + "/account/login/email?c=" + v
msg = (
"你好,\n"
+ f"在登录界面输入如下验证码:\n\n{code}\n\n"
+ f"点击以下链接登录{email}账号\n{url}\n\n如果你没有请求登录本站,请忽略此邮件;如果你确信账号存在安全风险,请更改注册邮件地址或与我们联系。"
footer = _(
"\n\nIf you did not mean to register or login, please ignore this email. If you are concerned with your account security, please change the email linked with your account, or contact us."
)
site = settings.SITE_INFO["site_name"]
if action == "verify":
subject = f'{site} - {_("Verification")}'
url = settings.SITE_INFO["site_url"] + "/account/verify_email?c=" + v
msg = _("Click this link to verify your email address {email}\n{url}").format(
email=email, url=url, code=code
)
msg += footer
elif action == "login":
subject = f'{site} - {_("Login")} {code}'
url = settings.SITE_INFO["site_url"] + "/account/login/email?c=" + v
msg = _(
"Use this code to confirm login as {email}\n\n{code}\n\nOr click this link to login\n{url}"
).format(email=email, url=url, code=code)
msg += footer
elif action == "register":
subject = f'{settings.SITE_INFO["site_name"]} - {_("注册新账号")}'
subject = f'{site} - {_("Register")}'
url = settings.SITE_INFO["site_url"] + "/account/register_email?c=" + v
msg = f"你好,\n本站没有与{email}关联的账号。你希望注册一个新账号吗?\n"
msg += "\n如果你已注册过本站或某个联邦宇宙(长毛象)实例,不必重新注册,只要用联邦宇宙身份登录本站,再关联这个电子邮件地址,即可通过邮件登录。\n"
msg += "\n如果你还没有联邦宇宙身份,可以访问这里选择实例并创建一个: https://joinmastodon.org/zh/servers\n"
msg = _(
"There is no account registered with this email address yet.{email}\n\nIf you already have an account with a Fediverse identity, just login and add this email to you account.\n\n"
).format(email=email, url=url, code=code)
if settings.ALLOW_EMAIL_ONLY_ACCOUNT:
msg += f"\n如果你不便使用联邦宇宙身份,也可以点击以下链接使用电子邮件注册一个新账号,以后再关联到联邦宇宙。\n{url}\n"
msg += "\n如果你没有打算用此电子邮件地址注册或登录本站,请忽略此邮件。"
msg += _(
"\nIf you prefer to register a new account, please use this code: {code}\nOr click this link:\n{url}"
).format(email=email, url=url, code=code)
msg += footer
else:
raise ValueError("Invalid action")
try:
@ -333,7 +359,7 @@ def verify_code(request):
request,
"common/verify.html",
{
"error": _("无效的验证码"),
"error": _("Invalid verification code"),
},
)
login_email = cache.get(f"login_{code}")
@ -342,7 +368,7 @@ def verify_code(request):
request,
"common/verify.html",
{
"error": _("无效的验证码"),
"error": _("Invalid verification code"),
},
)
cache.delete(f"login_{code}")
@ -361,7 +387,7 @@ def verify_email(request):
s = TimestampSigner().unsign_object(request.GET.get("c"), max_age=60 * 15)
except Exception as e:
logger.warning(f"login link invalid {e}")
error = _("链接无效或已过期")
error = _("Invalid verification link")
return render(
request, "users/verify_email.html", {"success": False, "error": error}
)
@ -378,22 +404,22 @@ def verify_email(request):
request, "users/verify_email.html", {"success": True, "user": user}
)
else:
error = _("电子邮件地址不匹配")
error = _("Email mismatch")
elif action == "login":
user = User.objects.get(pk=s["i"])
if user.email == email:
return login_existing_user(request, user)
else:
error = _("电子邮件地址不匹配")
error = _("Email mismatch")
elif action == "register":
user = User.objects.filter(email__iexact=email).first()
if user:
error = _("此电子邮件地址已被注册")
error = _("Email in use")
else:
return register_new_user(request, username=None, email=email)
except Exception as e:
logger.error(e)
error = _("无法完成验证")
error = _("Unable to verify")
return render(
request, "users/verify_email.html", {"success": False, "error": error}
)
@ -425,7 +451,7 @@ def register(request: AuthedHttpRequest):
"users/register.html",
{
"form": form,
"error": _("用户名已被使用"),
"error": _("Username in use"),
},
)
request.user.username = form.cleaned_data["username"]
@ -440,7 +466,7 @@ def register(request: AuthedHttpRequest):
"users/register.html",
{
"form": form,
"error": _("电子邮件地址已被使用"),
"error": _("Email in use"),
},
)
request.user.pending_email = form.cleaned_data["email"]
@ -458,13 +484,19 @@ def register(request: AuthedHttpRequest):
"verify",
request.user.pending_email,
)
messages.add_message(request, messages.INFO, _("已发送验证邮件,请查收。"))
messages.add_message(
request,
messages.INFO,
_("Verification email is being sent, please check your inbox."),
)
if request.user.username and not request.user.identity_linked():
request.user.initialize()
if username_changed:
messages.add_message(request, messages.INFO, _("用户名已设置。"))
messages.add_message(request, messages.INFO, _("Username all set."))
if email_cleared:
messages.add_message(request, messages.INFO, _("电子邮件地址已取消关联。"))
messages.add_message(
request, messages.INFO, _("Email removed from account.")
)
if request.session.get("new_user"):
del request.session["new_user"]
return redirect(request.GET.get("next", reverse("common:home")))
@ -482,7 +514,9 @@ def swap_login(request, token, site, refresh_token):
and site == current_user.mastodon_site
):
messages.add_message(
request, messages.ERROR, _(f"该身份 {username}@{site} 与当前账号相同。")
request,
messages.ERROR,
_("Unable to update login information: identical identity."),
)
else:
try:
@ -490,7 +524,9 @@ def swap_login(request, token, site, refresh_token):
mastodon_username__iexact=username, mastodon_site__iexact=site
)
messages.add_message(
request, messages.ERROR, _(f"该身份 {username}@{site} 已被用于其它账号。")
request,
messages.ERROR,
_("Unable to update login information: identity in use."),
)
except ObjectDoesNotExist:
current_user.mastodon_username = username
@ -514,10 +550,14 @@ def swap_login(request, token, site, refresh_token):
refresh_mastodon_data_task, current_user.pk, token
)
messages.add_message(
request, messages.INFO, _(f"账号身份已更新为 {username}@{site}")
request,
messages.INFO,
_("Login information updated.") + f" {username}@{site}",
)
else:
messages.add_message(request, messages.ERROR, _("连接联邦宇宙获取身份信息失败。"))
messages.add_message(
request, messages.ERROR, _("Invalid account data from Mastodon instance.")
)
return redirect(reverse("users:data"))
@ -566,5 +606,5 @@ def clear_data(request):
django_rq.get_queue("mastodon").enqueue(clear_data_task, request.user.id)
return auth_logout(request)
else:
messages.add_message(request, messages.ERROR, _("验证信息不符。"))
messages.add_message(request, messages.ERROR, _("Account mismatch."))
return redirect(reverse("users:data"))

View file

@ -7,7 +7,7 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
{% include "common_libs.html" %}
<title>{{ site_name }} - {% trans '公告栏' %}</title>
<title>{{ site_name }} - {% trans 'Announcements' %}</title>
</head>
<body>
{% include "_header.html" %}
@ -37,7 +37,7 @@
</style>
<main class="container">
<h1 class="header">
{% trans '公告栏' %}
{% trans 'Announcements' %}
{% if request.user.is_superuser %}🦹🏻{% endif %}
{% if request.user.is_staff %}🧙🏻{% endif %}
</h1>
@ -50,7 +50,7 @@
</footer>
</article>
{% empty %}
<p>{% trans '暂无公告' %}</p>
<p>{% trans 'nothing so far.' %}</p>
{% endfor %}
</main>
{% include "_footer.html" %}

View file

@ -1,4 +1,4 @@
<p>
<i class="fa-solid fa-triangle-exclamation"></i>
无法找到用户,请确认拼写正确;也可能服务器正忙,请稍后再尝试。
{% trans "Unable to find the user, please check your spelling; or the server may be busy, please try again later." %}
</p>

View file

@ -9,7 +9,7 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{ site_name }} - {% trans '查询用户' %}</title>
<title>{{ site_name }} - {% trans 'Searching the fediverse' %}</title>
{% include "common_libs.html" %}
</head>
<body>
@ -18,14 +18,14 @@
<div class="grid__main">
<article>
{% if handle %}
<h5>正在从联邦网络查询{{ handle }}</h5>
<h5>{% trans "Searching the fediverse" %} - {{ handle }}</h5>
<div hx-get="{% url 'users:fetch_refresh' %}?handle={{ handle }}"
hx-trigger="load delay:2s"
hx-swap="outerHTML">
<i class="fa-solid fa-compact-disc fa-spin loading"></i>
</div>
{% else %}
<h5>获取系统繁忙,请稍等几秒钟再搜索</h5>
<h5>{% trans "System busy, please try again in a minute." %}</h5>
{% endif %}
</article>
</div>

View file

@ -6,8 +6,7 @@
<meta charset="UTF-8">
<meta http-equiv="refresh" content="0;URL={{ redir }}" />
<title>{{ site_name }} - {{ identity.handle }}</title>
<meta property="og:title"
content="{{ site_name }} - {{ identity.handle }}的主页">
<meta property="og:title" content="{{ site_name }} - {{ identity.handle }}">
<meta property="og:type" content="website">
<meta property="og:url" content="{{ identity.url }}">
<meta property="og:image" content="{{ identity.avatar }}">

View file

@ -8,7 +8,7 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{ site_name }} - 设置</title>
<title>{{ site_name }} - {% trans "Preferences" %}</title>
{% include "common_libs.html" %}
</head>
<body>
@ -18,91 +18,97 @@
<article>
<details open>
<summary>
<b>{% trans '使用偏好' %}</b>
<b>{% trans "Preferences" %}</b>
</summary>
<form action="{% url 'users:preferences' %}" method="post">
{% csrf_token %}
<fieldset>
{% trans '登录后显示:' %}
{% trans 'Default view once logged in' %}
<input type="radio"
name="classic_homepage"
value="0"
id="classic_homepage0"
{% if request.user.preference.classic_homepage == 0 %}checked{% endif %}>
<label for="classic_homepage0">内容发现</label>
<label for="classic_homepage0">{% trans "Discover" %}</label>
<input type="radio"
name="classic_homepage"
value="2"
id="classic_homepage2"
{% if request.user.preference.classic_homepage == 2 %}checked{% endif %}>
<label for="classic_homepage2">好友动态</label>
<label for="classic_homepage2">{% trans "Activities" %}</label>
<input type="radio"
name="classic_homepage"
value="1"
id="classic_homepage1"
{% if request.user.preference.classic_homepage == 1 %}checked{% endif %}>
<label for="classic_homepage1">个人主页</label>
<label for="classic_homepage1">{% trans "Home" %}</label>
</fieldset>
<fieldset>
{% trans '发表时的默认可见性:' %}
{% trans 'Default visibility' %}
<input type="radio"
name="default_visibility"
value="0"
required=""
id="id_visibility_0"
{% if request.user.preference.default_visibility == 0 %}checked{% endif %}>
<label for="id_visibility_0">公开</label>
<label for="id_visibility_0">{% trans "Public" %}</label>
<input type="radio"
name="default_visibility"
value="1"
required=""
id="id_visibility_1"
{% if request.user.preference.default_visibility == 1 %}checked{% endif %}>
<label for="id_visibility_1">仅关注者</label>
<label for="id_visibility_1">{% trans "Followers Only" %}</label>
<input type="radio"
name="default_visibility"
value="2"
required=""
id="id_visibility_2"
{% if request.user.preference.default_visibility == 2 %}checked{% endif %}>
<label for="id_visibility_2">仅本人和被提及的用户</label>
<label for="id_visibility_2">{% trans "Mentioned Only" %}</label>
</fieldset>
<fieldset>
可见性选择「公开」时以如下方式发布到联邦网络:
{% trans "Public status will be posted to fediverse" %}
<input type="radio"
id="post_public_mode_0"
name="post_public_mode"
value="0"
{% if request.user.preference.post_public_mode == 0 %}checked{% endif %} />
<label for="post_public_mode_0">Public</label>
<label for="post_public_mode_0">{% trans "in public timeline" %}</label>
<input type="radio"
id="post_public_mode_1"
name="post_public_mode"
value="1"
{% if request.user.preference.post_public_mode == 1 %}checked{% endif %} />
<label for="post_public_mode_1">
Unlisted
<em data-tooltip="unlisted帖子不会出现在本站和外站公共时间轴"><i class="fa fa-question-circle"></i></em>
</label>
<label for="post_public_mode_1">{% trans "unlisted and excluded from public timeline" %}</label>
{% if enable_local_only %}
<input type="radio"
id="post_public_mode_4"
name="post_public_mode"
value="4"
{% if request.user.preference.post_public_mode == 4 %}checked{% endif %} />
<label for="post_public_mode_4">仅本站</label>
<label for="post_public_mode_4">{% trans "local, this site only" %}</label>
{% endif %}
</fieldset>
{% if request.user.mastodon_acct %}
<fieldset>
转发到<em data-tooltip="@{{ request.user.mastodon_acct }}">主ID</em>时间轴时:
<label>
{% trans "Repost to your timeline by default" %}
<input type="checkbox"
name="mastodon_default_repost"
value="1"
{% if request.user.preference.mastodon_default_repost %}checked{% endif %}>
</label>
</fieldset>
<fieldset>
{% trans "Method for reposting to your timeline" %}
<input type="radio"
name="mastodon_repost_mode"
value="0"
required=""
id="mastodon_repost_mode_0"
{% if request.user.preference.mastodon_repost_mode == 0 %}checked{% endif %}>
<label for="mastodon_repost_mode_0">使用转播boost</label>
<label for="mastodon_repost_mode_0">{% trans "boost" %}</label>
<input type="radio"
name="mastodon_repost_mode"
value="1"
@ -110,25 +116,16 @@
id="mastodon_repost_mode_1"
{% if request.user.preference.mastodon_repost_mode == 1 %}checked{% endif %}>
<label for="mastodon_repost_mode_1">
另发新帖文
<em data-tooltip="删改标记可能产生重复帖文,其他人对新帖的回应、点赞不会被记录"><i class="fa fa-question-circle"></i></em>
</label>
</fieldset>
<fieldset>
<label>
发表时默认选中 转发到<em data-tooltip="@{{ request.user.mastodon_acct }}">主ID</em>时间轴
<input type="checkbox"
name="mastodon_default_repost"
value="1"
{% if request.user.preference.mastodon_default_repost %}checked{% endif %}>
{% trans "repost as new post" %}
<em data-tooltip="{% trans "this method is less optimal, may generate duplicated posts and miss reactions." %}"><i class="fa fa-question-circle"></i></em>
</label>
</fieldset>
{% endif %}
<fieldset>
<label for="mastodon_append_tag">{% trans '发表标记时在结尾附加标签:' %}</label>
<label for="mastodon_append_tag">{% trans 'append tags when posting to timeline' %}</label>
<input name="mastodon_append_tag"
id="mastodon_append_tag"
placeholder="例如 #我的书影音"
placeholder="{% trans "e.g. #bookstodon" %}"
value="{{ request.user.preference.mastodon_append_tag }}">
</fieldset>
<fieldset>
@ -142,7 +139,7 @@
</select>
</fieldset>
<fieldset>
<legend>{% trans '搜索时不显示以下类型:' %}</legend>
<legend>{% trans 'hide these categories in search results' %}</legend>
<select name="hidden_categories" size="3" multiple>
{% all_categories as categories %}
{% for c in categories %}
@ -158,8 +155,8 @@
<input type="checkbox"
name="anonymous_viewable"
{% if request.user.identity.anonymous_viewable %}checked{% endif %}>
{% trans '匿名访客和搜索引擎可以查看你的个人主页' %}
<em data-tooltip="此选项仅针对网页访客,如果不希望被联邦网络用户看到请在发表时选择仅关注者或本人"><i class="fa fa-question-circle"></i></em>
{% trans 'Profile visible to anonymous web visitors and search engines' %}
<em data-tooltip="{% trans "this option limits web visits only; to limit fediverse visibility, choose followers only or mentioned only when posting" %}"><i class="fa fa-question-circle"></i></em>
</label>
</fieldset>
<fieldset>
@ -167,35 +164,35 @@
<input type="checkbox"
name="show_last_edit"
{% if request.user.preference.show_last_edit %}checked{% endif %}>
{% trans '显示你是某条目的最近编辑者' %}
{% trans 'show your name on item page if you recently edited it' %}
</label>
</fieldset>
<input type="submit" value="{% trans '保存' %}">
<input type="submit" value="{% trans 'Save' %}">
</form>
</details>
</article>
<article>
<details>
<summary>{% trans '当前设备设置' %}</summary>
<summary>{% trans 'Settings for current device' %}</summary>
<form onsubmit="return false;">
<h6>明暗风格</h6>
<h6>{% trans "theme" %}</h6>
<p>
<input type="radio" name="theme_color" id="theme_auto" value="">
<label for="theme_auto">系统</label>
<label for="theme_auto">{% trans "system" %}</label>
<input type="radio" name="theme_color" id="theme_light" value="light">
<label for="theme_light">明亮</label>
<label for="theme_light">{% trans "light" %}</label>
<input type="radio" name="theme_color" id="theme_dark" value="dark">
<label for="theme_dark">暗色</label>
<label for="theme_dark">{% trans "dark" %}</label>
</p>
<h6>专注模式</h6>
<h6>{% trans "focus mode" %}</h6>
<p>
<input type="checkbox" id="solo_mode">
<label for="solo_mode">启用专注模式后搜索和条目页面将不再显示来自他人的评价和打分</label>
<label for="solo_mode">{% trans "hide reviews and ratings from other users" %}</label>
</p>
<h6>自定义样式代码 (实验功能)</h6>
<h6>{% trans "custom styles" %}</h6>
<textarea id="user_style"></textarea>
<br>
<input type="button" onclick="save_local();" value="保存">
<input type="button" onclick="save_local();" value="{% trans "Save" %}">
</form>
</details>
<script>
@ -211,15 +208,15 @@
localStorage.setItem("theme_color", _c);
localStorage.setItem("user_style", $("#user_style").val());
localStorage.setItem("solo_mode", $("#solo_mode").prop("checked")?"1":"0");
alert("当前设备设置已保存");
alert("{% trans "Settings for current device saved" %}");
}
</script>
</article>
<article>
<details>
<summary>{% trans '应用管理' %}</summary>
<summary>{% trans 'Applications' %}</summary>
<p>
<a href="{% url 'oauth2_provider:authorized-token-list' %}">查看已授权的应用程序</a>
<a href="{% url 'oauth2_provider:authorized-token-list' %}">{% trans "View authorized applications" %}</a>
</p>
</details>
</article>

View file

@ -5,7 +5,7 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{ site_name }} - {% trans '注册信息' %}</title>
<title>{{ site_name }} - {% trans 'Register' %}</title>
{% include "common_libs.html" %}
</head>
<body>
@ -15,12 +15,11 @@
<img src="{{ site_logo }}" class="logo" alt="logo">
</header>
{% if request.session.new_user %}
<h4>欢迎来到{{ site_name }}{{ request.user.mastodon_acct }}</h4>
<h4>{% trans "Welcome" %}</h4>
<p>
{{ site_name }}还在不断完善中。
丰富的内容需要大家共同创造,试图添加垃圾数据(如添加信息混乱或缺失的书籍、以推广为主要目的的评论)将会受到严肃处理。
本站为非盈利站点cookie和其它数据保管使用原则请参阅<a href="/pages/terms">站内公告</a>
本站提供API和导出功能请妥善备份您的数据使用过程中遇到的问题或者错误欢迎向<a href="{{ support_link }}">维护者</a>提出。感谢理解和支持!
{% blocktrans %}
{{ site_name }} is flourishing because of collaborations and contributions from users like you. Please read our <a href="/pages/terms">term of service</a>, and feel free to <a href="{{ support_link }}">contact us</a> if you have any question or feedback.
{% endblocktrans %}
</p>
{% endif %}
{% if form %}
@ -28,33 +27,27 @@
<small>{{ error }}</small>
<fieldset>
<label>
请输入你想在{{ site_name }}使用的用户名
<input name="username"
placeholder="2-30个字符限英文字母数字下划线确认后不可更改"
value="{{ form.username.value|default:request.user.username|default:'' }}"
required
_="on input remove [@aria-invalid] end"
{% if request.user.username and not form.username.errors %}aria-invalid="false" readonly{% endif %}
{% if form.username.errors %}aria-invalid="true"{% endif %}
pattern="^[a-zA-Z0-9_]{2,30}$" />
{% blocktrans %}Your username on {{ site_name }}{% endblocktrans %}
<input name="username" placeholder="{% trans "2-30 alphabets, numbers or underscore, can't be changed once saved" %}" value="{{ form.username.value|default:request.user.username|default:'' }}" required _="on input remove [@aria-invalid] end" {% if request.user.username and not form.username.errors %}aria-invalid="false" readonly{% endif %} {% if form.username.errors %}aria-invalid="true"{% endif %} pattern="^[a-zA-Z0-9_]{2,30}$" />
{% for error in form.username.errors %}<small>{{ error }}</small>{% endfor %}
</label>
<label>
以及作为备用登录方式的电子邮件地址(推荐)
{% trans "email address (optional if you log in via other Fediverse site, but recommended)" %}
<input type="email"
name="email"
{% if request.user.email and not request.user.mastodon_acct %}readonly{% endif %}
{% if request.user.email %}value="{{ request.user.email }}" aria-invalid="false"{% endif %}
placeholder="设置后请查收邮件点击其中的确认链接"
placeholder="email"
autocomplete="email" />
{% if request.user.pending_email %}
<small>当前待确认的电子邮件地址为{{ request.user.pending_email }},请查收邮件并点击确认链接;如长时间未收到可重新输入并保存。</small>
<small> {% blocktrans pending_email=request.user.pending_email %}Please click the confirmation link in the email sent to {{ pending_email }}; if you haven't received it for more than a few minutes, please input and save again.{% endblocktrans %} </small>
{% endif %}
{% for error in form.email.errors %}<small>{{ error }}</small>{% endfor %}
</label>
</fieldset>
{% csrf_token %}
<input type="submit" value="{% trans '确认并保存' %}">
<input type="submit" value="{% trans 'Confirm and save' %}">
<small>{% trans "Once saved, click the confirmation link in the email you receive" %}</small>
</form>
{% else %}
<form action="{% url 'common:home' %}" method="get">

View file

@ -7,15 +7,17 @@
onclick="navigator.clipboard.writeText(this.innerText);$(this).data('tooltip','copied');">@{{ identity.handle }}</code>
</p>
{% empty %}
<p class="empty">无数据</p>
<p class="empty">{% trans "nothing so far." %}</p>
{% endfor %}
<p>
<span class="action">
<span>
<a id="download_{{ id }}" title="导出列表" download="neodb_{{ id }}.csv"><i class="fa-solid fa-download"></i></a>
<a id="download_{{ id }}"
title="{% trans "export" %}"
download="neodb_{{ id }}.csv"><i class="fa-solid fa-download"></i></a>
</span>
</span>
此处仅列出并可导出你在{{ site_name }}的{{ name }},联邦宇宙{{ name }}列表可在你所属实例查询管理。
{% blocktrans %}You may download {{ name }} on {{ site_name }} here.{% endblocktrans %}
</p>
<script>
let csv = "data:text/csv;charset=utf-8,Account address,Show boosts,Notify on new posts,Languages\n"

View file

@ -5,7 +5,7 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{ site_name }} - {% trans '验证电子邮件' %}</title>
<title>{{ site_name }} - {% trans 'Verify Your Email' %}</title>
{% include "common_libs.html" %}
</head>
<body>
@ -14,15 +14,17 @@
<header style="text-align: center;">
<img src="{{ site_logo }}" class="logo" alt="logo">
</header>
<h4>验证电子邮件</h4>
<h4>{% trans 'Verify Your Email' %}</h4>
{% if success %}
<p>
{{ request.user.email }} 验证成功,<a href="{% url 'common:home' %}">点击这里返回首页</a>
{{ request.user.email }} {% trans "verified successfully." %}
<br>
<a href="{% url 'common:home' %}">{% trans "back to your home page." %}</a>
</p>
{% else %}
<p>
{{ error }}
<a href="{% url 'users:login' %}">点击这里重新登录</a>
<a href="{% url 'users:login' %}">{% trans "login again" %}</a>
</p>
{% endif %}
</article>