{% load static %}
{% load i18n %}
{% load mastodon %}
{% load thumb %}
{% load user_actions %}
{% load duration %}
<!DOCTYPE html>
<html lang="zh" class="content-page">
  <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{{ site_name }} - {{ item.display_title }} - {% trans 'Marks' %}</title>
    {% include "common_libs.html" %}
  </head>
  <body>
    {% include '_header.html' %}
    <main>
      <div class="grid__main">
        <h5>
          {% if followeing_only %}
            <a href="{% url 'catalog:mark_list' item.url_path item.uuid %}">{% trans 'marks' %}</a>
            | {% trans 'marks from who you follow' %}
          {% else %}
            {% 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 'reviews' %}</a>
        </h5>
        {% for member in marks %}
          {% with member.mark as mark %}
            <section>
              <div class="action">
                {% if mark.comment.latest_post %}
                  {% include "action_reply_piece.html" with post=mark.comment.latest_post piece=mark.comment %}
                  {% include "action_like_post.html" with post=mark.comment.latest_post %}
                  {% include "action_boost_post.html" with post=mark.comment.latest_post %}
                {% endif %}
                {% include "action_open_post.html" with post=mark.shelfmember.latest_post %}
                <span class="timestamp">{{ mark.created_time|date }}</span>
              </div>
              <div>
                <a href="{{ mark.owner.url }}" title="@{{ mark.owner.handle }}">{{ mark.owner.display_name }}</a>
                <span>{{ mark.action_label }}</span>
                {% if mark.comment.item != item %}
                  <a href="{{ mark.comment.item_url }}">{{ mark.comment.item.display_title }}</a>
                {% endif %}
              </div>
              <div>
                {% if mark.rating_grade %}{{ mark.rating_grade|rating_star }}{% endif %}
                {{ mark.comment.html|safe }}
              </div>
              {% if mark.comment.latest_post %}<div id="replies_{{ mark.comment.latest_post.pk }}"></div>{% endif %}
            </section>
          {% endwith %}
        {% empty %}
          <div>{% trans 'nothing so far.' %}</div>
        {% endfor %}
        {% include "_pagination.html" %}
      </div>
      <aside class="grid__aside top">
        {% include "_sidebar_item.html" %}
      </aside>
    </main>
    {% include "_footer.html" %}
  </body>
</html>
