Skip to main content

max / makenotwork

1.7 KB · 41 lines History Blame Raw
1 {% if entries.is_empty() %}
2 <p>No open requests.</p>
3 {% else %}
4 <div class="table-scroll">
5 <table class="admin-table">
6 <thead>
7 <tr>
8 <th>Creator</th>
9 <th>Has</th>
10 <th>Asked for</th>
11 <th>Why</th>
12 <th>Asked</th>
13 <th>Decide</th>
14 </tr>
15 </thead>
16 <tbody>
17 {% for e in entries %}
18 <tr>
19 <td>{{ e.username }}<br><span class="muted text-sm">{{ e.email }}</span></td>
20 <td>{{ e.current_cap }}</td>
21 <td>{{ e.requested_cap }}</td>
22 <td>{{ e.reason }}</td>
23 <td>{{ e.created_at }}</td>
24 <td>
25 <form hx-post="/api/admin/mail-caps/{{ e.id }}/grant" hx-target="#mail-cap-entries" hx-swap="innerHTML" class="inline-form">
26 {% if let Some(token) = csrf_token %}<input type="hidden" name="_csrf" value="{{ token }}">{% endif %}
27 <input type="number" name="granted_cap" value="{{ e.requested_cap }}" min="1" max="1000000" required>
28 <button type="submit" class="btn-secondary">Grant</button>
29 </form>
30 <form hx-post="/api/admin/mail-caps/{{ e.id }}/deny" hx-target="#mail-cap-entries" hx-swap="innerHTML" class="inline-form">
31 {% if let Some(token) = csrf_token %}<input type="hidden" name="_csrf" value="{{ token }}">{% endif %}
32 <button type="submit" class="btn-secondary">Deny</button>
33 </form>
34 </td>
35 </tr>
36 {% endfor %}
37 </tbody>
38 </table>
39 </div>
40 {% endif %}
41