19bb31ff Andy McCall 1 month ago ↶
1
{% extends "base.html" %}
2
{% block title %}Administration{% endblock %}
3
{% block content %}
4
< div class = " head " > < h1 > Administration < small > {{ accounts.len() }} accounts · {{ orgs.len() }} organisations · {{ repos }} repositories</ small > </ h1 > </ div >
5
{% if let Some(n) = notice %}< p class = " note " > {{ n }}</ p > {% endif %}
6
< div class = " side-layout " >
7
< div >
8
< section class = " panel " >
9
< h2 > Accounts</ h2 >
10
< table class = " small " > < tr > < th > Username</ th > < th > Email</ th > < th > Flags</ th > < th > Last seen</ th > < th > </ th > </ tr >
11
{% for a in accounts %}
12
< tr > < td > < a href = " /{{ a.username }}" > {{ a.username }}</ a > </ td > < td > {{ a.email }}</ td > < td > {% if a.is_admin %}< span class = " tag " > admin</ span > {% endif %}{% if a.banned %} < span class = " tag bad " > banned</ span > {% endif %}{% if a.totp_enabled() %} < span class = " tag " > 2fa</ span > {% endif %}</ td >
13
< td > {% if a.last_seen_ms > 0 %}< time title = " {{ a.last_seen_ms|when_i }}" > {{ a.last_seen_ms|ago_i }}</ time > {% else %}< span class = " mute " > never</ span > {% endif %}</ td >
14
< td > < form class = " tiny " method = " post" action = " /admin/account" > < input type = " hidden" name = " _csrf" value = " {{ shell.csrf }}" > < input type = " hidden" name = " username" value = " {{ a.username }}" >
15
{% if a.banned %}< button name = " action" value = " unban" > unban</ button > {% else %}< button name = " action" value = " ban" > ban</ button > {% endif %}
16
{% if a.is_admin %}< button name = " action" value = " demote" > demote</ button > {% else %}< button name = " action" value = " promote" > make admin</ button > {% endif %}</ form > </ td > </ tr >
17
{% endfor %}
18
</ table >
19
</ section >
20
< section class = " panel " >
21
< h2 > Audit log</ h2 >
22
< table class = " small " > < tr > < th > When</ th > < th > Who</ th > < th > Action</ th > < th > Target</ th > < th > Detail</ th > </ tr >
23
{% for r in audit %}< tr > < td > < time title = " {{ r.at_ms|when_i }}" > {{ r.at_ms|ago_i }}</ time > </ td > < td > {{ r.actor }}</ td > < td > {{ r.action }}</ td > < td > {{ r.target }}</ td > < td class = " mute " > {{ r.detail }}</ td > </ tr > {% endfor %}
24
</ table >
25
</ section >
26
</ div >
27
< aside class = " side " >
28
< h3 > Registration</ h3 >
29
< form class = " card " method = " post" action = " /admin/registration" >
30
< input type = " hidden" name = " _csrf" value = " {{ shell.csrf }}" >
31
< select name = " mode" > {% for m in ["open", "invite", "closed"] %}< option value = " {{ m }}" {% if mode.as_str () == *m %} selected {% endif %}> {{ m }}</ option > {% endfor %}</ select >
32
< button type = " submit" > SET</ button >
33
</ form >
34
< h3 > Invitations</ h3 >
35
< form class = " card " method = " post" action = " /admin/invite" > < input type = " hidden" name = " _csrf" value = " {{ shell.csrf }}" > < button type = " submit" > NEW INVITATION</ button > </ form >
36
< ul class = " plain small " > {% for (code, used, at) in invitations %}< li > < code > {{ code }}</ code > {% if used.is_some() %}< span class = " mute " > used</ span > {% else %}< a href = " /register?invite={{ code }}" > link</ a > {% endif %} · {{ at|ago_i }}</ li > {% endfor %}</ ul >
37
< h3 > Organisations</ h3 >
38
< ul class = " plain " > {% for o in orgs %}< li > < a href = " /orgs/{{ o.name }}/settings" > {{ o.name }}</ a > </ li > {% endfor %}</ ul >
39
</ aside >
40
</ div >
41
{% endblock %}