Skip to main content

max / makenotwork

1.9 KB · 48 lines History Blame Raw
1 {%- import "partials/_ui.html" as ui -%}
2 {% if appeals.is_empty() %}
3 {% call ui::empty_state("", "No pending appeals.") %}
4 {% else %}
5 <div class="scroll-x">
6 <table class="compact-table minw-700" aria-label="Pending appeals">
7 <thead>
8 <tr>
9 <th>User</th>
10 <th>Suspension Reason</th>
11 <th>Appeal</th>
12 <th>Submitted</th>
13 <th>Actions</th>
14 </tr>
15 </thead>
16 <tbody>
17 {% for appeal in appeals %}
18 <tr>
19 <td>
20 {{ appeal.username }}
21 <div class="text-xs dimmed">{{ appeal.email }}</div>
22 </td>
23 <td class="admin-entries-reason">
24 {{ appeal.suspension_reason.as_deref().unwrap_or("No reason given") }}
25 </td>
26 <td class="admin-entries-appeal">{{ appeal.appeal_text }}</td>
27 <td class="text-sm nowrap">{{ appeal.appeal_submitted_at }}</td>
28 <td>
29 <form class="decide-form"
30 hx-post="/api/admin/appeals/{{ appeal.user_id }}/decide"
31 hx-target="#appeals-table"
32 hx-swap="innerHTML">
33 <textarea name="response" placeholder="Response to user..." rows="2" required class="admin-entries-decide-textarea"></textarea>
34 <div class="admin-entries-decide-actions">
35 <button type="submit" name="decision" value="approved" class="btn-primary small"
36 hx-confirm="Approve this appeal and unsuspend the user?">Approve</button>
37 <button type="submit" name="decision" value="denied" class="btn-danger small"
38 hx-confirm="Deny this appeal?">Deny</button>
39 </div>
40 </form>
41 </td>
42 </tr>
43 {% endfor %}
44 </tbody>
45 </table>
46 </div>
47 {% endif %}
48