{% 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 'Reviews' %}</title>
    {% include "common_libs.html" %}
  </head>
  <body>
    {% include '_header.html' %}
    <main>
      <div class="grid__main">
        <h5>
          <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>
            <div class="action">
              {% if review.latest_post %}
                {% include "action_reply_piece.html" with post=review.latest_post piece=review href=review.url %}
                {% include "action_like_post.html" with post=review.latest_post %}
                {% include "action_boost_post.html" with post=review.latest_post %}
                {% include "action_open_post.html" with post=review.latest_post %}
              {% endif %}
              <span class="timestamp">{{ review.created_time|date }}</span>
            </div>
            <div>
              {% if review.rating_grade %}{{ review.rating_grade|rating_star }}{% endif %}
              <span>
                <a href="{% url 'journal:review_retrieve' review.uuid %}">{{ review.title }}</a>
              </span>
              -
              <span>
                <a href="{{ review.owner.url }}"
                   class="nickname"
                   title="@{{ review.owner.handle }}">{{ review.owner.display_name }}</a>
              </span>
            </div>
            <div class="tldr">{{ review.plain_content }}</div>
          </section>
        {% 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>
