Skip to main content

max / makenotwork

9.0 KB · 173 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 </span>
104 </div>
105 <div class="post-body">
106 {{ post.body_html|safe }}
107 </div>
108 {% if let Some(sig_html) = post.author_signature_html %}
109 <div class="post-signature">
110 {{ sig_html|safe }}
111 </div>
112 {% endif %}
113 {% if !post.link_previews.is_empty() %}
114 <div class="post-link-previews">
115 {% for lp in post.link_previews %}
116 <a href="{{ lp.url }}" class="link-preview-card" rel="noopener noreferrer nofollow" target="_blank">
117 {% if let Some(title) = lp.title %}<span class="lp-title">{{ title }}</span>{% endif %}
118 {% if let Some(desc) = lp.description %}<span class="lp-desc">{{ desc }}</span>{% endif %}
119 <span class="lp-url">{{ lp.url }}</span>
120 </a>
121 {% endfor %}
122 </div>
123 {% endif %}
124 {% if !post.footnotes.is_empty() %}
125 <div class="post-footnotes">
126 {% for note in post.footnotes %}
127 <div class="footnote">
128 <span class="footnote-prefix">footnote by {{ note.author_name }} ({{ note.timestamp }}):</span>
129 {{ note.body_html|safe }}
130 </div>
131 {% endfor %}
132 </div>
133 {% endif %}
134 {% if post.can_add_footnote %}
135 <details class="footnote-form-toggle">
136 <summary class="post-action-link">add footnote</summary>
137 <form method="post" action="/p/{{ community_slug }}/{{ category_slug }}/{{ thread_id }}/posts/{{ post.id }}/footnote">
138 {% include "partials/csrf_input.html" %}
139 <textarea name="body" placeholder="Add a correction or clarification..." required maxlength="65536"></textarea>
140 <button type="submit" class="primary footnote-btn">Add Footnote</button>
141 </form>
142 </details>
143 {% endif %}
144 </div>
145 {% endfor %}
146 </div>
147
148 {% include "partials/pagination.html" %}
149
150 {% if !locked %}
151 {% if session_user.is_some() %}
152 <div class="reply-section" id="reply-form">
153 <h3>Reply</h3>
154 <form method="post" action="/p/{{ community_slug }}/{{ category_slug }}/{{ thread_id }}/reply">
155 {% include "partials/csrf_input.html" %}
156 <div class="form-group">
157 <label for="reply-body">Your reply (Markdown supported)</label>
158 <textarea id="reply-body" name="body" placeholder="Write your reply..." required maxlength="65536"></textarea>
159 </div>
160 <div class="form-actions">
161 <button type="submit" class="primary">Post Reply</button>
162 </div>
163 </form>
164 </div>
165 {% else %}
166 <div class="empty-state">
167 <a href="/auth/login">Login</a> to reply.
168 </div>
169 {% endif %}
170 {% endif %}
171 </div>
172 {% endblock %}
173