Skip to main content

max / multithreaded

4.5 KB · 82 lines History Blame Raw
1 {% extends "base.html" %}
2
3 {% block title %}{{ category_name }} — {{ community_name }} — Multithreaded{% endblock %}
4
5 {% block head %}<meta name="description" content="{{ category_name }} threads in {{ community_name }}.">{% endblock %}
6
7 {% block header %}{% include "partials/site_header.html" %}{% endblock %}
8
9 {% block content %}
10 <div class="container">
11 <div class="breadcrumb">
12 <a href="/">Forums</a>
13 <span class="sep">/</span>
14 <a href="/p/{{ community_slug }}">{{ community_name }}</a>
15 <span class="sep">/</span>
16 {{ category_name }}
17 </div>
18 <div class="page-header">
19 <h2>{{ category_name }}</h2>
20 {% if session_user.is_some() %}
21 <a href="/p/{{ community_slug }}/{{ category_slug }}/new" class="btn-primary">New Thread</a>
22 {% endif %}
23 </div>
24 {% if !available_tags.is_empty() %}
25 <div class="tag-filter">
26 <span class="tag-filter-label">Tags:</span>
27 <a href="?sort={{ sort_column }}&order={{ sort_order }}" class="tag-chip{% if active_tag.is_none() %} tag-active{% endif %}">all</a>
28 {% for tag in available_tags %}
29 <a href="?tag={{ tag.slug }}&sort={{ sort_column }}&order={{ sort_order }}" class="tag-chip{% if active_tag.as_deref() == Some(tag.slug.as_str()) %} tag-active{% endif %}">{{ tag.name }}</a>
30 {% endfor %}
31 </div>
32 {% endif %}
33 {% if threads.is_empty() %}
34 <div class="empty-state">No threads yet. Start one.</div>
35 {% else %}
36 <table class="data-table">
37 <thead>
38 <tr>
39 <th>Thread</th>
40 <th class="col-author">Author</th>
41 <th class="col-replies sortable{% if sort_column == "replies" %} sort-active{% endif %}">
42 <a href="?sort=replies&order={% if sort_column == "replies" && sort_order == "desc" %}asc{% else %}desc{% endif %}{% if let Some(tag) = active_tag %}&tag={{ tag }}{% endif %}">Replies{% if sort_column == "replies" %}{% if sort_order == "desc" %} ↓{% else %} ↑{% endif %}{% endif %}</a>
43 </th>
44 <th class="col-activity sortable{% if sort_column == "activity" %} sort-active{% endif %}">
45 <a href="?sort=activity&order={% if sort_column == "activity" && sort_order == "desc" %}asc{% else %}desc{% endif %}{% if let Some(tag) = active_tag %}&tag={{ tag }}{% endif %}">Last Activity{% if sort_column == "activity" %}{% if sort_order == "desc" %} ↓{% else %} ↑{% endif %}{% endif %}</a>
46 </th>
47 </tr>
48 </thead>
49 <tbody>
50 {% for t in threads %}
51 <tr{% if t.pinned && t.has_mention %} class="pinned mentioned"{% else if t.pinned %} class="pinned"{% else if t.has_mention %} class="mentioned"{% endif %} data-thread-id="{{ t.id }}" data-reply-count="{{ t.reply_count }}">
52 <td class="thread-title">
53 {% if t.pinned %}<span class="badge badge-pinned">[pinned]</span> {% endif %}
54 {% if t.locked %}<span class="badge badge-locked">[locked]</span> {% endif %}
55 {% if t.has_mention %}<span class="badge badge-mention">@</span> {% endif %}
56 <a href="/p/{{ community_slug }}/{{ category_slug }}/{{ t.id }}">{{ t.title }}</a>
57 {% for tag in t.tags %}
58 <span class="tag-badge">{{ tag.name }}</span>
59 {% endfor %}
60 </td>
61 <td class="col-author"><a href="/p/{{ community_slug }}/u/{{ t.author_username }}">{{ t.author_name }}</a></td>
62 <td class="col-replies">{{ t.reply_count }}</td>
63 <td class="col-activity">{{ t.last_activity }}</td>
64 </tr>
65 {% endfor %}
66 </tbody>
67 </table>
68 {% if pagination.total_pages > 1 %}
69 <nav class="pagination" aria-label="Page navigation">
70 {% if pagination.has_prev %}
71 <a href="?page={{ pagination.current_page - 1 }}&sort={{ sort_column }}&order={{ sort_order }}{% if let Some(tag) = active_tag %}&tag={{ tag }}{% endif %}" class="pagination-link">Previous</a>
72 {% endif %}
73 <span class="pagination-info">Page {{ pagination.current_page }} of {{ pagination.total_pages }}</span>
74 {% if pagination.has_next %}
75 <a href="?page={{ pagination.current_page + 1 }}&sort={{ sort_column }}&order={{ sort_order }}{% if let Some(tag) = active_tag %}&tag={{ tag }}{% endif %}" class="pagination-link">Next</a>
76 {% endif %}
77 </nav>
78 {% endif %}
79 {% endif %}
80 </div>
81 {% endblock %}
82