| 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 |
<div class="form-row"> |
| 27 |
<div class="form-group"> |
| 28 |
<label for="ban-username">Username</label> |
| 29 |
<input type="text" id="ban-username" name="username" required placeholder="username"> |
| 30 |
</div> |
| 31 |
<div class="form-group"> |
| 32 |
<label for="ban-duration">Duration</label> |
| 33 |
<select id="ban-duration" name="duration"> |
| 34 |
<option value="permanent">Permanent</option> |
| 35 |
<option value="1h">1 hour</option> |
| 36 |
<option value="1d">1 day</option> |
| 37 |
<option value="7d">7 days</option> |
| 38 |
<option value="30d">30 days</option> |
| 39 |
</select> |
| 40 |
</div> |
| 41 |
</div> |
| 42 |
<div class="form-group"> |
| 43 |
<label for="ban-reason">Reason (optional)</label> |
| 44 |
<textarea id="ban-reason" name="reason" rows="2" class="textarea-short" maxlength="1024"></textarea> |
| 45 |
</div> |
| 46 |
<div class="form-actions"> |
| 47 |
<button type="submit" class="primary">Ban User</button> |
| 48 |
</div> |
| 49 |
</form> |
| 50 |
</div> |
| 51 |
|
| 52 |
<div class="settings-section"> |
| 53 |
<h3>Mute User</h3> |
| 54 |
<form method="post" action="/p/{{ community_slug }}/moderation/mute" class="form-container"> |
| 55 |
<div class="form-row"> |
| 56 |
<div class="form-group"> |
| 57 |
<label for="mute-username">Username</label> |
| 58 |
<input type="text" id="mute-username" name="username" required placeholder="username"> |
| 59 |
</div> |
| 60 |
<div class="form-group"> |
| 61 |
<label for="mute-duration">Duration</label> |
| 62 |
<select id="mute-duration" name="duration"> |
| 63 |
<option value="permanent">Permanent</option> |
| 64 |
<option value="1h">1 hour</option> |
| 65 |
<option value="1d">1 day</option> |
| 66 |
<option value="7d">7 days</option> |
| 67 |
<option value="30d">30 days</option> |
| 68 |
</select> |
| 69 |
</div> |
| 70 |
</div> |
| 71 |
<div class="form-group"> |
| 72 |
<label for="mute-reason">Reason (optional)</label> |
| 73 |
<textarea id="mute-reason" name="reason" rows="2" class="textarea-short" maxlength="1024"></textarea> |
| 74 |
</div> |
| 75 |
<div class="form-actions"> |
| 76 |
<button type="submit" class="primary">Mute User</button> |
| 77 |
</div> |
| 78 |
</form> |
| 79 |
</div> |
| 80 |
|
| 81 |
<div class="settings-section"> |
| 82 |
<h3>Pending Flags</h3> |
| 83 |
{% if pending_flags.is_empty() %} |
| 84 |
<div class="empty-state">No pending flags.</div> |
| 85 |
{% else %} |
| 86 |
<table class="settings-table"> |
| 87 |
<thead> |
| 88 |
<tr> |
| 89 |
<th>Thread</th> |
| 90 |
<th>Flagged by</th> |
| 91 |
<th>Reason</th> |
| 92 |
<th>Detail</th> |
| 93 |
<th>When</th> |
| 94 |
<th>Actions</th> |
| 95 |
</tr> |
| 96 |
</thead> |
| 97 |
<tbody> |
| 98 |
{% for flag in pending_flags %} |
| 99 |
<tr> |
| 100 |
<td><a href="/p/{{ community_slug }}/{{ flag.category_slug }}/{{ flag.thread_id }}#post-{{ flag.post_id }}">{{ flag.thread_title }}</a></td> |
| 101 |
<td>{{ flag.flagger_username }}</td> |
| 102 |
<td>{{ flag.reason }}</td> |
| 103 |
<td>{{ flag.detail.as_deref().unwrap_or("-") }}</td> |
| 104 |
<td class="settings-mono">{{ flag.created }}</td> |
| 105 |
<td class="settings-actions"> |
| 106 |
<form method="post" action="/p/{{ community_slug }}/moderation/flags/{{ flag.flag_id }}/dismiss" class="form-inline"> |
| 107 |
<button type="submit" class="post-action-link">dismiss</button> |
| 108 |
</form> |
| 109 |
<form method="post" action="/p/{{ community_slug }}/moderation/flags/{{ flag.flag_id }}/remove" class="form-inline" onsubmit="return confirm('Remove this post and resolve all flags on it?')"> |
| 110 |
<button type="submit" class="post-action-link post-action-delete">remove post</button> |
| 111 |
</form> |
| 112 |
</td> |
| 113 |
</tr> |
| 114 |
{% endfor %} |
| 115 |
</tbody> |
| 116 |
</table> |
| 117 |
{% endif %} |
| 118 |
</div> |
| 119 |
|
| 120 |
<div class="settings-section"> |
| 121 |
<h3>Active Bans & Mutes</h3> |
| 122 |
{% if bans.is_empty() %} |
| 123 |
<div class="empty-state">No active bans or mutes.</div> |
| 124 |
{% else %} |
| 125 |
<table class="settings-table"> |
| 126 |
<thead> |
| 127 |
<tr> |
| 128 |
<th>User</th> |
| 129 |
<th>Type</th> |
| 130 |
<th>Reason</th> |
| 131 |
<th>Expires</th> |
| 132 |
<th>By</th> |
| 133 |
<th>Actions</th> |
| 134 |
</tr> |
| 135 |
</thead> |
| 136 |
<tbody> |
| 137 |
{% for ban in bans %} |
| 138 |
<tr> |
| 139 |
<td>{{ ban.username }}</td> |
| 140 |
<td> |
| 141 |
{% if ban.ban_type == "ban" %} |
| 142 |
<span class="badge badge-ban">ban</span> |
| 143 |
{% else %} |
| 144 |
<span class="badge badge-mute-type">mute</span> |
| 145 |
{% endif %} |
| 146 |
</td> |
| 147 |
<td>{{ ban.reason.as_deref().unwrap_or("-") }}</td> |
| 148 |
<td class="settings-mono">{{ ban.expires.as_deref().unwrap_or("never") }}</td> |
| 149 |
<td class="settings-mono">{{ ban.banned_by }}</td> |
| 150 |
<td class="settings-actions"> |
| 151 |
{% if ban.ban_type == "ban" %} |
| 152 |
<form method="post" action="/p/{{ community_slug }}/moderation/unban" class="form-inline"> |
| 153 |
<input type="hidden" name="username" value="{{ ban.username }}"> |
| 154 |
<button type="submit" class="post-action-link">unban</button> |
| 155 |
</form> |
| 156 |
{% else %} |
| 157 |
<form method="post" action="/p/{{ community_slug }}/moderation/unmute" class="form-inline"> |
| 158 |
<input type="hidden" name="username" value="{{ ban.username }}"> |
| 159 |
<button type="submit" class="post-action-link">unmute</button> |
| 160 |
</form> |
| 161 |
{% endif %} |
| 162 |
</td> |
| 163 |
</tr> |
| 164 |
{% endfor %} |
| 165 |
</tbody> |
| 166 |
</table> |
| 167 |
{% endif %} |
| 168 |
</div> |
| 169 |
</div> |
| 170 |
{% endblock %} |
| 171 |
|