Files
indiekit-endpoint-microsub/views/partials/item-card-compact.njk
Ricardo 26225f1f80 feat: add multi-view reader with Channels, Deck, and Timeline views
Three reader views accessible via icon toolbar:
- Channels: existing view (renamed), per-channel timelines
- Deck: TweetDeck-style configurable columns with compact cards
- Timeline: all channels merged chronologically with colored borders

Includes channel color palette, cross-channel query, deck config
storage, session-based view preference, and view switcher partial.
2026-02-26 14:42:00 +01:00

38 lines
1.5 KiB
Plaintext

{# Compact item card for deck columns #}
<article class="item-card-compact{% if item._is_read %} item-card-compact--read{% endif %}"
data-item-id="{{ item._id }}">
<a href="{{ readerBaseUrl }}/item/{{ item._id }}" class="item-card-compact__link">
{% if item.photo and item.photo.length > 0 %}
<img src="{{ item.photo[0] }}"
alt=""
class="item-card-compact__photo"
loading="lazy"
onerror="this.style.display='none'">
{% endif %}
<div class="item-card-compact__body">
{% if item.name %}
<h4 class="item-card-compact__title">{{ item.name }}</h4>
{% elif item.content %}
<p class="item-card-compact__text">
{% if item.content.text %}{{ item.content.text | truncate(80) }}{% elif item.content.html %}{{ item.content.html | safe | striptags | truncate(80) }}{% endif %}
</p>
{% endif %}
<div class="item-card-compact__meta">
{% if item._source %}
<span class="item-card-compact__source">{{ item._source.name or item._source.url }}</span>
{% elif item.author %}
<span class="item-card-compact__source">{{ item.author.name }}</span>
{% endif %}
{% if item.published %}
<time datetime="{{ item.published }}" class="item-card-compact__date">
{{ item.published | date("PP") }}
</time>
{% endif %}
</div>
</div>
{% if not item._is_read %}
<span class="item-card-compact__unread" aria-label="Unread"></span>
{% endif %}
</a>
</article>