lib.itmens/catalog/templates/_item_reviews.html
2023-12-29 22:27:28 -05:00

49 lines
1.8 KiB
HTML

{% load static %}
{% load i18n %}
{% load l10n %}
{% load admin_url %}
{% load mastodon %}
{% load oauth_token %}
{% load truncate %}
{% load duration %}
{% load user_actions %}
{% for review in reviews %}
{% if forloop.counter <= 10 %}
<section>
<span 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>
<span>
{% if review.rating_grade %}{{ review.rating_grade|rating_star }}{% endif %}
<a href="{{ review.owner.url }}"
class="nickname"
title="@{{ review.owner.handler }}">{{ review.owner.display_name }}</a>
</span>
<span class="action inline">
<span class="timestamp">{{ review.created_time|date }}</span>
<span class="timestamp">评论</span>
</span>
{% if review.item != item %}<a href="{{ review.item.url }}">{{ review.item.title }}</a>{% endif %}
<div>
<span>
<a href="{% url 'journal:review_retrieve' review.uuid %}">{{ review.title }}</a>
</span>
-
{{ review.plain_content | truncate:200 }}
</div>
</section>
{% else %}
<a hx-get="{% url 'catalog:reviews' review.item.url_path review.item.uuid %}?last={{ review.created_time|date:'Y-m-d H:i:s.uO'|urlencode }}"
hx-trigger="click"
hx-swap="outerHTML">
<button class="outline">显示更多</button>
</a>
{% endif %}
{% empty %}
<div class="empty">{% trans '暂无' %}</div>
{% endfor %}