lib.itmens/journal/templates/replies.html

102 lines
3.3 KiB
HTML
Raw Normal View History

2024-04-19 20:24:34 -04:00
{% load i18n %}
2024-06-20 16:01:21 -04:00
<section class="replies"
hx-target="this"
hx-swap="outerHTML"
id="replies_{{ post.pk }}">
{% with parent_post=post %}
{% for post in replies %}
<div class="post">
<span class="action">
{% if post.author_id == request.user.identity.pk %}
{% include "action_delete_post.html" %}
2023-08-15 15:46:11 -04:00
{% endif %}
2024-06-20 16:01:21 -04:00
{% include "action_reply_post.html" %}
{% include "action_like_post.html" %}
{% include "action_boost_post.html" %}
{% include "action_open_post.html" %}
2023-08-15 15:46:11 -04:00
</span>
2024-06-20 16:01:21 -04:00
<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 %}
2023-08-15 15:46:11 -04:00
{{ post.safe_content_local }}
2024-06-20 16:01:21 -04:00
{% endif %}
{% for attachment in post.attachments.all %}
<a href="{{ attachment.full_url.relative }}" class="download">
<div>
<i class="fa-solid fa-download"></i> {{ attachment.file_display_name }}
</div>
</a>
{% endfor %}
<div id="replies_{{ post.pk }}"></div>
</div>
{% empty %}
<div class="empty">{% trans 'no replies so far.' %}</div>
{% endfor %}
{% endwith %}
2024-04-19 20:24:34 -04:00
{% if post %}
<form class="reply"
role="group"
hx-post="{% url 'journal:post_reply' post.pk %}"
hx-trigger="submit once">
2024-05-23 11:27:03 -04:00
<input name="content" type="text" placeholder="{% trans "add a reply" %}" />
2024-04-19 20:24:34 -04:00
<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>
{% endif %}
2023-08-15 15:46:11 -04:00
</section>