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

83 lines
2.6 KiB
HTML

<section class="replies" hx-target="this" hx-swap="outerHTML">
{% for post in replies %}
<div>
<span class="action">
{% include "action_reply_post.html" %}
{% include "action_like_post.html" %}
{% include "action_boost_post.html" %}
{% include "action_open_post.html" %}
</span>
<span>
<a href="{{ post.author.url }}"
class="nickname"
title="@{{ post.author.handle }}">{{ post.author.name|default:post.author.username }}</a>
</span>
<span class="action inline">
<span class="timestamp">
{% if post.edited %}
{{ post.edited | date }}
<i class="fa-solid fa-pencil"></i>
{% elif post.published %}
{{ post.published | date }}
{% else %}
{{ post.created | date }}
{% endif %}
</span>
</span>
{% if post.summary %}
<details>
<summary>{{ post.summary }}</summary>
{{ post.safe_content_local }}
</details>
{% else %}
{{ post.safe_content_local }}
{% endif %}
<div id="replies_{{ post.pk }}"></div>
</div>
{% empty %}
<div class="empty">暂无回应</div>
{% endfor %}
<form class="reply"
role="group"
hx-post="{% url 'journal:post_reply' post.pk %}"
hx-trigger="submit once">
<input name="content" type="text" placeholder="Type your reply" />
<details class="dropdown">
<summary>
<i class="fa-solid fa-users-gear"></i>
</summary>
<ul>
<li>
<label>
<input type="radio"
name="visibility"
value="{{ request.user.preference.post_public_mode }}"
{% if post.visibility <= 1 or post.visibility == 4 %}checked{% endif %} />
<i class="fa-solid fa-globe"></i>
</label>
</li>
<li>
<label>
<input type="radio"
name="visibility"
value="2"
{% if post.visibility == 2 %}checked{% endif %} />
<i class="fa-solid fa-lock"></i>
</label>
</li>
<li>
<label>
<input type="radio"
name="visibility"
value="3"
{% if post.visibility == 3 %}checked{% endif %} />
<i class="fa-solid fa-at"></i>
</label>
</li>
</ul>
</details>
<button class="secondary">
<i class="fa-regular fa-paper-plane"></i>
</button>
</form>
</section>