{% load static %}
{% load i18n %}
{% load l10n %}
{% load mastodon %}
{% load thumb %}
<!DOCTYPE html>
<html lang="zh">
  <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{{ site_name }} - {% trans 'Delete' %}</title>
    {% include "common_libs.html" %}
    {% if url %}<meta http-equiv="refresh" content="3;url={{ url }}">{% endif %}
  </head>
  <body>
    {% include "_header.html" %}
    <main class="container">
      <h2>{% trans 'Are you sure to delete?' %}</h2>
      <div>
        <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> {% trans "Item has been deleted." %}
          </p>
        {% endif %}
        {% if item.child_items %}
          <p>
            <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> {% trans "Item has been merged to another item." %}
          </p>
        {% endif %}
        {% if item.journal_exists %}
          <p>
            <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('{% trans "This operation cannot be undone. Sure to delete?" %}');">
        {% csrf_token %}
        <input type="hidden" name="sure" value="1">
        <input type="submit" value="{% trans 'Yes' %}">
        <input type="reset" value="{% trans 'No' %}" onclick="history.go(-1)">
      </form>
    </main>
    {% include "_footer.html" %}
  </body>
</html>
