lib.itmens/journal/templates/posts.html

47 lines
1.6 KiB
HTML
Raw Normal View History

2024-06-03 12:59:24 -04:00
{% load bleach_tags %}
2024-06-03 17:33:39 -04:00
{% load duration %}
2024-06-03 12:59:24 -04:00
{% load humanize %}
{% load i18n %}
{% for post in posts %}
<section class="activity">
2024-06-03 21:55:00 -04:00
<div style="display:flex;">
<div>
<div class="avatar" style="margin:0.6em 0.6em 0.6em 0;">
<img src="{{ post.author.icon_uri }}" alt="@{{ post.author.handle }}" />
</div>
</div>
<div style="flex-grow:1;">
<span class="action">
2024-06-03 23:39:20 -04:00
<span class="timestamp">{{ post.published|naturaldelta }}</span>
2024-06-03 21:55:00 -04:00
{% 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 }}</a>
</span>
<div>{{ post.summary|default:'' }}</div>
<div {% if post.summary or post.sensitive %}class="spoiler" _="on click toggle .revealed on me"{% endif %}>
<div>
{% for attachment in post.attachments.all %}
{% if attachment.is_image %}
<img src="{{ attachment.full_url.relative }}"
alt="attachment.file_display_name"
style="max-height:6em;
max-width:50%">
{% endif %}
{% endfor %}
</div>
{{ post.content|bleach:"a,p,span,br,div,img"|default:"" }}
2024-06-03 12:59:24 -04:00
</div>
</div>
</div>
<div id="replies_{{ post.pk }}"></div>
</section>
{% empty %}
<div class="empty">{% trans "nothing so far." %}</div>
{% endfor %}