Skip to main content

max / multithreaded

8.2 KB · 158 lines History Blame Raw
1 {% extends "base.html" %}
2
3 {% block title %}{{ thread_title }} — Multithreaded{% endblock %}
4
5 {% block head %}<meta name="description" content="{{ thread_title }} — discussion in {{ category_name }}, {{ 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 <a href="/p/{{ community_slug }}/{{ category_slug }}">{{ category_name }}</a>
17 <span class="sep">/</span>
18 {{ thread_title }}
19 </div>
20 <div class="page-header">
21 <h2>{{ thread_title }}</h2>
22 <span>
23 {% if pinned %}
24 <span class="badge badge-pinned">[pinned]</span>
25 {% endif %}
26 {% if locked %}
27 <span class="badge badge-locked">[locked]</span>
28 {% endif %}
29 {% if is_mod %}
30 <form method="post" action="/p/{{ community_slug }}/{{ category_slug }}/{{ thread_id }}/pin" class="form-inline">
31 <button type="submit" class="post-action-link">{% if pinned %}unpin{% else %}pin{% endif %}</button>
32 </form>
33 <form method="post" action="/p/{{ community_slug }}/{{ category_slug }}/{{ thread_id }}/lock" class="form-inline">
34 <button type="submit" class="post-action-link">{% if locked %}unlock{% else %}lock{% endif %}</button>
35 </form>
36 {% endif %}
37 {% if session_user.is_some() %}
38 {% if is_tracked %}
39 <form method="post" action="/p/{{ community_slug }}/{{ category_slug }}/{{ thread_id }}/untrack" class="form-inline">
40 <button type="submit" class="post-action-link">untrack</button>
41 </form>
42 {% else %}
43 <form method="post" action="/p/{{ community_slug }}/{{ category_slug }}/{{ thread_id }}/track" class="form-inline">
44 <button type="submit" class="post-action-link">track</button>
45 </form>
46 {% endif %}
47 {% endif %}
48 {% if can_mod_thread %}
49 <a href="/p/{{ community_slug }}/{{ category_slug }}/{{ thread_id }}/edit" class="post-action-link">edit title</a>
50 <form method="post" action="/p/{{ community_slug }}/{{ category_slug }}/{{ thread_id }}/delete" class="form-inline" onsubmit="return confirm('Delete this thread? This cannot be undone.')">
51 <button type="submit" class="post-action-link post-action-delete">delete thread</button>
52 </form>
53 {% endif %}
54 </span>
55 </div>
56
57 <div class="post-list">
58 {% for post in posts %}
59 <div class="post-item{% if post.is_op %} op{% endif %}{% if post.is_removed %} post-removed{% endif %}" id="post-{{ post.id }}" data-post-id="{{ post.id }}">
60 <div class="post-header">
61 <a href="/p/{{ community_slug }}/u/{{ post.author_username }}" class="post-author">{{ post.author_name }}</a>
62 <span>
63 <span class="post-timestamp">{{ post.timestamp }}</span>
64 {% if !post.is_removed %}
65 <span class="post-actions">
66 {% if post.can_endorse %}
67 <form method="post" action="/p/{{ community_slug }}/{{ category_slug }}/{{ thread_id }}/posts/{{ post.id }}/endorse" class="form-inline">
68 <button type="submit" class="post-action-link{% if post.is_endorsed %} endorsed{% endif %}">{% if post.is_endorsed %}endorsed{% else %}endorse{% endif %}</button>
69 </form>
70 {% endif %}
71 {% if post.endorsement_count > 0 %}
72 {% if post.is_endorsed || post.can_add_footnote || is_mod %}
73 <span class="endorsement-count">{{ post.endorsement_count }}</span>
74 {% endif %}
75 {% endif %}
76 {% if post.can_flag %}
77 <details class="flag-form-toggle">
78 <summary class="post-action-link">flag</summary>
79 <form method="post" action="/p/{{ community_slug }}/{{ category_slug }}/{{ thread_id }}/posts/{{ post.id }}/flag" class="flag-form">
80 <label><input type="radio" name="reason" value="spam" required> Spam</label>
81 <label><input type="radio" name="reason" value="rule_breaking"> Rule-breaking</label>
82 <label><input type="radio" name="reason" value="off_topic"> Off-topic</label>
83 <textarea name="detail" placeholder="Optional details..." class="textarea-short" maxlength="1024"></textarea>
84 <button type="submit" class="primary flag-btn">Submit Flag</button>
85 </form>
86 </details>
87 {% endif %}
88 {% if post.can_remove %}
89 <form method="post" action="/p/{{ community_slug }}/{{ category_slug }}/{{ thread_id }}/posts/{{ post.id }}/remove" class="form-inline" onsubmit="return confirm('Remove this post? The content will be hidden but preserved for audit.')">
90 <button type="submit" class="post-action-link post-action-delete">remove</button>
91 </form>
92 {% endif %}
93 </span>
94 {% endif %}
95 </span>
96 </div>
97 <div class="post-body">
98 {{ post.body_html|safe }}
99 </div>
100 {% if !post.link_previews.is_empty() %}
101 <div class="post-link-previews">
102 {% for lp in post.link_previews %}
103 <a href="{{ lp.url }}" class="link-preview-card" rel="noopener noreferrer nofollow" target="_blank">
104 {% if let Some(title) = lp.title %}<span class="lp-title">{{ title }}</span>{% endif %}
105 {% if let Some(desc) = lp.description %}<span class="lp-desc">{{ desc }}</span>{% endif %}
106 <span class="lp-url">{{ lp.url }}</span>
107 </a>
108 {% endfor %}
109 </div>
110 {% endif %}
111 {% if !post.footnotes.is_empty() %}
112 <div class="post-footnotes">
113 {% for note in post.footnotes %}
114 <div class="footnote">
115 <span class="footnote-prefix">footnote by {{ note.author_name }} ({{ note.timestamp }}):</span>
116 {{ note.body_html|safe }}
117 </div>
118 {% endfor %}
119 </div>
120 {% endif %}
121 {% if post.can_add_footnote %}
122 <details class="footnote-form-toggle">
123 <summary class="post-action-link">add footnote</summary>
124 <form method="post" action="/p/{{ community_slug }}/{{ category_slug }}/{{ thread_id }}/posts/{{ post.id }}/footnote">
125 <textarea name="body" placeholder="Add a correction or clarification..." required maxlength="65536"></textarea>
126 <button type="submit" class="primary footnote-btn">Add Footnote</button>
127 </form>
128 </details>
129 {% endif %}
130 </div>
131 {% endfor %}
132 </div>
133
134 {% include "partials/pagination.html" %}
135
136 {% if !locked %}
137 {% if session_user.is_some() %}
138 <div class="reply-section" id="reply-form">
139 <h3>Reply</h3>
140 <form method="post" action="/p/{{ community_slug }}/{{ category_slug }}/{{ thread_id }}/reply">
141 <div class="form-group">
142 <label for="reply-body">Your reply (Markdown supported)</label>
143 <textarea id="reply-body" name="body" placeholder="Write your reply..." required maxlength="65536"></textarea>
144 </div>
145 <div class="form-actions">
146 <button type="submit" class="primary">Post Reply</button>
147 </div>
148 </form>
149 </div>
150 {% else %}
151 <div class="empty-state">
152 <a href="/auth/login">Login</a> to reply.
153 </div>
154 {% endif %}
155 {% endif %}
156 </div>
157 {% endblock %}
158