This commit is contained in:
Your Name 2024-05-20 23:17:47 -04:00 committed by Henri Dickson
parent 74cdd1e709
commit 463601660f
39 changed files with 945 additions and 586 deletions

View file

@ -366,6 +366,8 @@ AUTHENTICATION_BACKENDS = [
"oauth2_provider.backends.OAuth2Backend",
]
LOG_LEVEL = env("NEODB_LOG_LEVEL", default="DEBUG" if DEBUG else "INFO") # type:ignore
LOGGING = {
"version": 1,
"disable_existing_loggers": False,
@ -375,7 +377,7 @@ LOGGING = {
"loggers": {
"": {
"handlers": ["console"],
"level": env("NEODB_LOG_LEVEL", default="DEBUG" if DEBUG else "INFO"), # type: ignore
"level": LOG_LEVEL,
},
},
}

View file

@ -4,40 +4,41 @@
{% if item %}
<div class="action">
<span>
<a title="编辑条目" href="{% url 'catalog:edit' item.url_path item.uuid %}"><i class="fa-solid fa-pen-to-square"></i></a>
<a title="{% trans "edit" %}"
href="{% url 'catalog:edit' item.url_path item.uuid %}"><i class="fa-solid fa-pen-to-square"></i></a>
</span>
<span>
<a title="编辑历史"
<a title="{% trans "revision history" %}"
href="{% url 'catalog:history' item.url_path item.uuid %}"><i class="fa-solid fa-clock-rotate-left"></i></a>
</span>
<span>
<a title="返回条目" href="{{ item.url }}"><i class="fa-regular fa-file-lines"></i></a>
<a title="{% trans "back to item" %}" href="{{ item.url }}"><i class="fa-regular fa-file-lines"></i></a>
</span>
</div>
<h5>编辑选项</h5>
<h5>{% trans "Edit Options" %}</h5>
{% if item.is_deleted %}
<p>
<i class="fa-solid fa-circle-xmark"></i> 条目已被删除
<i class="fa-solid fa-circle-xmark"></i> {% trans "Item has been deleted." %}
</p>
{% endif %}
{% if item.child_items %}
<p>
<i class="fa-solid fa-circle-exclamation"></i> 条目下已有子项
<i class="fa-solid fa-circle-exclamation"></i> {% trans "Item contains sub-items." %}
</p>
{% endif %}
{% if item.merged_to_item %}
<p>
<i class="fa-solid fa-circle-xmark"></i> 条目已被合并到其他条目
<i class="fa-solid fa-circle-xmark"></i> {% trans "Item has been merged to another item." %}
</p>
{% endif %}
{% if item.journal_exists %}
<p>
<i class="fa-solid fa-circle-exclamation"></i> 条目已被用户标记过
<i class="fa-solid fa-circle-exclamation"></i> {% trans "Item has been marked by users." %}
</p>
{% endif %}
{% for i in item.merged_from_items.all %}
{% if forloop.first %}
<i class="fa-solid fa-circle-info"></i> 以下条目被并入本条目:
<i class="fa-solid fa-circle-info"></i> {% trans "The following items are merged into this item" %}
<ul>
{% endif %}
<li>
@ -49,24 +50,26 @@
{% for res in item.external_resources.all %}
<details>
<summary>
{% trans '源网站' %}: <a href="{{ res.url }}">{{ res.site_label }}</a>
{% trans 'External website' %}: <a href="{{ res.url }}">{{ res.site_label }}</a>
</summary>
<div class="grid">
<form method="post"
action="{% url 'catalog:refetch' %}"
onsubmit="return confirm('现有信息可能会被覆盖。确认重新获取吗?');">
onsubmit="return confirm('{% trans "Existing metadata might get overwritten, sure to proceed?" %}');">
{% csrf_token %}
<input type="hidden" name="id" value="{{ res.id }}">
<input type="hidden" name="url" value="{{ res.url }}">
<input class="secondary" type="submit" value="{% trans '重新获取' %}">
<input class="secondary" type="submit" value="{% trans 'Fetch again' %}">
</form>
{% if request.user.is_staff %}
<form method="post"
action="{% url 'catalog:unlink' %}"
onsubmit="return confirm('本操作不可撤销。确认取消关联吗?');">
onsubmit="return confirm('{% trans "You may not be able to undo this operation, sure to remove?" %}');">
{% csrf_token %}
<input type="hidden" name="id" value="{{ res.id }}">
<input class="contrast" type="submit" value="{% trans '取消关联' %}">
<input class="contrast"
type="submit"
value="{% trans 'Remove link to site' %}">
</form>
{% endif %}
</div>
@ -75,7 +78,7 @@
{% if item.child_class %}
<details>
<summary>
{% trans '编辑下一级条目' %} <small>({{ item.child_items.count }})</small>
{% trans 'Edit sub-items' %} <small>({{ item.child_items.count }})</small>
</summary>
<p class="tag-list" style="overflow: scroll; max-height: 20em;">
{% for ep in item.child_items %}
@ -86,126 +89,132 @@
</p>
<form method="get" action="{% url 'catalog:create' item.child_class %}">
<input name="parent" type="hidden" value="{{ item.uuid }}">
<input class="contrast" type="submit" value="创建{{ item.child_class }}">
<input class="contrast"
type="submit"
value="{% trans "create" %} {{ item.child_class }}">
</form>
</details>
{% endif %}
{% if item.class_name == "tvseason" %}
<details>
<summary>{% trans '批量获取单集条目' %}</summary>
<summary>{% trans 'Fetch all episodes' %}</summary>
{% if item.imdb and item.season_number is not None %}
<form method="post"
action="{% url 'catalog:fetch_tvepisodes' item.url_path item.uuid %}">
{% csrf_token %}
<input class="contrast" type="submit" value="{% trans '开始批量获取' %}">
<small>因豆瓣/IMDB/TMDB之间对分季处理的差异少量剧集和动画可能无法返回正确结果更新后请手工确认和清理。</small>
<input class="contrast" type="submit" value="{% trans 'Fetch all' %}">
<small>{% trans "Due to differences in how Douban, IMDB, and TMDB handle season data, a small number of TV shows and animations may not return correct results. Please manually verify and clean up after updating." %}</small>
</form>
{% else %}
<i><i class="fa-solid fa-circle-exclamation"></i> 批量获取单集子条目需要本季序号和IMDB信息不便填写也可以手工创建子条目。</i>
<i class="fa-solid fa-circle-exclamation"></i> <i>{% trans "To fetch all episodes, season numbers and IMDB information are required. If filling this out is inconvenient, you can also manually create sub-entries." %}</i>
{% endif %}
</details>
{% endif %}
{% if item.class_name == "movie" %}
<details>
<summary>{% trans '切换分类' %}</summary>
<summary>{% trans 'switch category' %}</summary>
<form method="post"
action="{% url 'catalog:recast' item.url_path item.uuid %}"
onsubmit="return confirm('确认切换吗?');">
onsubmit="return confirm('{% trans "Switching may remove some metadata. Sure to proceed?" %}');">
{% csrf_token %}
<input type="hidden" value="tvshow" name="class">
<input class="contrast" type="submit" value="{% trans '更改为剧集' %}">
<input class="contrast" type="submit" value="➡ {% trans 'TV Show' %}">
</form>
</details>
{% elif item.class_name == "tvshow" %}
{% if not item.all_seasons or request.user.is_staff %}
<details>
<summary>{% trans '切换分类' %}</summary>
<summary>{% trans 'switch category' %}</summary>
<form method="post"
action="{% url 'catalog:recast' item.url_path item.uuid %}"
onsubmit="return confirm('确认切换吗?');">
onsubmit="return confirm('Switching may remove some metadata. Sure to proceed?');">
{% csrf_token %}
<input type="hidden" value="movie" name="class">
<input class="contrast" type="submit" value="{% trans '更改为电影' %}">
<input class="contrast" type="submit" value="➡ {% trans 'Movie' %}">
</form>
<form method="post"
action="{% url 'catalog:recast' item.url_path item.uuid %}"
onsubmit="return confirm('确认切换吗?');">
onsubmit="return confirm('Switching may remove some metadata. Sure to proceed?');">
{% csrf_token %}
<input type="hidden" value="tvseason" name="class">
<input class="contrast" type="submit" value="{% trans '更改为单季' %}">
<input class="contrast" type="submit" value="➡ {% trans 'TV Season' %}">
</form>
</details>
{% endif %}
{% elif item.class_name == "album" %}
<details>
<summary>{% trans '切换分类' %}</summary>
<summary>{% trans 'switch category' %}</summary>
<form method="post"
action="{% url 'catalog:recast' item.url_path item.uuid %}"
onsubmit="return confirm('确认切换吗?');">
onsubmit="return confirm('Switching may remove some metadata. Sure to proceed?');">
{% csrf_token %}
<input type="hidden" value="podcast" name="class">
<input class="contrast" type="submit" value="{% trans '更改为播客' %}">
<input class="contrast" type="submit" value="➡ {% trans 'Podcast' %}">
</form>
</details>
{% else %}
<!--此类条目无法切换-->
<!-- no switch possible -->
{% endif %}
{% if item.class_name == "tvseason" or item.class_name == "performanceproduction" %}
<details>
<summary>关联到上一级条目</summary>
<summary>{% trans "link to parent item" %}</summary>
<form method="post"
action="{% url 'catalog:assign_parent' item.url_path item.uuid %}"
onsubmit="return confirm('确认关联吗?');">
onsubmit="return confirm('{% trans "Sure to link?" %}');">
{% csrf_token %}
<input type="url"
name="parent_item_url"
placeholder="目标条目URL留空则取消现有关联"
placeholder=""
value="{{ item.show.absolute_url }}">
<br>
<input class="contrast" type="submit" value="{% trans '更新关联' %}">
<input class="contrast" type="submit" value="{% trans 'Update link' %}">
</form>
</details>
{% endif %}
{% if item.class_name == "tvshow" %}
<details>
<summary>清理单季</summary>
<summary>{% trans "cleanup seasons" %}</summary>
<form method="post"
action="{% url 'catalog:remove_unused_seasons' item.url_path item.uuid %}"
onsubmit="return confirm('本操作不可撤销。确认删除吗?');">
onsubmit="return confirm('{% trans "This operation cannot be undone. Sure to delete?" %}');">
{% csrf_token %}
<input class="contrast" type="submit" value="{% trans '删除未被标记的单季' %}">
<input class="contrast"
type="submit"
value="{% trans 'remove seasons not marked' %}">
</form>
</details>
{% endif %}
{% if not item.journal_exists or request.user.is_staff %}
<details>
<summary>{% trans '合并' %}</summary>
<summary>{% trans 'merge' %}</summary>
<form method="post"
action="{% url 'catalog:merge' item.url_path item.uuid %}">
{% csrf_token %}
<input type="url"
name="target_item_url"
placeholder="目标条目URL留空则取消现有合并"
placeholder="{% trans "URL of target item, or empty if undo merge" %}"
{% if item.is_deleted and not item.merged_to_item %}disabled{% endif %}
value="{{ item.merged_to_item.absolute_url }}">
<br>
<input class="contrast" type="submit" value="{% trans '合并到同类另一条目' %}">
<input class="contrast"
type="submit"
value="{% trans 'merge to another item' %}">
</form>
</details>
{% if item.child_items %}
<!-- 条目下有子项 -->
<!-- contains child items -->
{% elif item.merged_from_items.all %}
<!-- 有其他条目被并入 -->
<!-- merged from other items -->
{% else %}
<details>
<summary>{% trans '删除' %}</summary>
<summary>{% trans 'Delete' %}</summary>
<form method="post"
action="{% url 'catalog:delete' item.url_path item.uuid %}">
{% csrf_token %}
<input class="contrast"
type="submit"
{% if item.is_deleted or item.merged_to_item %}disabled{% endif %}
value="{% trans '删除' %}">
value="{% trans 'delete' %}">
</form>
</details>
{% endif %}
@ -213,27 +222,27 @@
{% if item.class_name == 'edition' %}
{% if item.has_works %}
<details>
<summary>{% trans '著作' %}</summary>
这个图书版本属于以下著作
<summary>{% trans 'Work' %}</summary>
{% trans "This edition belongs to the following work" %}
{% for i in item.works.all %}
<li>
<a href="{{ i.url }}?skipcheck=1">{{ i.title }}</a>
</li>
{% endfor %}
<form method="post"
onsubmit="return confirm('本操作不可撤销。确认吗?');"
onsubmit="return confirm('{% trans "Sure to unlink?" %}');"
action="{% url 'catalog:unlink_works' item.url_path item.uuid %}">
{% csrf_token %}
<input class="contrast"
type="submit"
{% if not request.user.is_staff %}disabled{% endif %}
value="{% trans '取消关联到上述著作' %}">
value="{% trans 'Unlink from work' %}">
</form>
</details>
{% endif %}
{% if not item.has_works %}
<details>
<summary>{% trans '关联' %}</summary>
<summary>{% trans 'Link' %}</summary>
<form method="post"
action="{% url 'catalog:link_edition' item.url_path item.uuid %}">
{% csrf_token %}
@ -242,29 +251,33 @@
placeholder="{{ site_url }}/book/1234/
{% if item.is_deleted and not item.merged_to_item %}disabled{% endif %}
value="">
<input class="contrast" type="submit" value="{% trans '关联到同一著作的另一本书' %}">
<input class="contrast"
type="submit"
value="{% trans 'Link to another edition from same work' %}">
</form>
</details>
{% endif %}
{% endif %}
{% endif %}
<details>
<summary>{% trans '修改建议' %}</summary>
<summary>{% trans 'Suggest Edits' %}</summary>
<form method="post"
action="{% url 'catalog:suggest' item.url_path item.uuid %}">
{% csrf_token %}
<select name="action" aria-label="Select action..." required>
<option selected disabled value="">请选择建议类型...</option>
<option value="merge">合并到其它条目</option>
<option value="link">关联到其它条目</option>
<option value="type">更改条目类型</option>
<option value="metadata">更正条目信息</option>
<option value="delete">删除条目</option>
<option value="other">其它修改</option>
<option selected disabled value="">{% trans "proposed action" %}</option>
<option value="merge">{% trans "merge to another item" %}</option>
<option value="link">{% trans "link to another item" %}</option>
<option value="type">{% trans "change item category" %}</option>
<option value="metadata">{% trans "change item metadata" %}</option>
<option value="delete">{% trans "remove item" %}</option>
<option value="other">{% trans "other" %}</option>
</select>
<textarea name="detail" required placeholder="建议详情。如提议合并或关联,请包含目标条目网址。"></textarea>
<input type="submit" value="{% trans '提交' %}">
<small>本站由用户共同维护,用户可自主修改部分条目信息。当你不确定自己的修改是否得当或不能做出某种修改时,可在此处向管理员提出建议。管理员会认真考虑处理每一条建议,虽然不保证总是完全采纳;建议也可能被社区其他用户查看或讨论。如果有与具体条目不相关的建议,请访问讨论区或联系我们的社交账号。感谢你的支持和贡献。</small>
<textarea name="detail"
required
placeholder="{% trans "To suggest merging or association, please include the URL of the target item" %}"></textarea>
<input type="submit" value="{% trans 'submit' %}">
<small>{% trans "As a user of this community, you may edit some metadata of items on this site. If you are unsure whether your edits are appropriate or are unable to make a certain change, you can make suggestions here. Moderators will consider each suggestion, although there is no guarantee that they will always be fully adopted; suggestions may also be viewed or discussed by other community users. If you have suggestions that are not related to a specific item, please contact us. Thank you for your support and contribution." %}</small>
</form>
</details>
{% endif %}

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 'Confirmation' %}</title>
<title>{{ site_name }} - {% trans 'Delete' %}</title>
{% include "common_libs.html" %}
{% if url %}<meta http-equiv="refresh" content="3;url={{ url }}">{% endif %}
</head>
@ -20,28 +20,28 @@
<article class="item-card deleting">{% include "_item_card.html" with item=item %}</article>
{% if item.is_deleted %}
<p>
<i class="fa-solid fa-circle-xmark"></i> 条目已被删除
<i class="fa-solid fa-circle-xmark"></i> {% trans "Item has been deleted." %}
</p>
{% endif %}
{% if item.child_items %}
<p>
<i class="fa-solid fa-circle-exclamation"></i> 条目下已有子项
<i class="fa-solid fa-circle-exclamation"></i> {% trans "Item contains sub-items." %}
</p>
{% endif %}
{% if item.merged_to_item %}
<p>
<i class="fa-solid fa-circle-xmark"></i> 条目已被合并到其他条目
<i class="fa-solid fa-circle-xmark"></i> {% trans "Item has been merged to another item." %}
</p>
{% endif %}
{% if item.journal_exists %}
<p>
<i class="fa-solid fa-circle-exclamation"></i> 条目已被用户标记过
<i class="fa-solid fa-circle-exclamation"></i> {% trans "Item has been marked by users." %}
</p>
{% endif %}
</div>
<form method="post"
action="{% url 'catalog:delete' item.url_path item.uuid %}"
onsubmit="return confirm('本操作不可撤销。确认吗?');">
onsubmit="return confirm('{% trans "This operation cannot be undone. Sure to delete?" %}');">
{% csrf_token %}
<input type="hidden" name="sure" value="1">
<input type="submit" value="{% trans 'Yes' %}">

View file

@ -8,9 +8,9 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{ site_name }} -
{% if form.instance.id %}
{% trans '编辑' %} {{ form.instance.title }}
{% trans 'Edit' %} {{ form.instance.title }}
{% else %}
{% trans '添加条目' %}
{% trans 'Create' %}
{% endif %}
</title>
{% include "common_libs.html" %}
@ -33,8 +33,12 @@
{% include "_header.html" %}
<main>
<div class="grid__main">
{% if item.is_deleted %}<i>条目已被删除</i>{% endif %}
{% if item.merged_to_item %}<i>条目已被合并</i>{% endif %}
{% if item.is_deleted %}
<i>{% trans "Item has been deleted." %}</i>
{% endif %}
{% if item.merged_to_item %}
<i>{% trans "Item contains sub-items." %}</i>
{% endif %}
<form method="post"
enctype="multipart/form-data"
_=" init set .rjf-add-button's innerHTML to '' end">
@ -43,10 +47,10 @@
{{ form }}
<div class="grid">
{% if not item or item.editable or request.user.is_staff %}
<input type="submit" value="{% trans '保存' %}">
<input type="submit" value="{% trans 'Save' %}">
{% endif %}
<input type="reset"
value="{% trans '返回' %}"
value="{% trans 'Cancel' %}"
onclick="{% if item %}window.location='{{ item.url }}'{% else %}history.go(-1){% endif %}">
</div>
</form>

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 'Confirmation' %}</title>
<title>{{ site_name }} - {% trans 'Merge' %}</title>
{% include "common_libs.html" %}
{% if url %}<meta http-equiv="refresh" content="3;url={{ url }}">{% endif %}
</head>
@ -32,22 +32,22 @@
</article>
{% if item.is_deleted %}
<p>
<i class="fa-solid fa-circle-xmark"></i> 条目已被删除
<i class="fa-solid fa-circle-xmark"></i> {% trans "Item has been deleted." %}
</p>
{% endif %}
{% if item.child_items %}
<p>
<i class="fa-solid fa-circle-exclamation"></i> 条目下已有子项
<i class="fa-solid fa-circle-exclamation"></i> {% trans "Item contains sub-items." %}
</p>
{% endif %}
{% if item.merged_to_item %}
<p>
<i class="fa-solid fa-circle-xmark"></i> 条目已被合并到其他条目
<i class="fa-solid fa-circle-xmark"></i> {% trans "Item has been merged to another item." %}
</p>
{% endif %}
{% if item.journal_exists %}
<p>
<i class="fa-solid fa-circle-exclamation"></i> 条目已被用户标记过
<i class="fa-solid fa-circle-exclamation"></i> {% trans "Item has been marked by users." %}
</p>
{% endif %}
{% if new_item %}
@ -60,29 +60,29 @@
<article class="item-card">{% include "_item_card.html" with item=new_item %}</article>
{% if new_item.is_deleted %}
<p>
<i class="fa-solid fa-circle-xmark"></i> 条目已被删除
<i class="fa-solid fa-circle-xmark"></i> {% trans "Item has been deleted." %}
</p>
{% endif %}
{% if new_item.child_items %}
<p>
<i class="fa-solid fa-circle-exclamation"></i> 条目下已有子项
<i class="fa-solid fa-circle-exclamation"></i> {% trans "Item contains sub-items." %}
</p>
{% endif %}
{% if new_item.merged_to_item %}
<p>
<i class="fa-solid fa-circle-xmark"></i> 条目已被合并到其他条目
<i class="fa-solid fa-circle-xmark"></i> {% trans "Item has been merged to another item." %}
</p>
{% endif %}
{% if new_item.journal_exists %}
<p>
<i class="fa-solid fa-circle-exclamation"></i> 条目已被用户标记过
<i class="fa-solid fa-circle-exclamation"></i> {% trans "Item has been marked by users." %}
</p>
{% endif %}
{% endif %}
</div>
<form method="post"
{% if mode == "merge" %} action="{% url 'catalog:merge' item.url_path item.uuid %}" {% elif mode == "link" %} action="{% url 'catalog:link_edition' item.url_path item.uuid %}" {% endif %}
onsubmit="return confirm('本操作不可撤销。确认吗?');">
onsubmit="return confirm('{% trans "This operation cannot be undone. Sure to merge?" %}');">
{% csrf_token %}
<input type="hidden"
name="target_item_url"

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 }} - {{ item.title }}{% trans '的标记' %}</title>
<title>{{ site_name }} - {{ item.display_title }} - {% trans 'Marks' %}</title>
{% include "common_libs.html" %}
</head>
<body>
@ -18,13 +18,13 @@
<div class="grid__main">
<h5>
{% if followeing_only %}
<a href="{% url 'catalog:mark_list' item.url_path item.uuid %}">{% trans '全部标记' %}</a>
| {% trans '好友标记' %}
<a href="{% url 'catalog:mark_list' item.url_path item.uuid %}">{% trans 'marks' %}</a>
| {% trans 'marks from who you follow' %}
{% else %}
{% trans '全部标记' %}
| <a href="{% url 'catalog:mark_list' item.url_path item.uuid 'following' %}">{% trans '好友标记' %}</a>
{% trans 'marks' %}
| <a href="{% url 'catalog:mark_list' item.url_path item.uuid 'following' %}">{% trans 'marks from who you follow' %}</a>
{% endif %}
| <a href="{% url 'catalog:review_list' item.url_path item.uuid %}">{% trans '全部评论' %}</a>
| <a href="{% url 'catalog:review_list' item.url_path item.uuid %}">{% trans 'reviews' %}</a>
</h5>
{% for member in marks %}
{% with member.mark as mark %}
@ -51,7 +51,7 @@
</section>
{% endwith %}
{% empty %}
<div>{% trans '暂无标记' %}</div>
<div>{% trans 'nothing so far.' %}</div>
{% endfor %}
{% include "_pagination.html" %}
</div>

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 }} - {{ item.title }}{% trans '的评论' %}</title>
<title>{{ site_name }} - {{ item.display_title }} - {% trans 'Reviews' %}</title>
{% include "common_libs.html" %}
</head>
<body>
@ -17,9 +17,9 @@
<main>
<div class="grid__main">
<h5>
<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>
| {% trans '全部评论' %}
<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>
| {% trans 'reviews' %}
</h5>
{% for review in reviews %}
<section>
@ -47,7 +47,7 @@
<div class="tldr">{{ review.plain_content }}</div>
</section>
{% empty %}
<div>{% trans '暂无评论' %}</div>
<div>{% trans 'nothing so far.' %}</div>
{% endfor %}
{% include "_pagination.html" %}
</div>

View file

@ -30,7 +30,7 @@
<div>{% include '_crew.html' with people=item.crew_by_role role='crew' max=10 %}</div>
<div>
{% if item.official_site %}
{% trans 'website' %} <span>{{ item.official_site|urlizetrunc:24 }}</span>
{% trans 'website' %}: <span>{{ item.official_site|urlizetrunc:24 }}</span>
{% endif %}
</div>
{% endblock %}

View file

@ -30,7 +30,7 @@
<div>{% include '_crew.html' with people=item.crew role='crew' max=50 %}</div>
<div>
{% if item.official_site %}
{% trans 'website' %} <span>{{ item.official_site|urlizetrunc:24 }}</span>
{% trans 'website' %}: <span>{{ item.official_site|urlizetrunc:24 }}</span>
{% endif %}
</div>
{% endblock %}

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 'Search Results' %} {{ request.GET.q }}</title>
<title>{{ site_name }} - {{ request.GET.q }} - {% trans 'Search Results' %}</title>
{% include "common_libs.html" %}
</head>
<body>
@ -88,16 +88,17 @@
{% include '_list_item.html' with show_tags=1 %}
{% empty %}
<p>
无站内条目匹配。
{% if request.user.is_authenticated %}系统会尝试搜索其它网站的条目,点击标题可添加到本站。{% endif %}
{% trans "No items matching your search query." %}
{% if request.user.is_authenticated %}
{% trans "System will search other websites and instances, click title of the item to save them locally. " %}
{% endif %}
</p>
<p>
如果你在
{% blocktrans %}If you have URL from one of these sites, please put the full URL (e.g. <code>https://www.imdb.com/title/tt2513074/</code>) to the search box and press Enter.{% endblocktrans %}
{% for site in sites %}
{{ site }}
{{ trans site }}
{% if not forloop.last %}/{% endif %}
{% endfor %}
找到了相关条目,也可以把链接(如 <code>https://movie.douban.com/subject/1309046/</code> )输入到搜索栏中提交保存到本站。
</p>
{% endfor %}
</div>

View file

@ -77,6 +77,6 @@
{% 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

@ -72,6 +72,6 @@
{% 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

@ -13,7 +13,7 @@
href="https://github.com/neodb-social">{% trans 'Source Code' %}</a>
</div>
<div class="hide_unless_alter_domain" style="padding-top: 1em;">
这是{{ site_name }}的临时镜像,请尽可能使用<a href="{{ site_url }}{{ request.get_full_path }}">原始站点</a>
{% blocktrans %}You are visiting an alternative domain for {{ site_name }}, please always use <a href="{{ site_url }}{{ request.get_full_path }}">original version</a> if possible.{% endblocktrans %}
</div>
</footer>
<div class="player"></div>

View file

@ -114,7 +114,7 @@
{% if request.user.is_authenticated and not request.user.mastodon_username and not request.user.username %}
<ul class="messages" style="text-align:center">
<li class="error">
<a href="{% url 'users:info' %}">设置用户名</a>
<a href="{% url 'users:info' %}">{% trans "Set a username." %}</a>
</li>
</ul>
{% endif %}

View file

@ -10,11 +10,13 @@
<section class="announcement">
<article>
<details open>
<summary>未读公告</summary>
<summary>{% trans "Unread Announcements" %}</summary>
{% for ann in request.user.unread_announcements %}<div>{{ ann.html }}</div>{% endfor %}
<form action="{% url 'users:mark_announcements_read' %}" method="post">
{% csrf_token %}
<input type="submit" class="secondary outline" value="{% trans '全部标为已读' %}">
<input type="submit"
class="secondary outline"
value="{% trans 'mark all as read' %}">
</form>
</details>
</article>
@ -46,7 +48,7 @@
{% if identity.user == request.user %}
{% if identity.locked %}
<span>
<a title="你已开启关注审核">
<a title="{% trans "approving followers manually" %}">
<i class="fa-solid fa-user-shield"></i>
</a>
</span>
@ -76,7 +78,7 @@
<section>
<article>
<details {% if identity.featured_collections.all %}open{% endif %}>
<summary>{% trans '当前目标' %}</summary>
<summary>{% trans 'Current Targets' %}</summary>
{% for featured_collection in identity.featured_collections.all %}
{% user_visibility_of featured_collection as visible %}
{% if visible %}
@ -89,9 +91,9 @@
{% endif %}
{% empty %}
{% if request.user == identity.user %}
<div class="empty">将自己或他人的收藏单设为目标,这里就会显示进度</div>
<div class="empty">{% trans "Set a collection as target, its progress will show up here." %}</div>
{% else %}
<div class="empty">暂未设置目标</div>
<div class="empty">{% trans "nothing so far." %}</div>
{% endif %}
{% endfor %}
</details>
@ -102,7 +104,7 @@
<section>
<article>
<details class="auto-collapse" open>
<summary>{% trans '在听播客的近期单集' %}</summary>
<summary>{% trans 'Recent podcast episodes' %}</summary>
<div class="shelf">
<ul class="cards">
{% for item in recent_podcast_episodes %}
@ -137,7 +139,7 @@
<section>
<article>
<details class="auto-collapse" open>
<summary>{% trans '在读的书' %}</summary>
<summary>{% trans 'Currently reading' %}</summary>
<div class="shelf">
<ul class="cards">
{% for item in books_in_progress %}
@ -160,7 +162,7 @@
<section>
<article>
<details class="auto-collapse" open>
<summary>{% trans '在看的剧集' %}</summary>
<summary>{% trans 'Currently watching' %}</summary>
<div class="shelf">
<ul class="cards">
{% for item in tvshows_in_progress %}
@ -183,7 +185,7 @@
<section>
<article>
<details {% if top_tags %}class="auto-collapse" open{% endif %}>
<summary>{% trans '常用标签' %}</summary>
<summary>{% trans 'Common Tags' %}</summary>
<div class="tag-list">
{% for t in top_tags %}
<span>
@ -191,12 +193,12 @@
<small>({{ t.total }})</small>
</span>
{% empty %}
<div class="empty">暂无可见标签</div>
<div class="empty">{% trans "nothing so far." %}</div>
{% endfor %}
</div>
<small>
{% if top_tags %}
<a href="{% url 'journal:user_tag_list' identity.user.handler %}">...{% trans '全部' %}</a>
<a href="{% url 'journal:user_tag_list' identity.user.handler %}">...{% trans 'show more' %}</a>
{% endif %}
</small>
</details>
@ -211,7 +213,7 @@
<form action="{% url 'hijack:acquire' %}" method="post">
{% csrf_token %}
<input type="hidden" name="user_pk" value="{{ identity.user.pk }}">
<button type="submit">View as them</button>
<button type="submit">Debug as them</button>
<button _="on click hide .hijacker then halt default">Hide</button>
<input type="hidden" name="next" value="{{ request.path }}">
</form>

View file

@ -16,9 +16,9 @@
<main class="container">
<article>
<header>
<h3>验证邮件已发送</h3>
<h3>{% trans "Verification email is being sent, please check your inbox." %}</h3>
</header>
请点击邮件中的登录链接,或输入收到的验证码:
{% trans "Please click the login link in the email, or enter the verification code you received." %}
<style type="text/css">
.otp input {
font-family: monospace;
@ -39,7 +39,7 @@
pattern="^[a-zA-Z0-9]{5}$" />
<small>{{ error }}</small>
</div>
<input type="submit" value="提交" />
<input type="submit" value="Submit" />
{% csrf_token %}
</form>
</article>

View file

@ -163,7 +163,7 @@ services:
neodb-web:
<<: *neodb-service
command: ${NEODB_VENV:-/neodb-venv}/bin/gunicorn boofilsic.wsgi -w ${NEODB_WEB_WORKER_NUM:-8} --preload --max-requests 2000 -b 0.0.0.0:8000
command: ${NEODB_VENV:-/neodb-venv}/bin/gunicorn boofilsic.wsgi -w ${NEODB_WEB_WORKER_NUM:-8} --preload --max-requests 2000 --timeout 90 -b 0.0.0.0:8000
healthcheck:
test: ['CMD', 'wget', '-qO/tmp/test', '--header', 'X-Forwarded-Proto: https', 'http://127.0.0.1:8000/nodeinfo/2.0/']
depends_on:
@ -172,7 +172,7 @@ services:
neodb-web-api:
<<: *neodb-service
command: ${NEODB_VENV:-/neodb-venv}/bin/gunicorn boofilsic.wsgi -w ${NEODB_API_WORKER_NUM:-4} --preload --max-requests 2000 -b 0.0.0.0:8000
command: ${NEODB_VENV:-/neodb-venv}/bin/gunicorn boofilsic.wsgi -w ${NEODB_API_WORKER_NUM:-4} --preload --max-requests 2000 --timeout 90 -b 0.0.0.0:8000
healthcheck:
test: ['CMD', 'wget', '-qO/tmp/test', '--header', 'X-Forwarded-Proto: https', 'http://127.0.0.1:8000/nodeinfo/2.0/']
depends_on:
@ -195,7 +195,7 @@ services:
takahe-web:
<<: *neodb-service
command: ${TAKAHE_VENV:-/takahe-venv}/bin/gunicorn --chdir /takahe takahe.wsgi -w ${TAKAHE_WEB_WORKER_NUM:-8} --max-requests 2000 --preload -b 0.0.0.0:8000
command: ${TAKAHE_VENV:-/takahe-venv}/bin/gunicorn --chdir /takahe takahe.wsgi -w ${TAKAHE_WEB_WORKER_NUM:-8} --max-requests 2000 --timeout 90 --preload -b 0.0.0.0:8000
healthcheck:
test: ['CMD', 'wget', '-qO/tmp/test', '--header', 'X-Forwarded-Proto: https', 'http://127.0.0.1:8000/api/v1/instance']
depends_on:
@ -245,7 +245,8 @@ services:
dev-neodb-worker:
<<: *dev-neodb-service
command: neodb-manage rqworker --with-scheduler import export mastodon fetch crawl ap cron
command: neodb-manage rqworker-pool --num-workers 4 import export mastodon fetch crawl ap cron
# command: neodb-manage rqworker --with-scheduler import export mastodon fetch crawl ap cron
dev-takahe-web:
<<: *dev-neodb-service

View file

@ -7,12 +7,13 @@
</form>
{% if featured %}
<a class="activated"
title="停止追踪目标"
onclick="if (confirm('停止这个目标吗?')) $('#feature-form').submit();">
title="{% trans "stop tracking" %}"
onclick="if (confirm('{% trans "Stop tracking this target?" %}')) $('#feature-form').submit();">
<i class="fa-solid fa-circle-dot"></i>
</a>
{% else %}
<a title="设为目标" onclick="$('#feature-form').submit()">
<a title="{% trans "set as target" %}"
onclick="$('#feature-form').submit()">
<i class="fa-regular fa-circle-dot"></i>
</a>
{% endif %}

View file

@ -9,7 +9,7 @@
<span class="action">
{% if collection_edit %}
<span>
<a title="从收藏单中删除条目"
<a title="{% trans "Remove from collection" %}"
hx-target="#collection_items"
hx-post="{% url 'journal:collection_remove_item' collection.uuid item.uuid %}">
<i class="fa-solid fa-square-minus"></i>
@ -19,7 +19,7 @@
{% wish_item_action item as action %}
<span>
{% if not action.taken %}
<a title="添加标记"
<a title="{% trans "add mark" %}"
hx-get="{% url 'journal:mark' item.uuid %}?shelf_type=wishlist"
hx-target="body"
hx-swap="beforeend">
@ -27,7 +27,7 @@
</a>
{% else %}
<a class="activated"
title="修改标记"
title="{% trans "update mark" %}"
hx-get="{% url 'journal:mark' item.uuid %}"
hx-target="body"
hx-swap="beforeend">
@ -85,7 +85,7 @@
<p hx-target="this" hx-swap="innerHTML">
{% if collection_edit %}
<span class="action">
<a title="修改备注"
<a title="{% trans "Update note" %}"
hx-get="{% url 'journal:collection_update_item_note' collection.uuid item.uuid %}"><i class="fa-regular fa-pen-to-square"></i></a>
</span>
{% endif %}

View file

@ -2,8 +2,8 @@
<form hx-post="{% url 'journal:collection_update_item_note' collection.uuid item.uuid %}"
hx-target="#collection_items">
<input name="note" value="{{ note }}">
<input type="submit" style="width:unset;" value="修改">
<input type="submit" style="width:unset;" value="{% trans "Update" %}">
<button style="width:unset"
hx-get="{% url 'journal:collection_retrieve_items' collection.uuid %}?edit=1"
hx-target="#collection_items">取消</button>
hx-target="#collection_items">{% trans "Cancel" %}</button>
</form>

View file

@ -14,7 +14,7 @@
aria-label="Close"
class="close"
_="on click trigger close_dialog" />
<strong>标记 {{ item.title }}</strong>
<strong>{% trans "Mark" %} - {{ item.title }}</strong>
</header>
<div>
<form method="post" action="{% url 'journal:mark' item.uuid %}">
@ -40,15 +40,15 @@
<div>
<span class="rating-editor {% if shelf_type == 'wishlist' %}hidden{% endif %}" _="on mousemove(currentTarget, offsetX) set current_value to Math.round((10 * offsetX) / currentTarget.offsetWidth) if current_value <=10 then set star_div to the
<div/>
in me set star_div.style.width to (current_value * 10) + '%' set @data-tooltip to current_value or '未评分' add .yellow to star_div end on click(currentTarget, offsetX) set current_value to Math.round((10 * offsetX) / currentTarget.offsetWidth) if current_value <=10 then set star_div to the
in me set star_div.style.width to (current_value * 10) + '%' set @data-tooltip to current_value or '{% trans "not rated" %}' add .yellow to star_div end on click(currentTarget, offsetX) set current_value to Math.round((10 * offsetX) / currentTarget.offsetWidth) if current_value <=10 then set star_div to the
<div/>
in me set star_input to the
<input/>
in me set star_div.style.width to (current_value * 10) + '%' set @data-tooltip to current_value or '未评分' set star_input.value to current_value end on mouseleave(currentTarget) set star_div to the
in me set star_div.style.width to (current_value * 10) + '%' set @data-tooltip to current_value or '{% trans "not rated" %}' set star_input.value to current_value end on mouseleave(currentTarget) set star_div to the
<div/>
in me set star_input to the
<input/>
in me set current_value to star_input.value set star_div.style.width to (current_value * 10) + '%' set @data-tooltip to current_value or '未评分' end">
in me set current_value to star_input.value set star_div.style.width to (current_value * 10) + '%' set @data-tooltip to current_value or '{% trans "not rated" %}' end">
{{ mark.rating_grade|rating_star }}
<input type="hidden"
name="rating_grade"
@ -63,7 +63,7 @@
<textarea name="text"
rows="5"
autofocus
placeholder="提示: 善用 &gt;!文字!&lt; 标记可隐藏剧透; 超过360字可能无法分享到联邦宇宙实例时间轴。"
placeholder="{% trans "Tips: use &gt;!text!&lt; for spoilers; some instances may not be able to show posts longer than 360 charactors." %}"
id="id_text">{{ mark.comment_text|default:"" }}</textarea>
</fieldset>
</div>
@ -71,7 +71,7 @@
<div class="tag-input">
<input name="tags"
type="text"
placeholder="回车增加标签"
placeholder="{% trans "add a tag and press Enter" %}"
id="tags_input"
data-initial-value="{{ tags }}">
</div>
@ -85,21 +85,21 @@
required
id="id_visibility_0"
{% if mark.visibility == 0 %}checked{% endif %}>
<label for="id_visibility_0">公开</label>
<label for="id_visibility_0">{% trans "Public" %}</label>
<input type="radio"
name="visibility"
value="1"
required
id="id_visibility_1"
{% if mark.visibility == 1 %}checked{% endif %}>
<label for="id_visibility_1">仅关注者</label>
<label for="id_visibility_1">{% trans "Followers Only" %}</label>
<input type="radio"
name="visibility"
value="2"
required
id="id_visibility_2"
{% if mark.visibility == 2 %}checked{% endif %}>
<label for="id_visibility_2">仅自己</label>
<label for="id_visibility_2">{% trans "Mentioned Only" %}</label>
</fieldset>
</div>
<div>
@ -112,7 +112,7 @@
id="id_share_to_mastodon"
value="1"
{% if request.user.preference.mastodon_default_repost %}checked{% endif %}>
转发到<em data-tooltip="@{{ request.user.mastodon_acct }}">主ID</em>时间轴
{% trans "Repost to your timeline" %}
</label>
{% endif %}
</fieldset>
@ -127,7 +127,7 @@
name="mark_anotherday"
value="1"
id="mark_anotherday">
<label for="mark_anotherday">更改日期:</label>
<label for="mark_anotherday">{% trans "change mark date" %}</label>
<input class="invisible"
type="date"
name="mark_date"
@ -139,7 +139,7 @@
</div>
<div>
<fieldset>
<input type="submit" value="保存">
<input type="submit" value="{% trans "Save" %}">
</fieldset>
</div>
</div>
@ -152,7 +152,10 @@
{% csrf_token %}
<input type="hidden" name="delete" value="1">
<a>
<button class="secondary" onclick="return confirm('确认删除这条标记、短评和标签?')">删除标记</button>
<button class="secondary"
onclick="return confirm('{% trans "Sure to delete mark, comment and tags for this item?" %}')">
{% trans "Delete" %}
</button>
</a>
</form>
{% endif %}

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 }} - {% trans '确认删除' %}</title>
<title>{{ site_name }} - {% trans 'Delete' %}</title>
{% include "common_libs.html" %}
</head>
<body>
@ -14,7 +14,7 @@
<main class="container">
<article>
<header>
<h5>{% trans '确认删除' %}</h5>
<h5>{% trans 'Are you sure to delete?' %}</h5>
</header>
<div>
<h6>{{ piece.title }}</h6>
@ -25,11 +25,11 @@
<footer>
<form action="?return_url={{ return_url }}" method="post" role="group">
{% csrf_token %}
<input type="submit" value="{% trans '确认' %}">
<input type="submit" value="{% trans 'Yes' %}">
<input type="reset"
onclick="history.back()"
class="secondary"
value="{% trans '取消' %}">
value="{% trans 'No' %}">
</form>
</footer>
</article>

View file

@ -148,7 +148,7 @@
</a>
</li>
{% empty %}
<div>暂无记录</div>
<div>{% trans "nothing so far." %}</div>
{% endfor %}
</ul>
</section>

View file

@ -11,7 +11,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="CCBot" content="nofollow">
<meta property="og:title"
content="{{ site_name }} - {{ review.title }} ({{ review.item.title }} {% trans '评论' %})">
content="{{ site_name }} {% trans 'Review' %} - {{ review.title }} ({{ review.item.display_title }})">
<meta property="og:type" content="article">
<meta property="og:article:author"
content="{{ review.owner.display_name }}">
@ -19,7 +19,7 @@
<meta property="og:image" content="{{ review.item.cover|thumb:'normal' }}">
<meta property="og:site_name" content="{{ site_name }}">
{% if not identity.anonymous_viewable %}<meta name="robots" content="noindex">{% endif %}
<title>{{ site_name }}{% trans '评论' %} - {{ review.title }}</title>
<title>{{ site_name }} {% trans 'Review' %} - {{ review.title }}</title>
{% include "common_libs.html" %}
</head>
<body>
@ -49,8 +49,7 @@
<a href="{{ review.owner.url }}">{{ review.owner.display_name }}</a>
<span class="handler">@{{ review.owner.handle }}</span>
<br>
评论
<a href="{{ review.item.url }}">{{ review.item.title }}</a>
<a href="{{ review.item.url }}">{{ review.item.display_title }}</a> - {% trans 'Review' %}
{% if review.rating_grade %}{{ review.rating_grade | rating_star }}{% endif %}
</div>
</div>
@ -60,7 +59,7 @@
{{ review.html_content | safe }}
{% else %}
<p class="empty">
<span>作者已设置仅限<a href="{% url 'users:login' %}?next={{ request.path }}">登录</a>用户查看</span>
<span>{% trans "The author has set it to be viewable only by logged-in users." %}</span>
</p>
{% endif %}
</div>
@ -73,15 +72,15 @@
hx-trigger="click once"
hx-target="#replies_{{ review.latest_post.pk }}">
{{ review.latest_post.stats.replies | default:'' }}
回应
{% trans "reply" %}
</a>
</span>
{% if request.user.identity == review.owner %}
<span>
<a href="{% url 'journal:review_edit' review.item.uuid review.uuid %}">{% trans '编辑' %}</a>
<a href="{% url 'journal:review_edit' review.item.uuid review.uuid %}">{% trans 'Edit' %}</a>
</span>
<span>
<a href="{% url 'journal:review_delete' review.uuid %}">{% trans '删除' %}</a>
<a href="{% url 'journal:review_delete' review.uuid %}">{% trans 'Delete' %}</a>
</span>
{% endif %}
</span>
@ -92,7 +91,7 @@
rel="noopener"
href="{{ review.shared_link }}"
onclick="navigator.share({url:'{{ review.shared_link |escapejs }}'});event.preventDefault();"
title="联邦宇宙分享链接"><i class="fa-solid {% if review.visibility > 0 %} fa-lock {% else %} fa-globe {% endif %}"></i></a>
title="{% trans "link for fediverse" %}"><i class="fa-solid {% if review.visibility > 0 %} fa-lock {% else %} fa-globe {% endif %}"></i></a>
</span>
<span><a>{{ review.created_time|date }}</a></span>
</span>

View file

@ -22,7 +22,7 @@
{% for member in members %}
{% include "_list_item.html" with item=member.item mark=member.mark hide_category=True %}
{% empty %}
<div>{% trans '暂无匹配的条目' %}</div>
<div>{% trans 'nothing so far.' %}</div>
{% endfor %}
</div>
{% include "_pagination.html" %}

View file

@ -1,10 +1,10 @@
{% extends 'user_item_list_base.html' %}
{% load i18n %}
{% block title %}
<title>{{ site_name }} - {{ identity.display_name }} - {% trans '标记' %}</title>
<title>{{ site_name }} - {{ identity.display_name }} - {% trans 'Marks' %}</title>
{% endblock %}
{% block head %}
{{ identity.display_name }} - {% trans '标记' %}
{{ identity.display_name }} - {% trans 'Marks' %}
{% endblock %}
{% block sidebar %}
{% include "_sidebar.html" with show_profile=1 sidebar_template="_sidebar_user_mark_list.html" %}

View file

@ -1,10 +1,10 @@
{% extends "user_item_list_base.html" %}
{% load i18n %}
{% block title %}
<title>{{ site_name }} - {{ identity.display_name }} - {% trans '评论' %}</title>
<title>{{ site_name }} - {{ identity.display_name }} - {% trans 'Reviews' %}</title>
{% endblock %}
{% block head %}
{{ identity.display_name }} - {% trans '评论' %}
{{ identity.display_name }} - {% trans 'Review' %}
{% endblock %}
{% block sidebar %}
{% include "_sidebar.html" with show_profile=1 sidebar_template="_sidebar_user_mark_list.html" %}

View file

@ -9,14 +9,14 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{ site_name }} - {{ identity.display_name }} 的标签</title>
<title>{{ site_name }} - {{ identity.display_name }} - {% trans "Tags" %}</title>
{% include "common_libs.html" %}
</head>
<body>
{% include "_header.html" %}
<main>
<div class="grid__main">
<h5>{% trans '全部标签' %}</h5>
<h5>{% trans 'All Tags' %}</h5>
<div class="tag-list">
{% for v in tags %}
<span style="margin-right:2em; white-space: nowrap;">
@ -26,7 +26,7 @@
<span>({{ v.total }})</span>
</span>
{% empty %}
{% trans '暂无标签' %}
{% trans 'nothing so far.' %}
{% endfor %}
</div>
</div>

View file

@ -1,14 +1,17 @@
{% extends "user_item_list_base.html" %}
{% load i18n %}
{% block title %}
<title>{{ site_name }} - {{ identity.display_name }} - {{ tag.title }} {% trans '标签' %}</title>
<title>{{ site_name }} - {{ identity.display_name }} - {% trans 'Tags' %} - {{ tag.title }}</title>
{% endblock %}
{% block head %}
{{ tag.title }}
<br>
<small>
{% if tag.visibility > 0 %}<i class="fa-solid fa-user" title="个人标签"></i>{% endif %}
{{ identity.display_name }}的{% trans '标签' %}
{% if tag.visibility > 0 %}
<i class="fa-solid fa-user" title="{% trans "private tag" %}"></i>
{% endif %}
个人标签
{{ identity.display_name }} - {% trans 'Tags' %}
{% if identity.user == request.user %}
<form style="display:inline"
hx-get="{% url 'journal:user_tag_edit' %}"

View file

@ -13,7 +13,7 @@
aria-label="Close"
class="close"
_="on click trigger close_dialog" />
<strong>分享年度统计图</strong>
<strong>{% trans "Share Annual Summary" %}</strong>
</header>
<div>
<form method="post" action="{% url 'journal:wrapped_share' year %}">
@ -26,37 +26,37 @@
<div style="width:100%;">
<textarea type="text"
name="comment"
placeholder="分享附言"
placeholder="{% trans "note" %}"
style="width:100%;
height:100%">分享 #我的{{year}}书影音</textarea>
height:100%"> {% blocktrans %}#{{year}}_report{% endblocktrans %}</textarea>
</div>
</div>
<div style="margin:0.5em">
<fieldset>
可见性:
{% trans "Visibility" %}
<input type="radio"
name="visibility"
value="0"
required
id="id_visibility_0"
checked />
<label for="id_visibility_0">公开</label>
<label for="id_visibility_0">{% trans "Public" %}</label>
<input type="radio"
name="visibility"
value="1"
required
id="id_visibility_1">
<label for="id_visibility_1">仅关注者</label>
<label for="id_visibility_1">{% trans "Followers Only" %}</label>
<input type="radio"
name="visibility"
value="2"
required=""
id="id_visibility_2">
<label for="id_visibility_2">仅自己</label>
<label for="id_visibility_2">{% trans "Mentioned Only" %}</label>
</fieldset>
</div>
<div>
<input type="submit" value="{% trans '分享' %}">
<input type="submit" value="{% trans 'Share' %}">
</div>
</form>
</div>
@ -68,7 +68,7 @@
if (uri.startsWith(pfx)) {
$('#img').val(uri.substring(pfx.length));
} else {
alert('分享失败');
alert('Error occured');
}
}
svgAsPngUri($('#viz0').children('svg')[0]).then(share);

File diff suppressed because it is too large Load diff

View file

@ -2,6 +2,8 @@
exclude = [ "media", ".venv", ".git", "playground", "catalog/*/tests.py", "neodb", "**/migrations", "**/sites/douban_*", "neodb-takahe" ]
reportIncompatibleVariableOverride = false
reportUnusedImport = false
reportUnknownVariableType = false
reportConstantRedefinition = false
[tool.djlint]
ignore="T002,T003,H005,H006,H019,H020,H021,H023,H030,H031,D018"

View file

@ -10,7 +10,7 @@
<span class="action">
{% if activity.action_object.item.class_name == 'podcastepisode' %}
<span>
<a title="播放节目"
<a title="{% trans "play" %}"
class="episode"
data-uuid="{{ activity.action_object.item.uuid }}"
data-media="{{ activity.action_object.item.media_url }}"
@ -23,7 +23,7 @@
</span>
{% endif %}
<span>
<a title="评论节目"
<a title="{% trans "comment" %}"
hx-get="{% url 'journal:comment' activity.action_object.item.uuid %}"
hx-target="body"
hx-swap="beforeend"><i class="fa-regular fa-comment"></i></a>

View file

@ -10,14 +10,14 @@
<span class="action">
<span>
{% if not action.taken %}
<a title="添加标记"
<a title="{% trans "mark" %}"
hx-get="{% url 'journal:mark' activity.action_object.item.uuid %}?shelf_type=wishlist"
hx-target="body"
hx-swap="beforeend">
<i class="fa-regular fa-bookmark"></i>
</a>
{% else %}
<a title="修改标记"
<a title="{% trans "mark" %}"
hx-get="{% url 'journal:mark' activity.action_object.item.uuid %}"
hx-target="body"
hx-swap="beforeend">

View file

@ -10,14 +10,14 @@
<span class="action">
<span>
{% if not action.taken %}
<a title="添加标记"
<a title="{% trans "mark" %}"
hx-get="{% url 'journal:mark' activity.action_object.item.uuid %}?shelf_type=wishlist"
hx-target="body"
hx-swap="beforeend">
<i class="fa-regular fa-bookmark"></i>
</a>
{% else %}
<a title="修改标记"
<a title="{% trans "mark" %}"
hx-get="{% url 'journal:mark' activity.action_object.item.uuid %}"
hx-target="body"
hx-swap="beforeend">

View file

@ -12,7 +12,7 @@ from django.urls import reverse
from django.utils.translation import gettext_lazy as _
from common.config import *
from common.utils import GenerateDateUUIDMediaFilePath
from common.utils import GenerateDateUUIDMediaFilePath, profile_identity_required
from journal.exporters.doufen import export_marks_task
from journal.importers.douban import DoubanImporter
from journal.importers.goodreads import GoodreadsImporter
@ -27,6 +27,7 @@ from .tasks import *
@login_required
@profile_identity_required
def preferences(request):
preference = request.user.preference
identity = request.user.identity
@ -73,6 +74,7 @@ def preferences(request):
@login_required
@profile_identity_required
def data(request):
current_year = datetime.date.today().year
queryset = request.user.identity.shelf_manager.get_shelf(

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 }} - 账号信息</title>
<title>{{ site_name }} - {% trans "Account Information" %}</title>
{% include "common_libs.html" %}
</head>
<body>
@ -17,70 +17,68 @@
{% if allow_any_site %}
<article>
<details>
<summary>{% trans '用户名、电子邮件与社交身份' %}</summary>
<summary>{% trans 'Username, Email and Identities' %}</summary>
<form action="{% url 'users:register' %}?next={{ request.path }}"
method="post">
<small>{{ error }}</small>
<fieldset>
<label>
用户名
<input name="username"
_="on input remove [@disabled] from #save end"
placeholder="2-30个字符限英文字母数字下划线确认后不可更改"
required
{% if request.user.username %}value="{{ request.user.username }}" aria-invalid="false" readonly{% endif %}
pattern="^[a-zA-Z0-9_]{2,30}$" />
{% trans "Username" %}
<input name="username" _="on input remove [@disabled] from #save end" placeholder="{% trans "2-30 alphabets, numbers or underscore, can't be changed once saved" %}" required {% if request.user.username %}value="{{ request.user.username }}" aria-invalid="false" readonly{% endif %} pattern="^[a-zA-Z0-9_]{2,30}$" />
</label>
<label>
电子邮件地址
{% trans "email address (optional if you log in via other Fediverse site, but recommended)" %}
<input type="email"
name="email"
_="on input remove [@disabled] from #save then remove [@aria-invalid] end"
{% 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 with 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 %}
</label>
</fieldset>
{% csrf_token %}
<input type="submit" value="{% trans '保存' %}" disabled id="save">
<input type="submit" value="{% trans 'Save' %}" disabled id="save">
</form>
<form action="{% url 'users:reconnect' %}" method="post">
{% csrf_token %}
<fieldset>
{% if request.user.mastodon_acct %}
<label>
已关联社交身份
{% trans "Associated identities" %}
<input type="input"
{% if request.user.mastodon_acct %}aria-invalid="false"{% endif %}
value="{{ request.user.mastodon_acct | default:'未关联' }}"
value="{{ request.user.mastodon_acct | default:'-' }}"
readonly>
</label>
{% else %}
<p>
如果你还没有在任何<em data-tooltip="联邦宇宙(Fediverse 有时也被称为长毛象)是一种分布式社交网络">联邦宇宙</em>实例注册过,可先<a href="https://joinmastodon.org/zh/servers" target="_blank">选择实例并注册</a>
{% blocktrans %}If you have not yet registered with any Federated instance, you may <a href="https://joinmastodon.org/zh/servers" target="_blank">choose an instance</a> and register.{% endblocktrans %}
</p>
{% endif %}
<label>
{% if request.user.mastodon_acct %}
如需关联到另一个联邦宇宙社交身份,请输入新身份所在的实例域名
{% trans "To associate with another federated identity, please enter the domain name of the instance where the new identity is located." %}
{% else %}
如果你已经注册过联邦宇宙实例,请输入实例域名
{% trans "If you have registered with a Federated instance, please enter the instance domain name." %}
{% endif %}
<input type="input"
name="domain"
value=""
placeholder="例如mastodon.online"
placeholder="e.g. mastodon.online"
_="on input remove [@disabled] from #bind end">
</label>
<input type="submit" value="{% trans '登录实例并关联' %}" disabled id="bind" />
<input type="submit"
value="{% trans 'Go to target instance and authorize with the identity' %}"
disabled
id="bind" />
<small>
{% if request.user.mastodon_acct %}
替换关联后可使用新的联邦宇宙身份来登录{{ site_name }}和控制数据可见性,已有的标记评论收藏单等数据不受影响。
{% blocktrans %}After replacing the association, you may use the new Fediverse identity to log in and control data visibility. Existing data such as tags, comments, and collections will not be affected.{% endblocktrans %}
{% else %}
启用联邦宇宙身份后可发现和关注<em data-tooltip="部分用户开启了关注审核,你需有联邦宇宙身份方可请求关注">更多</em>的用户,并使用本站完整功能。
{% trans "Once associated with Fediverse identity, you can discover more users and use the full features of this site." %}
{% endif %}
</small>
</fieldset>
@ -90,12 +88,12 @@
{% endif %}
<article>
<details>
<summary>昵称、头像与其它个人信息</summary>
<summary>{% trans "Display name, avatar and other information" %}</summary>
<form action="{% url 'users:profile' %}?next={{ request.path }}"
method="post"
enctype="multipart/form-data">
{% if request.user.mastodon_acct and not request.user.preference.mastodon_skip_userinfo %}
<small class="invalid">请先关闭「自动同步用户昵称等基本信息」设置,否则这里的设置会在同步时被覆盖。</small>
<small class="invalid">{% trans "Please turn off Sync display name, bio and avatar." %}</small>
{% endif %}
{% include "_field.html" with field=profile_form.name %}
{% include "_field.html" with field=profile_form.summary %}
@ -103,43 +101,43 @@
{% include "_field.html" with field=profile_form.discoverable %}
{% include "_field.html" with field=profile_form.manually_approves_followers %}
{% csrf_token %}
<input type="submit" value="{% trans '保存' %}" id="save">
<input type="submit" value="{% trans 'Save' %}" id="save">
</form>
</details>
</article>
<article>
<details>
<summary>{% trans '正在关注的用户' %}</summary>
{% include 'users/relationship_list.html' with name="关注" id="follow" list=request.user.identity.following_identities.all %}
<summary>{% trans 'Users you are following' %}</summary>
{% include 'users/relationship_list.html' with id="follow" list=request.user.identity.following_identities.all %}
</details>
</article>
<article>
<details>
<summary>{% trans '关注了你的用户' %}</summary>
{% include 'users/relationship_list.html' with name="关注者" id="follower" list=request.user.identity.follower_identities.all %}
<summary>{% trans 'Users who follow you' %}</summary>
{% include 'users/relationship_list.html' with id="follower" list=request.user.identity.follower_identities.all %}
</details>
</article>
<article>
<details>
<summary>{% trans '请求关注你的用户' %}</summary>
{% include 'users/relationship_list.html' with name="请求关注者" id="follow_request" list=request.user.identity.requested_follower_identities.all %}
<summary>{% trans 'Users who request to follow you' %}</summary>
{% include 'users/relationship_list.html' with id="follow_request" list=request.user.identity.requested_follower_identities.all %}
</details>
</article>
<article>
<details>
<summary>{% trans '已隐藏的用户' %}</summary>
{% include 'users/relationship_list.html' with name="隐藏" id="mute" list=request.user.identity.muting_identities.all %}
<summary>{% trans 'Users you are muting' %}</summary>
{% include 'users/relationship_list.html' with id="mute" list=request.user.identity.muting_identities.all %}
</details>
</article>
<article>
<details>
<summary>{% trans '已屏蔽的用户' %}</summary>
{% include 'users/relationship_list.html' with name="屏蔽" id="block" list=request.user.identity.blocking_identities.all %}
<summary>{% trans 'Users you are blocking' %}</summary>
{% include 'users/relationship_list.html' with id="block" list=request.user.identity.blocking_identities.all %}
</details>
</article>
<article>
<details>
<summary>{% trans '同步联邦宇宙信息和社交数据' %}</summary>
<summary>{% trans 'Sync and import social account' %}</summary>
<form action="{% url 'users:sync_mastodon_preference' %}"
method="post"
enctype="multipart/form-data">
@ -149,7 +147,7 @@
<input type="checkbox"
name="mastodon_sync_userinfo"
{% if not request.user.preference.mastodon_skip_userinfo %}checked{% endif %}>
{% trans '自动同步用户昵称等基本信息' %}
{% trans 'Sync display name, bio and avatar' %}
</label>
</fieldset>
<fieldset>
@ -157,43 +155,44 @@
<input type="checkbox"
name="mastodon_sync_relationship"
{% if not request.user.preference.mastodon_skip_relationship %}checked{% endif %}>
{% trans '自动导入新增的关注、屏蔽和隐藏列表' %}
{% trans 'Sync follow, mute and block' %}
</label>
</fieldset>
<input type="submit"
value="{% trans '保存同步设置' %}"
value="{% trans 'Save sync settings' %}"
{% if not request.user.mastodon_username %}disabled{% endif %} />
<small>
{{ site_name }}会按照以上设置每天自动导入你在联邦宇宙实例中新增的关注、屏蔽和隐藏列表;
<br>
如果你在联邦宇宙实例中关注的用户加入了NeoDB你会自动关注她
<br>
如果你在联邦宇宙实例中取消了关注、屏蔽或隐藏,{{ site_name }}不会自动取消,但你可以手动移除。
{% trans "New follow, mute and blocks in the associated identity may be automatically imported; removal has to be done manually." %}
</small>
</form>
<form action="{% url 'users:sync_mastodon' %}"
method="post"
enctype="multipart/form-data">
{% csrf_token %}
<small>如果希望立即开始同步,可以点击下方按钮。</small>
<small>{% trans "Click button below to start sync now." %}</small>
<input type="submit"
value="{% trans '立即同步' %}"
value="{% trans 'Sync now' %}"
{% if not request.user.mastodon_username %}disabled{% endif %} />
<small>
{% if request.user.mastodon_last_refresh %}上次更新时间 {{ request.user.mastodon_last_refresh }}{% endif %}
{% if request.user.mastodon_last_refresh %}
{% trans "Last updated" %} {{ request.user.mastodon_last_refresh }}
{% endif %}
上次更新时间
</small>
</form>
</details>
</article>
<article>
<details>
<summary>{% trans '删除数据和账号信息' %}</summary>
<summary>{% trans 'Delete Account' %}</summary>
删除数据和账号信息
<form action="{% url 'users:clear_data' %}"
method="post"
onsubmit="return confirm('账号数据一旦删除后将无法恢复。确认删除吗?');">
onsubmit="return confirm('{% trans "Once deleted, account data cannot be recovered. Sure to proceed?" %}');">
账号数据一旦删除后将无法恢复。确认删除吗?
{% csrf_token %}
<div>
输入完整的登录用 <code>用户名@实例名</code><code>电子邮件地址</code> 以确认删除
{% blocktrans %}Enter full <code>username@instance.social</code> or <code>email@domain.com</code> to confirm deletion.{% endblocktrans %}
<input type="email"
name="verification"
_="on input remove [@disabled] from #delete end"
@ -203,12 +202,12 @@
aria-invalid="true"
aria-describedby="invalid-helper"
placeholder="Gargron@mastodon.social">
<small id="invalid-helper">账号数据一旦删除后将无法恢复</small>
<small id="invalid-helper">{% trans "Once deleted, account data cannot be recovered." %}</small>
{% if import_status.douban_pending %}
<input type="submit" value="暂时无法删除,因为有导入任务正在进行" disabled />
<input type="submit" value="{% trans "Importing in progress, can't delete now." %}" disabled />
{% else %}
<input type="submit"
value="{% trans '永久删除' %}"
value="{% trans 'Permanently Delete' %}"
class="contrast"
disabled
id="delete" />

View file

@ -1,28 +0,0 @@
{% load i18n %}
<dialog open
_="on close_dialog add .closing then wait for animationend then remove me">
<article>
<header>
<link to="#"
aria-label="Close"
class="close"
_="on click trigger close_dialog" />
<strong>在联邦宇宙关注用户</strong>
</header>
<div>
<p>{{ identity.display_name }} 已经开启了关注审核请复制以下ID到你所在的联邦宇宙实例中去关注ta。</p>
<p style="text-align:center;">
<code onclick="navigator.clipboard.writeText(this.innerText);"
data-tooltip="点击复制">@{{ identity.user.mastodon_acct }}</code>
</p>
<p>如果你已经关注了ta请耐心等待ta的审核。</p>
{% if not request.user.mastodon_acct %}
<p>
如果你还没有注册过<em data-tooltip="联邦宇宙(Fediverse 亦称长毛象)是一种分布式社交网络">联邦宇宙</em>
可先<a href="https://joinmastodon.org/zh/servers" target="_blank">选择实例并注册</a>
再到本站的<a href="{% url 'users:info' %}">账号管理</a>中关联你的联邦宇宙身份。
</p>
{% endif %}
</div>
</article>
</dialog>

View file

@ -18,7 +18,7 @@
download="neodb_{{ id }}.csv"><i class="fa-solid fa-download"></i></a>
</span>
</span>
{% blocktrans %}You may download {{ name }} on {{ site_name }} here.{% endblocktrans %}
{% blocktrans %}You may download the list here.{% endblocktrans %}
</p>
<script>
let csv = "data:text/csv;charset=utf-8,Account address,Show boosts,Notify on new posts,Languages\n"