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 >
8fb35df7 Andy McCall 1 month ago ↶
5
< p > < a class = " go small " href = " /admin/storage" > Storage and maintenance</ a > </ p >
19bb31ff Andy McCall 1 month ago ↶
6
{% if let Some(n) = notice %}< p class = " note " > {{ n }}</ p > {% endif %}
7
< div class = " side-layout " >
8
< div >
9
< section class = " panel " >
10
< h2 > Accounts</ h2 >
11
< table class = " small " > < tr > < th > Username</ th > < th > Email</ th > < th > Flags</ th > < th > Last seen</ th > < th > </ th > </ tr >
12
{% for a in accounts %}
34beb1a7 Andy McCall 1 month ago ↶
13
< tr > < td > < a href = " /{{ a.username }}" > {{ a.username }}</ a > </ td > < td > {{ a.email }}{% if !a.email.is_empty() %} < span class = " small mute " title = " {% if a.email_verified %}verified{% else %}not verified{% endif %}" > {% if a.email_verified %}✔{% else %}○{% endif %}</ span > {% endif %}</ 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 >
19bb31ff Andy McCall 1 month ago ↶
14
< 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 >
15
< 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 }}" >
16
{% if a.banned %}< button name = " action" value = " unban" > unban</ button > {% else %}< button name = " action" value = " ban" > ban</ button > {% endif %}
34beb1a7 Andy McCall 1 month ago ↶
17
{% if a.is_admin %}< button name = " action" value = " demote" > demote</ button > {% else %}< button name = " action" value = " promote" > make admin</ button > {% endif %}
18
{% if !a.banned %}< button name = " action" value = " reset_link" title = " A one-time password reset link to hand over" > reset link</ button > {% endif %}</ form > </ td > </ tr >
19bb31ff Andy McCall 1 month ago ↶
19
{% endfor %}
20
</ table >
21
</ section >
22
< section class = " panel " >
23
< h2 > Audit log</ h2 >
24
< table class = " small " > < tr > < th > When</ th > < th > Who</ th > < th > Action</ th > < th > Target</ th > < th > Detail</ th > </ tr >
25
{% 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 %}
26
</ table >
27
</ section >
28
</ div >
29
< aside class = " side " >
30
< h3 > Registration</ h3 >
31
< form class = " card " method = " post" action = " /admin/registration" >
32
< input type = " hidden" name = " _csrf" value = " {{ shell.csrf }}" >
33
< select name = " mode" > {% for m in ["open", "invite", "closed"] %}< option value = " {{ m }}" {% if mode.as_str () == *m %} selected {% endif %}> {{ m }}</ option > {% endfor %}</ select >
34
< button type = " submit" > SET</ button >
35
</ form >
36
< h3 > Invitations</ h3 >
37
< form class = " card " method = " post" action = " /admin/invite" > < input type = " hidden" name = " _csrf" value = " {{ shell.csrf }}" > < button type = " submit" > NEW INVITATION</ button > </ form >
38
< 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 >
39
< h3 > Organisations</ h3 >
40
< ul class = " plain " > {% for o in orgs %}< li > < a href = " /orgs/{{ o.name }}/settings" > {{ o.name }}</ a > </ li > {% endfor %}</ ul >
41
</ aside >
42
</ div >
43
{% endblock %}