2.7 KiB · text History 6b4f785
{# A topic in visual mode. `t` is a TopicTile; `base` the focus URL the
   reader opens over. The link swaps only #reader and pushes the URL. #}
{% import "_avatar.html" as ui %}
<a href="{{ base }}&amp;topic={{ t.id }}"
   hx-get="{{ base }}&amp;topic={{ t.id }}" hx-target="#reader" hx-select="#reader"
   hx-swap="outerHTML" hx-push-url="true"
   id="tile-{{ t.id }}" data-topic="{{ t.id }}"
   class="group/tile relative flex flex-col gap-2 rounded-box border border-base-300 bg-base-100 p-3 text-left shadow-sm transition-all duration-150 hover:-translate-y-0.5 hover:border-primary/60 hover:shadow-md focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary"
   aria-label="Read {{ t.title }}">
  <span class="absolute inset-x-0 top-0 h-1 rounded-t-box" style="background: {{ t.cat_widget_bg }}" aria-hidden="true"></span>
  <div class="flex items-start gap-2 pt-1">
    <span class="flex-1 font-semibold leading-snug line-clamp-3">
      {% if t.is_pinned %}<i class="fas fa-thumbtack text-accent mr-1" title="Pinned"></i>{% endif %}
      {% if t.is_closed %}<i class="fas fa-lock opacity-60 mr-1" title="Closed"></i>{% endif %}
      {{ t.title }}
    </span>
    {% if t.is_new %}<span class="badge badge-primary badge-sm shrink-0" title="You haven't opened this yet">new</span>
    {% elif t.unread > 0 %}<span class="badge badge-primary badge-sm shrink-0" title="{{ t.unread }} unread">{{ t.unread }}</span>{% endif %}
  </div>
  {% if t.notes %}
  <ul class="space-y-0.5 text-xs opacity-80">{% for n in t.notes %}<li class="truncate">{{ n }}</li>{% endfor %}</ul>
  {% endif %}
  {% if t.tags %}
  <div class="flex flex-wrap gap-1">{% for tag in t.tags %}<span class="badge badge-ghost badge-sm">{{ tag.name }}</span>{% endfor %}</div>
  {% endif %}
  <div class="mt-auto flex items-center justify-between gap-2">
    <span class="flex -space-x-2" title="{% for p in t.posters %}{{ p.name }}{% if not loop.last %}, {% endif %}{% endfor %}">
      {% for p in t.posters %}<span class="rounded-full ring-2 ring-base-100 inline-flex">{{ ui.avatar(p.id, p.name, p.has_avatar, "size-6", "text-[0.65rem]") | safe }}</span>{% endfor %}
    </span>
    <span class="flex items-center gap-1 text-xs">
      {% for r in t.reactions %}<span class="badge badge-ghost badge-sm"><span class="emoji-tint">{{ r.emoji }}</span> {{ r.count }}</span>{% endfor %}
    </span>
  </div>
  <div class="flex items-center justify-between text-xs opacity-70 font-mono">
    <span title="Replies"><i class="fas fa-reply mr-1" aria-hidden="true"></i>{{ t.replies }}</span>
    <span title="Views"><i class="fas fa-eye mr-1" aria-hidden="true"></i>{{ t.views }}</span>
    <span title="{{ t.bumped_at_abs }}">{{ t.bumped_at }}</span>
  </div>
</a>