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

171 lines
5.1 KiB
HTML

{% load user_actions %}
<section>
<h5>
我的标签
{% if not mark.tags %}
<small>
<span class="action inline">
<a href="#"
hx-get="{% url 'journal:mark' item.uuid %}"
class="item-mark-icon"
hx-target="body"
hx-swap="beforeend">
<i class="fa-regular fa-square-plus"></i>
</a>
</span>
</small>
{% endif %}
</h5>
{% if mark.tags %}
<span class="action">
<span>
<a href="#"
hx-get="{% url 'journal:mark' item.uuid %}"
hx-target="body"
hx-swap="beforeend"><i class="fa-solid fa-pen-to-square"></i></a>
</span>
</span>
{% endif %}
<div class="tag-list">
{% for tag in mark.tags %}
<span>
<a href="{% url 'journal:user_tag_member_list' request.user.handler tag %}">{{ tag }}</a>
</span>
{% endfor %}
</div>
</section>
<section>
<h5>
我的短评
{% if not mark.comment %}
<small>
<span class="action inline">
<a href="#"
hx-get="{% url 'journal:mark' item.uuid %}"
class="item-mark-icon"
hx-target="body"
hx-swap="beforeend">
<i class="fa-regular fa-square-plus"></i>
</a>
</span>
</small>
{% endif %}
</h5>
{% if mark.comment %}
<span class="action">
<span>
<a href="#"
hx-get="{% url 'journal:mark' item.uuid %}"
hx-target="body"
hx-swap="beforeend"><i class="fa-solid fa-pen-to-square"></i></a>
</span>
{% if mark.comment.latest_post %}
{% include "action_like_post.html" with post=mark.comment.latest_post %}
{% include "action_boost_post.html" with post=mark.comment.latest_post %}
{% include "action_open_post.html" with post=mark.comment.latest_post %}
{% endif %}
{% comment %}
<span class="timestamp">{{ mark.comment.created_time|date }}</span>
{% endcomment %}
</span>
<p>{{ mark.comment.html|safe }}</p>
{% endif %}
<script>window.cil=[];</script>
{% for comment in child_item_comments %}
<script>window.cil.push('{{ comment.item.uuid }}');</script>
<span class="action">
<span>
<a href="#"
hx-get="{% url 'journal:comment' comment.item.uuid %}"
hx-target="body"
hx-swap="beforeend"><i class="fa-solid fa-pen-to-square"></i></a>
</span>
{% if comment.latest_post %}
{% include "action_like_post.html" with post=comment.latest_post %}
{% include "action_boost_post.html" with post=comment.latest_post %}
{% include "action_open_post.html" with post=comment.latest_post %}
{% endif %}
{% comment %} <span class="timestamp">{{ comment.created_time|date }}</span> {% endcomment %}
</span>
<p>
<a href="{{ comment.item.url }}">{{ comment.item.title }}</a>: {{ comment.html|safe }}
</p>
{% endfor %}
</section>
<section>
<h5>
我的评论
{% if not review %}
<small>
<span class="action inline">
<a href="{% url 'journal:review_create' item.uuid %}"
class="item-mark-icon">
<i class="fa-regular fa-square-plus"></i>
</a>
</span>
</small>
{% endif %}
</h5>
{% if review %}
<span class="action">
<span>
<a href="{% url 'journal:review_edit' item.uuid review.uuid %}"
class="item-mark-icon">
<i class="fa-solid fa-pen-to-square"></i>
</a>
</span>
{% if review.latest_post %}
{% 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 %}
{% comment %}
<span class="timestamp">{{ mark.review.created_time|date }}</span>
{% endcomment %}
</span>
<p>
<a href="{% url 'journal:review_retrieve' review.uuid %}">{{ review.title }}</a>
</p>
{% else %}
<!-- <span class="empty">暂无</span> -->
{% endif %}
</section>
<section>
<h5>
我的收藏单
<small>
<span class="action inline">
<a href="#"
hx-get="{% url 'journal:add_to_collection' item.uuid %}"
class="edit"
hx-target="body"
hx-swap="beforeend">
<i class="fa-regular fa-square-plus"></i>
</a>
</span>
</small>
</h5>
<div>
{% for c in my_collections %}
<p>
<a href="{{ c.url }}">{{ c.title }}</a>
{% if c.visibility > 0 %}<i class="fa-solid fa-lock"></i>{% endif %}
</p>
{% empty %}
<!-- <span class="empty">暂无</span> -->
{% endfor %}
</div>
</section>
{% if mark.logs %}
<section id="mark-history">
<h5>
标记历史
<small>
<span class="action inline">
<a _="on click toggle .hide-action on #log-list then toggle .activated"><i class="fa-solid fa-pen-to-square"></i></a>
</span>
</small>
</h5>
<div id="log-list" class="hide-action">{% include '_item_user_mark_history.html' %}</div>
</section>
{% endif %}