Skip to main content

max / makenotwork

8.0 KB · 183 lines History Blame Raw
1 {% extends "base.html" %}
2
3 {% block title %}Moderation — {{ community_name }} — Multithreaded{% endblock %}
4
5 {% block head %}<meta name="robots" content="noindex">{% 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 Moderation
17 </div>
18 <div class="page-header">
19 <h1>Moderation</h1>
20 <a href="/p/{{ community_slug }}/moderation/log" class="btn-secondary">mod log</a>
21 </div>
22
23 <div class="settings-section">
24 <h3>Ban User</h3>
25 <form method="post" action="/p/{{ community_slug }}/moderation/ban" class="form-container">
26 {% include "partials/csrf_input.html" %}
27 <div class="form-row">
28 <div class="form-group">
29 <label for="ban-username">Username</label>
30 <input type="text" id="ban-username" name="username" required placeholder="username">
31 </div>
32 <div class="form-group">
33 <label for="ban-duration">Duration</label>
34 <select id="ban-duration" name="duration">
35 <option value="permanent">Permanent</option>
36 <option value="1h">1 hour</option>
37 <option value="1d">1 day</option>
38 <option value="7d">7 days</option>
39 <option value="30d">30 days</option>
40 </select>
41 </div>
42 </div>
43 <div class="form-group">
44 <label for="ban-reason">Reason (optional)</label>
45 <textarea id="ban-reason" name="reason" rows="2" class="textarea-short" maxlength="1024"></textarea>
46 </div>
47 <div class="form-actions">
48 <button type="submit" class="primary">Ban User</button>
49 </div>
50 </form>
51 </div>
52
53 <div class="settings-section">
54 <h3>Mute User</h3>
55 <form method="post" action="/p/{{ community_slug }}/moderation/mute" class="form-container">
56 {% include "partials/csrf_input.html" %}
57 <div class="form-row">
58 <div class="form-group">
59 <label for="mute-username">Username</label>
60 <input type="text" id="mute-username" name="username" required placeholder="username">
61 </div>
62 <div class="form-group">
63 <label for="mute-duration">Duration</label>
64 <select id="mute-duration" name="duration">
65 <option value="permanent">Permanent</option>
66 <option value="1h">1 hour</option>
67 <option value="1d">1 day</option>
68 <option value="7d">7 days</option>
69 <option value="30d">30 days</option>
70 </select>
71 </div>
72 </div>
73 <div class="form-group">
74 <label for="mute-reason">Reason (optional)</label>
75 <textarea id="mute-reason" name="reason" rows="2" class="textarea-short" maxlength="1024"></textarea>
76 </div>
77 <div class="form-actions">
78 <button type="submit" class="primary">Mute User</button>
79 </div>
80 </form>
81 </div>
82
83 <div class="settings-section">
84 <h3>Pending Flags</h3>
85 {% if pending_flags.is_empty() %}
86 <div class="empty-state">No pending flags.</div>
87 {% else %}
88 <table class="settings-table">
89 <thead>
90 <tr>
91 <th>Thread</th>
92 <th>Flagged by</th>
93 <th>Reason</th>
94 <th>Detail</th>
95 <th>When</th>
96 <th>Actions</th>
97 </tr>
98 </thead>
99 <tbody>
100 {% for flag in pending_flags %}
101 <tr>
102 <td><a href="/p/{{ community_slug }}/{{ flag.category_slug }}/{{ flag.thread_id }}#post-{{ flag.post_id }}">{{ flag.thread_title }}</a></td>
103 <td>{{ flag.flagger_username }}</td>
104 <td>{{ flag.reason }}</td>
105 <td>{{ flag.detail.as_deref().unwrap_or("-") }}</td>
106 <td class="settings-mono">{{ flag.created }}</td>
107 <td class="settings-actions">
108 <form method="post" action="/p/{{ community_slug }}/moderation/flags/{{ flag.flag_id }}/dismiss" class="form-inline">
109 {% include "partials/csrf_input.html" %}
110 <button type="submit" class="post-action-link">dismiss</button>
111 </form>
112 <form method="post" action="/p/{{ community_slug }}/moderation/flags/{{ flag.flag_id }}/remove" class="form-inline" data-confirm="Remove this post and resolve all flags on it?">
113 {% include "partials/csrf_input.html" %}
114 <button type="submit" class="post-action-link post-action-delete">remove post</button>
115 </form>
116 </td>
117 </tr>
118 {% endfor %}
119 </tbody>
120 </table>
121 {% if flags_truncated %}
122 <p class="empty-state">Showing the most recent flags only. Resolve some to reveal older ones.</p>
123 {% endif %}
124 {% endif %}
125 </div>
126
127 <div class="settings-section">
128 <h3>Active Bans &amp; Mutes</h3>
129 {% if bans.is_empty() %}
130 <div class="empty-state">No active bans or mutes.</div>
131 {% else %}
132 <table class="settings-table">
133 <thead>
134 <tr>
135 <th>User</th>
136 <th>Type</th>
137 <th>Reason</th>
138 <th>Expires</th>
139 <th>By</th>
140 <th>Actions</th>
141 </tr>
142 </thead>
143 <tbody>
144 {% for ban in bans %}
145 <tr>
146 <td>{{ ban.username }}</td>
147 <td>
148 {% if ban.ban_type == "ban" %}
149 <span class="badge badge-ban">ban</span>
150 {% else %}
151 <span class="badge badge-mute-type">mute</span>
152 {% endif %}
153 </td>
154 <td>{{ ban.reason.as_deref().unwrap_or("-") }}</td>
155 <td class="settings-mono">{{ ban.expires.as_deref().unwrap_or("never") }}</td>
156 <td class="settings-mono">{{ ban.banned_by }}</td>
157 <td class="settings-actions">
158 {% if ban.ban_type == "ban" %}
159 <form method="post" action="/p/{{ community_slug }}/moderation/unban" class="form-inline">
160 {% include "partials/csrf_input.html" %}
161 <input type="hidden" name="username" value="{{ ban.username }}">
162 <button type="submit" class="post-action-link">unban</button>
163 </form>
164 {% else %}
165 <form method="post" action="/p/{{ community_slug }}/moderation/unmute" class="form-inline">
166 {% include "partials/csrf_input.html" %}
167 <input type="hidden" name="username" value="{{ ban.username }}">
168 <button type="submit" class="post-action-link">unmute</button>
169 </form>
170 {% endif %}
171 </td>
172 </tr>
173 {% endfor %}
174 </tbody>
175 </table>
176 {% if bans_truncated %}
177 <p class="empty-state">Showing the most recent bans and mutes only. Lift some to reveal older ones.</p>
178 {% endif %}
179 {% endif %}
180 </div>
181 </div>
182 {% endblock %}
183