Skip to main content

max / makenotwork

5.1 KB · 127 lines History Blame Raw
1 {% extends "base.html" %}
2
3 {% block title %}Admin — 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 Admin
15 </div>
16 <div class="page-header">
17 <h1>Platform Admin</h1>
18 </div>
19
20 <div class="settings-section">
21 <h3>User Search</h3>
22 <form method="get" action="/_admin" class="form-container search-form">
23 <div class="form-group flex-1">
24 <label for="user-search">Username</label>
25 <input type="text" id="user-search" name="q" value="{{ search_query }}" placeholder="Search users...">
26 </div>
27 <button type="submit" class="primary">Search</button>
28 </form>
29 </div>
30
31 {% if !users.is_empty() %}
32 <div class="settings-section">
33 <h3>Users</h3>
34 <table class="settings-table">
35 <thead>
36 <tr>
37 <th>Username</th>
38 <th>Display Name</th>
39 <th>Status</th>
40 <th>Actions</th>
41 </tr>
42 </thead>
43 <tbody>
44 {% for user in users %}
45 <tr>
46 <td class="settings-mono">{{ user.username }}</td>
47 <td>{{ user.display_name.as_deref().unwrap_or("-") }}</td>
48 <td>
49 {% if user.is_suspended %}
50 <span class="badge badge-ban">suspended</span>
51 {% else %}
52 <span class="badge badge-role-member">active</span>
53 {% endif %}
54 </td>
55 <td class="settings-actions">
56 {% if user.is_suspended %}
57 <form method="post" action="/_admin/users/{{ user.id }}/unsuspend" class="form-inline">
58 {% include "partials/csrf_input.html" %}
59 <button type="submit" class="post-action-link">unsuspend</button>
60 </form>
61 {% else %}
62 <form method="post" action="/_admin/users/{{ user.id }}/suspend" class="form-inline-row">
63 {% include "partials/csrf_input.html" %}
64 <input type="text" name="reason" placeholder="Reason" class="input-compact">
65 <button type="submit" class="post-action-link post-action-delete">suspend</button>
66 </form>
67 {% endif %}
68 </td>
69 </tr>
70 {% endfor %}
71 </tbody>
72 </table>
73 </div>
74 {% endif %}
75
76 <div class="settings-section">
77 <h3>Communities</h3>
78 {% if communities_truncated %}
79 <div class="empty-state">Showing the first {{ communities.len() }} communities; more exist. Use search to find a specific one.</div>
80 {% endif %}
81 {% if communities.is_empty() %}
82 <div class="empty-state">No communities.</div>
83 {% else %}
84 <table class="settings-table">
85 <thead>
86 <tr>
87 <th>Name</th>
88 <th>Slug</th>
89 <th>Status</th>
90 <th>Actions</th>
91 </tr>
92 </thead>
93 <tbody>
94 {% for c in communities %}
95 <tr>
96 <td><a href="/_admin/communities/{{ c.slug }}">{{ c.name }}</a></td>
97 <td class="settings-mono">{{ c.slug }}</td>
98 <td>
99 {% if c.is_suspended %}
100 <span class="badge badge-ban">suspended</span>
101 {% else %}
102 <span class="badge badge-role-member">active</span>
103 {% endif %}
104 </td>
105 <td class="settings-actions">
106 {% if c.is_suspended %}
107 <form method="post" action="/_admin/communities/{{ c.id }}/unsuspend" class="form-inline">
108 {% include "partials/csrf_input.html" %}
109 <button type="submit" class="post-action-link">unsuspend</button>
110 </form>
111 {% else %}
112 <form method="post" action="/_admin/communities/{{ c.id }}/suspend" class="form-inline-row">
113 {% include "partials/csrf_input.html" %}
114 <input type="text" name="reason" placeholder="Reason" class="input-compact">
115 <button type="submit" class="post-action-link post-action-delete">suspend</button>
116 </form>
117 {% endif %}
118 </td>
119 </tr>
120 {% endfor %}
121 </tbody>
122 </table>
123 {% endif %}
124 </div>
125 </div>
126 {% endblock %}
127