Files
indiekit-endpoint-activitypub/views/partials/ap-item-media.njk
Ricardo 4e514235c2 feat: ActivityPub reader — timeline, notifications, compose, moderation
Add a dedicated fediverse reader view with:
- Timeline view showing posts from followed accounts with threading,
  content warnings, boosts, and media display
- Compose form with dual-path posting (quick AP reply + Micropub blog post)
- Native AP interactions (like, boost, reply, follow/unfollow)
- Notifications view for likes, boosts, follows, mentions, replies
- Moderation tools (mute/block actors, keyword filters)
- Remote actor profile pages with follow state
- Automatic timeline cleanup with configurable retention
- CSRF protection, XSS prevention, input validation throughout

Removes Microsub bridge dependency — AP content now lives in its own
MongoDB collections (ap_timeline, ap_notifications, ap_interactions,
ap_muted, ap_blocked).

Bumps version to 1.1.0.
2026-02-21 12:13:10 +01:00

38 lines
1.3 KiB
Plaintext

{# Media attachments partial — included from ap-item-card.njk #}
{# Photo gallery #}
{% if item.photo and item.photo.length > 0 %}
{% set displayCount = [item.photo.length, 4] | min %}
{% set extraCount = item.photo.length - 4 %}
<div class="ap-card__gallery ap-card__gallery--{{ displayCount }}">
{% for photoUrl in item.photo %}
{% if loop.index0 < 4 %}
<a href="{{ photoUrl }}" target="_blank" rel="noopener" class="ap-card__gallery-link{% if loop.index0 == 3 and extraCount > 0 %} ap-card__gallery-link--more{% endif %}">
<img src="{{ photoUrl }}" alt="" loading="lazy">
{% if loop.index0 == 3 and extraCount > 0 %}
<span class="ap-card__gallery-more">+{{ extraCount }}</span>
{% endif %}
</a>
{% endif %}
{% endfor %}
</div>
{% endif %}
{# Video embed #}
{% if item.video and item.video.length > 0 %}
<div class="ap-card__video">
<video controls preload="metadata" src="{{ item.video[0] }}">
{{ __("activitypub.reader.videoNotSupported") }}
</video>
</div>
{% endif %}
{# Audio player #}
{% if item.audio and item.audio.length > 0 %}
<div class="ap-card__audio">
<audio controls preload="metadata" src="{{ item.audio[0] }}">
{{ __("activitypub.reader.audioNotSupported") }}
</audio>
</div>
{% endif %}