2024-06-18 00:10:31 -04:00
{% load bleach_tags %}
{% load static %}
{% load i18n %}
{% load l10n %}
{% load humanize %}
{% load mastodon %}
{% load thumb %}
{% load user_actions %}
{% load duration %}
{% for event in events %}
2024-07-03 16:42:20 -04:00
{% with post=event.subject_post piece=event.subject_post.piece item=event.subject_post.item %}
2024-06-18 09:11:06 -04:00
{% if not post %}
<!-- invalid data {{ event.pk }} -->
{% else %}
< section class = "activity post" >
{% if event.type == "boost" %}
< div class = "boosted" >
< i class = "fa-solid fa-retweet"
title="{{ event.published|naturaldelta }}">< / i >
< a href = "{{ event.subject_identity.url }}"
class="nickname"
title="@{{ event.subject_identity.handle }}">{{ event.subject_identity.name }}< / a >
{% trans 'boosted' %}
2024-06-18 00:10:31 -04:00
< / div >
2024-06-18 09:11:06 -04:00
{% endif %}
< div style = "display:flex;" >
< div >
< div class = "avatar" style = "margin:0.6em 0.6em 0.6em 0;" >
< a href = "{{ post.author.url }}" >
2024-07-23 10:04:07 -04:00
< img src = "{{ post.author.local_icon_url }}"
alt="@{{ post.author.handle }}">
2024-06-18 09:11:06 -04:00
< / a >
< / div >
< / div >
< div style = "flex-grow:1;" >
< span class = "action" >
< span class = "timestamp" > {{ post.published|naturaldelta }}< / span >
2024-06-18 11:20:45 -04:00
{% if item and item.class_name != 'tvepisode' %}
2024-06-18 09:11:06 -04:00
< span >
2024-06-18 11:20:45 -04:00
{% if item.class_name == 'podcastepisode' %}
2024-06-18 09:11:06 -04:00
< a title = "{% trans " play " % } "
class="episode"
2024-06-18 11:20:45 -04:00
data-uuid="{{ item.uuid }}"
data-media="{{ item.media_url }}"
data-cover="{{ item.cover_url|default:item.parent_item.cover.url }}"
2024-07-13 01:36:18 -04:00
data-title="{{ item.display_title }}"
data-album="{{ item.parent_item.display_title }}"
2024-11-22 23:44:14 -05:00
data-hosts="{{ item.parent_item.host|join:' / ' }}"
2024-06-18 11:20:45 -04:00
{% if request.user.is_authenticated %} data-comment-href="{% url 'journal:comment' item.uuid %}" {% endif %}
data-position="{{ piece.metadata.position | default:0 }}">< i class = "fa-solid fa-circle-play" > < / i > < / a >
2024-06-18 09:11:06 -04:00
{% else %}
< a title = "{% trans " mark " % } "
2024-06-18 11:20:45 -04:00
hx-get="{% url 'journal:mark' item.uuid %}?shelf_type=wishlist"
2024-06-18 09:11:06 -04:00
hx-target="body"
hx-swap="beforeend">
< i class = "fa-regular fa-bookmark" > < / i >
< / a >
{% endif %}
< / span >
{% endif %}
{% 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"
2024-07-18 22:53:26 -04:00
title="@{{ post.author.handle }}">{{ post.author.name|default:post.author.username }}< / a >
2024-06-18 11:20:45 -04:00
{% if piece and piece.classname == 'note' %}
2024-06-18 09:11:06 -04:00
{% trans "wrote a note" %}
{% endif %}
< / span >
2024-07-03 16:42:20 -04:00
{% if item and piece.classname != 'note' %}
2024-06-22 12:17:25 -04:00
< article > {% include "_item_card.html" with item=item allow_embed=1 %}< / article >
{% endif %}
2024-06-18 09:11:06 -04:00
< div > {{ post.summary|default:'' }}< / div >
< div style = "display:flex;" >
< div style = "flex-grow:1"
{% if post.summary or post.sensitive %}class="spoiler" _="on click toggle .revealed on me"{% endif %}>
< div class = "attachments" >
{% for attachment in post.attachments.all %}
{% if attachment.is_image %}
< a href = "#img_{{ post.pk }}_{{ loop.index }}" >
< img src = "{{ attachment.thumbnail_url.relative }}"
alt="image attachment"
class="preview">
< / a >
< a href = "#" class = "lightbox" id = "img_{{ post.pk }}_{{ loop.index }}" >
< span style = "background-image: url('{{ attachment.full_url.relative }}')" > < / span >
< / a >
{% endif %}
{% endfor %}
< / div >
2024-06-18 11:20:45 -04:00
{% if piece and piece.classname == 'note' %}
2024-06-18 09:11:06 -04:00
< blockquote class = "tldr"
_="on click toggle .tldr on me"
style="margin:0;
padding-top:0;
padding-bottom:0">
{{ post.content|bleach:"a,p,span,br,div,img"|default:"" }}
< / blockquote >
2024-06-18 00:10:31 -04:00
{% else %}
2024-06-18 09:11:06 -04:00
{{ post.content|bleach:"a,p,span,br,div,img"|default:"" }}
2024-06-18 00:10:31 -04:00
{% endif %}
2024-06-18 09:11:06 -04:00
< / div >
2024-06-22 12:17:25 -04:00
< div class = "embed-cover" >
{% if piece and piece.classname == 'note' %}
2024-06-18 11:20:45 -04:00
{% if item %}
2024-07-13 01:36:18 -04:00
< a href = "{{ item.url }}" title = "{{ item.display_title }}" >
< img src = "{{ item.cover_image_url }}"
title="{{ item.display_title }}"
alt="cover">
2024-06-18 09:11:06 -04:00
< / a >
{% endif %}
2024-06-18 00:10:31 -04:00
{% endif %}
2024-06-18 09:11:06 -04:00
< / div >
2024-06-18 00:10:31 -04:00
< / div >
< / div >
< / div >
2024-06-18 09:11:06 -04:00
< div id = "replies_{{ post.pk }}" > < / div >
< / section >
{% endif %}
2024-06-18 00:10:31 -04:00
{% endwith %}
{% if forloop.last %}
< div class = "htmx-indicator"
style="margin-left: 60px"
2025-01-01 09:32:24 -05:00
{% if request.GET.q %} hx-get="{% url 'social:search_data' %}?q={{ request.GET.q }}& lastpage={{ page }}" {% else %} hx-get="{% url 'social:data' %}?last={{ event.pk }}& typ={{ feed_type }}" {% endif %}
2024-06-18 00:10:31 -04:00
hx-trigger="revealed"
hx-swap="outerHTML">
< i class = "fa-solid fa-compact-disc fa-spin loading" > < / i >
< / div >
{% endif %}
{% empty %}
2024-12-30 01:51:19 -05:00
< div class = "empty" >
2024-12-30 15:34:18 -05:00
{% if request.GET.last or page > 1 %}
2024-12-30 01:51:19 -05:00
{% trans 'nothing more.' %}
{% elif request.GET.q %}
{% trans 'no matching activities.' %}
{% else %}
2024-06-18 00:10:31 -04:00
{% url 'users:data' as import_url %}
{% blocktrans %}Find and mark some books/movies/podcasts/games, < a href = "{{ import_url }}" > import your data< / a > from Goodreads/Letterboxd/Douban, follow some fellow {{ site_name }} users on the fediverse, so their recent activities and yours will show up here.{% endblocktrans %}
2024-12-30 01:51:19 -05:00
{% endif %}
< / div >
2024-06-18 00:10:31 -04:00
{% endfor %}