200 lines
8 KiB
HTML
200 lines
8 KiB
HTML
{% load static %}
|
||
{% load i18n %}
|
||
{% load admin_url %}
|
||
{% load mastodon %}
|
||
{% load oauth_token %}
|
||
{% load truncate %}
|
||
{% if item %}
|
||
<div class="action">
|
||
<span>
|
||
<a title="编辑条目" href="{% url 'catalog:edit' item.url_path item.uuid %}"><i class="fa-solid fa-pencil"></i></a>
|
||
</span>
|
||
<span>
|
||
<a title="编辑历史"
|
||
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-solid fa-info"></i></a>
|
||
</span>
|
||
</div>
|
||
<h5>编辑选项</h5>
|
||
{% if item.is_deleted %}
|
||
<p>
|
||
<i class="fa-solid fa-circle-xmark"></i> 条目已被删除
|
||
</p>
|
||
{% endif %}
|
||
{% if item.child_items %}
|
||
<p>
|
||
<i class="fa-solid fa-circle-exclamation"></i> 条目下已有子项
|
||
</p>
|
||
{% endif %}
|
||
{% if item.merged_to_item %}
|
||
<p>
|
||
<i class="fa-solid fa-circle-xmark"></i> 条目已被合并到其他条目
|
||
</p>
|
||
{% endif %}
|
||
{% if item.journal_exists %}
|
||
<p>
|
||
<i class="fa-solid fa-circle-exclamation"></i> 条目已被用户标记过
|
||
</p>
|
||
{% endif %}
|
||
{% for i in item.merged_from_items.all %}
|
||
{% if forloop.first %}
|
||
<i class="fa-solid fa-circle-info"></i> 以下条目被并入本条目:
|
||
<ul>
|
||
{% endif %}
|
||
<li>
|
||
<a href="{{ i.url }}?skipcheck=1">{{ i.title }}</a>
|
||
</li>
|
||
{% if forloop.last %}</ul>{% endif %}
|
||
{% endfor %}
|
||
{% if item.editable or request.user.is_staff %}
|
||
{% for res in item.external_resources.all %}
|
||
<details>
|
||
<summary>
|
||
{% trans '源网站' %}: <a href="{{ res.url }}">{{ res.site_name.label }}</a>
|
||
</summary>
|
||
<div class="grid">
|
||
<form method="post"
|
||
action="{% url 'catalog:refetch' %}"
|
||
onsubmit="return confirm('现有信息可能会被覆盖。确认重新获取吗?');">
|
||
{% 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 '重新获取' %}">
|
||
</form>
|
||
{% if request.user.is_staff %}
|
||
<form method="post"
|
||
action="{% url 'catalog:unlink' %}"
|
||
onsubmit="return confirm('本操作不可撤销。确认取消关联吗?');">
|
||
{% csrf_token %}
|
||
<input type="hidden" name="id" value="{{ res.id }}">
|
||
<input class="contrast" type="submit" value="{% trans '取消关联' %}">
|
||
</form>
|
||
{% endif %}
|
||
</div>
|
||
</details>
|
||
{% endfor %}
|
||
{% if item.child_class %}
|
||
<details>
|
||
<summary>{% trans '创建子条目' %}</summary>
|
||
<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 }}">
|
||
</form>
|
||
</details>
|
||
{% endif %}
|
||
{% if item.class_name == "tvseason" %}
|
||
<details>
|
||
<summary>{% trans '更新单集条目' %}</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 %}
|
||
<p>因豆瓣/IMDB/TMDB之间对分季处理的差异,少量剧集和动画可能无法返回正确结果,更新后请手工确认和清理。</p>
|
||
<input class="contrast" type="submit" value="{% trans '更新单集条目' %}">
|
||
</form>
|
||
{% else %}
|
||
<i>⛔️ 获取单集条目需要本季序号和IMDB,不便填写也可以手工创建子条目。</i>
|
||
{% endif %}
|
||
</details>
|
||
{% endif %}
|
||
{% if item.class_name == "movie" %}
|
||
<details>
|
||
<summary>{% trans '切换分类' %}</summary>
|
||
<form method="post"
|
||
action="{% url 'catalog:recast' item.url_path item.uuid %}"
|
||
onsubmit="return confirm('确认切换吗?');">
|
||
{% csrf_token %}
|
||
<input type="hidden" value="tvshow" name="class">
|
||
<input class="contrast" type="submit" value="{% trans '更改为剧集' %}">
|
||
</form>
|
||
</details>
|
||
{% elif item.class_name == "tvshow" %}
|
||
{% if not item.all_seasons or request.user.is_staff %}
|
||
<details>
|
||
<summary>{% trans '切换分类' %}</summary>
|
||
<form method="post"
|
||
action="{% url 'catalog:recast' item.url_path item.uuid %}"
|
||
onsubmit="return confirm('确认切换吗?');">
|
||
{% csrf_token %}
|
||
<input type="hidden" value="movie" name="class">
|
||
<input class="contrast" type="submit" value="{% trans '更改为电影' %}">
|
||
</form>
|
||
<form method="post"
|
||
action="{% url 'catalog:recast' item.url_path item.uuid %}"
|
||
onsubmit="return confirm('确认切换吗?');">
|
||
{% csrf_token %}
|
||
<input type="hidden" value="tvseason" name="class">
|
||
<input class="contrast" type="submit" value="{% trans '更改为单季' %}">
|
||
</form>
|
||
</details>
|
||
{% endif %}
|
||
{% else %}
|
||
<!--此类条目无法切换-->
|
||
{% endif %}
|
||
{% if item.class_name == "tvseason" or item.class_name == "performanceproduction" %}
|
||
{% if not item.show or request.user.is_staff %}
|
||
<details>
|
||
<summary>关联到上一级条目</summary>
|
||
<form method="post"
|
||
action="{% url 'catalog:assign_parent' item.url_path item.uuid %}"
|
||
onsubmit="return confirm('本操作不可撤销。确认关联吗?');">
|
||
{% csrf_token %}
|
||
<input type="url"
|
||
name="parent_item_url"
|
||
placeholder="目标条目URL,留空则取消现有关联"
|
||
value="{{ item.show.absolute_url }}">
|
||
<br>
|
||
<input class="contrast" type="submit" value="{% trans '更新关联' %}">
|
||
</form>
|
||
</details>
|
||
{% endif %}
|
||
{% endif %}
|
||
{% if item.class_name == "tvshow" %}
|
||
<details>
|
||
<summary>清理单季</summary>
|
||
<form method="post"
|
||
action="{% url 'catalog:remove_unused_seasons' item.url_path item.uuid %}"
|
||
onsubmit="return confirm('本操作不可撤销。确认删除吗?');">
|
||
{% csrf_token %}
|
||
<input class="contrast" type="submit" value="{% trans '删除未被标记的单季' %}">
|
||
</form>
|
||
</details>
|
||
{% endif %}
|
||
{% if not item.journal_exists or request.user.is_staff %}
|
||
<details>
|
||
<summary>{% trans '合并' %}</summary>
|
||
<form method="post"
|
||
action="{% url 'catalog:merge' item.url_path item.uuid %}"
|
||
onsubmit="return confirm('本操作不可撤销。确认合并吗?');">
|
||
{% csrf_token %}
|
||
<input type="url"
|
||
name="new_item_url"
|
||
placeholder="目标条目URL,留空则取消现有合并"
|
||
value="{{ item.merged_to_item.absolute_url }}">
|
||
<br>
|
||
<input class="contrast" type="submit" value="{% trans '合并到同类另一条目' %}">
|
||
</form>
|
||
</details>
|
||
{% if item.child_items %}
|
||
<!-- 条目下有子项 -->
|
||
{% elif item.merged_from_items.all %}
|
||
<!-- 有其他条目被并入 -->
|
||
{% else %}
|
||
<details>
|
||
<summary>{% trans '删除' %}</summary>
|
||
<form method="post"
|
||
action="{% url 'catalog:delete' item.url_path item.uuid %}"
|
||
onsubmit="return confirm('本操作不可撤销。确认删除吗?');">
|
||
{% csrf_token %}
|
||
<input class="contrast"
|
||
type="submit"
|
||
{% if item.is_deleted or item.merged_to_item %}disabled{% endif %}
|
||
value="{% trans '删除' %}">
|
||
</form>
|
||
</details>
|
||
{% endif %}
|
||
{% endif %}
|
||
{% endif %}
|
||
{% endif %}
|