Skip to main content

max / makenotwork

9.6 KB · 181 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 {% include "partials/csrf_input.html" %}
32 <button type="submit" class="post-action-link">{% if pinned %}unpin{% else %}pin{% endif %}</button>
33 </form>
34 <form method="post" action="/p/{{ community_slug }}/{{ category_slug }}/{{ thread_id }}/lock" class="form-inline">
35 {% include "partials/csrf_input.html" %}
36 <button type="submit" class="post-action-link">{% if locked %}unlock{% else %}lock{% endif %}</button>
37 </form>
38 {% endif %}
39 {% if session_user.is_some() %}
40 {% if is_tracked %}
41 <form method="post" action="/p/{{ community_slug }}/{{ category_slug }}/{{ thread_id }}/untrack" class="form-inline">
42 {% include "partials/csrf_input.html" %}
43 <button type="submit" class="post-action-link">untrack</button>
44 </form>
45 {% else %}
46 <form method="post" action="/p/{{ community_slug }}/{{ category_slug }}/{{ thread_id }}/track" class="form-inline">
47 {% include "partials/csrf_input.html" %}
48 <button type="submit" class="post-action-link">track</button>
49 </form>
50 {% endif %}
51 {% endif %}
52 {% if can_mod_thread %}
53 <a href="/p/{{ community_slug }}/{{ category_slug }}/{{ thread_id }}/edit" class="post-action-link">edit title</a>
54 <form method="post" action="/p/{{ community_slug }}/{{ category_slug }}/{{ thread_id }}/delete" class="form-inline" data-confirm="Delete this thread? This cannot be undone.">
55 {% include "partials/csrf_input.html" %}
56 <button type="submit" class="post-action-link post-action-delete">delete thread</button>
57 </form>
58 {% endif %}
59 </span>
60 </div>
61
62 <div class="post-list">
63 {% for post in posts %}
64 <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 }}">
65 <div class="post-header">
66 <a href="/p/{{ community_slug }}/u/{{ post.author_username }}" class="post-author">{{ post.author_name }}</a>{% if post.author_has_plus_badge %}<span class="badge badge-plus" title="Fan+ subscriber">+</span>{% endif %}
67 <span>
68 <span class="post-timestamp">{{ post.timestamp }}</span>
69 {% if !post.is_removed %}
70 <span class="post-actions">
71 {% if post.can_endorse %}
72 <form method="post" action="/p/{{ community_slug }}/{{ category_slug }}/{{ thread_id }}/posts/{{ post.id }}/endorse" class="form-inline">
73 {% include "partials/csrf_input.html" %}
74 <button type="submit" class="post-action-link{% if post.is_endorsed %} endorsed{% endif %}">{% if post.is_endorsed %}endorsed{% else %}endorse{% endif %}</button>
75 </form>
76 {% endif %}
77 {% if post.endorsement_count > 0 %}
78 {% if post.is_endorsed || post.can_add_footnote || is_mod %}
79 <span class="endorsement-count">{{ post.endorsement_count }}</span>
80 {% endif %}
81 {% endif %}
82 {% if post.can_flag %}
83 <details class="flag-form-toggle">
84 <summary class="post-action-link">flag</summary>
85 <form method="post" action="/p/{{ community_slug }}/{{ category_slug }}/{{ thread_id }}/posts/{{ post.id }}/flag" class="flag-form">
86 {% include "partials/csrf_input.html" %}
87 <label><input type="radio" name="reason" value="spam" required> Spam</label>
88 <label><input type="radio" name="reason" value="rule_breaking"> Rule-breaking</label>
89 <label><input type="radio" name="reason" value="off_topic"> Off-topic</label>
90 <textarea name="detail" placeholder="Optional details..." class="textarea-short" maxlength="1024"></textarea>
91 <button type="submit" class="primary flag-btn">Submit Flag</button>
92 </form>
93 </details>
94 {% endif %}
95 {% if post.can_remove %}
96 <form method="post" action="/p/{{ community_slug }}/{{ category_slug }}/{{ thread_id }}/posts/{{ post.id }}/remove" class="form-inline" data-confirm="Remove this post? The content will be hidden but preserved for audit.">
97 {% include "partials/csrf_input.html" %}
98 <button type="submit" class="post-action-link post-action-delete">remove</button>
99 </form>
100 {% endif %}
101 </span>
102 {% endif %}
103 {% if post.can_restore %}
104 <span class="post-actions">
105 <form method="post" action="/p/{{ community_slug }}/{{ category_slug }}/{{ thread_id }}/posts/{{ post.id }}/restore" class="form-inline" data-confirm="Restore this post? It becomes visible again and any outstanding flags on it are dismissed.">
106 {% include "partials/csrf_input.html" %}
107 <button type="submit" class="post-action-link">restore</button>
108 </form>
109 </span>
110 {% endif %}
111 </span>
112 </div>
113 <div class="post-body">
114 {{ post.body_html|safe }}
115 </div>
116 {% if let Some(sig_html) = post.author_signature_html %}
117 <div class="post-signature">
118 {{ sig_html|safe }}
119 </div>
120 {% endif %}
121 {% if !post.link_previews.is_empty() %}
122 <div class="post-link-previews">
123 {% for lp in post.link_previews %}
124 <a href="{{ lp.url }}" class="link-preview-card" rel="noopener noreferrer nofollow" target="_blank">
125 {% if let Some(title) = lp.title %}<span class="lp-title">{{ title }}</span>{% endif %}
126 {% if let Some(desc) = lp.description %}<span class="lp-desc">{{ desc }}</span>{% endif %}
127 <span class="lp-url">{{ lp.url }}</span>
128 </a>
129 {% endfor %}
130 </div>
131 {% endif %}
132 {% if !post.footnotes.is_empty() %}
133 <div class="post-footnotes">
134 {% for note in post.footnotes %}
135 <div class="footnote">
136 <span class="footnote-prefix">footnote by {{ note.author_name }} ({{ note.timestamp }}):</span>
137 {{ note.body_html|safe }}
138 </div>
139 {% endfor %}
140 </div>
141 {% endif %}
142 {% if post.can_add_footnote %}
143 <details class="footnote-form-toggle">
144 <summary class="post-action-link">add footnote</summary>
145 <form method="post" action="/p/{{ community_slug }}/{{ category_slug }}/{{ thread_id }}/posts/{{ post.id }}/footnote">
146 {% include "partials/csrf_input.html" %}
147 <textarea name="body" placeholder="Add a correction or clarification..." required maxlength="65536"></textarea>
148 <button type="submit" class="primary footnote-btn">Add Footnote</button>
149 </form>
150 </details>
151 {% endif %}
152 </div>
153 {% endfor %}
154 </div>
155
156 {% include "partials/pagination.html" %}
157
158 {% if !locked %}
159 {% if session_user.is_some() %}
160 <div class="reply-section" id="reply-form">
161 <h3>Reply</h3>
162 <form method="post" action="/p/{{ community_slug }}/{{ category_slug }}/{{ thread_id }}/reply">
163 {% include "partials/csrf_input.html" %}
164 <div class="form-group">
165 <label for="reply-body">Your reply (Markdown supported)</label>
166 <textarea id="reply-body" name="body" placeholder="Write your reply..." required maxlength="65536"></textarea>
167 </div>
168 <div class="form-actions">
169 <button type="submit" class="primary">Post Reply</button>
170 </div>
171 </form>
172 </div>
173 {% else %}
174 <div class="empty-state">
175 <a href="/auth/login">Login</a> to reply.
176 </div>
177 {% endif %}
178 {% endif %}
179 </div>
180 {% endblock %}
181