lib.itmens/journal/templates/posts.html
2024-06-03 18:10:33 -04:00

40 lines
1.5 KiB
HTML

{% load bleach_tags %}
{% load duration %}
{% load humanize %}
{% load i18n %}
{% for post in posts %}
<section class="activity">
<div>
<span class="action">
<span class="timestamp">{{ post.created|naturaldelta }}</span>
{% include "action_reply_post.html" %}
{% include "action_like_post.html" %}
{% include "action_boost_post.html" %}
{% include "action_open_post.html" %}
</span>
<!--span class="avatar" style="margin:0.5em;"> <img src="{{ post.author.icon_uri }}" alt="cover" /> </span -->
<span style="">
<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:"" }}
</div>
</div>
<div id="replies_{{ post.pk }}"></div>
</section>
{% empty %}
<div class="empty">{% trans "nothing so far." %}</div>
{% endfor %}