1.9 KiB · text History 263b40b
{% import "_avatar.html" as ui %}
<div class="overflow-x-auto">
  <table class="table">
    <thead>
      <tr>
        <th>Topic</th>
        <th class="text-right">Posts</th>
        <th class="text-right">Views</th>
        <th class="text-right">Activity</th>
      </tr>
    </thead>
    <tbody>
      {% for t in topics %}
      <tr class="hover" data-topic="{{ t.id }}">
        <td>
          <div class="flex items-start gap-2">
            <a href="/c/{{ t.cat_slug }}" class="mt-1 shrink-0" title="{{ t.cat_name }}">
              <span class="size-3 rounded-full border border-base-content/20 block" style="background: {{ t.cat_widget_bg }}"></span>
            </a>
            <div>
              <a href="/t/{{ t.id }}" class="font-medium link link-hover">
                {% 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="Locked"></i>{% endif %}
                {% include "forum/_held_badge.html" %}
                {{ t.title }}
              </a>
              {% if t.tags %}
              <span class="ml-1">
                {% for tag in t.tags %}<a href="/tag/{{ tag.slug }}" class="badge badge-ghost badge-sm">{{ tag.name }}</a>{% endfor %}
              </span>
              {% endif %}
              <div class="text-xs opacity-60 flex items-center gap-1">
                {{ ui.avatar(t.author_id, t.author, t.author_has_avatar, "size-4", "text-[0.6rem]") | safe }}
                by {{ t.author }}
              </div>
            </div>
          </div>
        </td>
        <td class="text-right font-mono">{{ t.posts_count }}</td>
        <td class="text-right font-mono">{{ t.views }}</td>
        <td class="text-right text-xs opacity-70" title="{{ t.bumped_at_abs }}">{{ t.bumped_at }}</td>
      </tr>
      {% endfor %}
    </tbody>
  </table>
</div>