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 %}
34beb1a7 Andy McCall 1 month ago ↶
12
< 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 ↶
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 %}
34beb1a7 Andy McCall 1 month ago ↶
16
{% if a.is_admin %}< button name = " action" value = " demote" > demote</ button > {% else %}< button name = " action" value = " promote" > make admin</ button > {% endif %}
17
{% 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 ↶
18
{% endfor %}
19
</ table >
20
</ section >
21
< section class = " panel " >
22
< h2 > Audit log</ h2 >
23
< table class = " small " > < tr > < th > When</ th > < th > Who</ th > < th > Action</ th > < th > Target</ th > < th > Detail</ th > </ tr >
24
{% 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 %}
25
</ table >
26
</ section >
27
</ div >
28
< aside class = " side " >
29
< h3 > Registration</ h3 >
30
< form class = " card " method = " post" action = " /admin/registration" >
31
< input type = " hidden" name = " _csrf" value = " {{ shell.csrf }}" >
32
< select name = " mode" > {% for m in ["open", "invite", "closed"] %}< option value = " {{ m }}" {% if mode.as_str () == *m %} selected {% endif %}> {{ m }}</ option > {% endfor %}</ select >
33
< button type = " submit" > SET</ button >
34
</ form >
35
< h3 > Invitations</ h3 >
36
< form class = " card " method = " post" action = " /admin/invite" > < input type = " hidden" name = " _csrf" value = " {{ shell.csrf }}" > < button type = " submit" > NEW INVITATION</ button > </ form >
37
< 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 >
38
< h3 > Organisations</ h3 >
39
< ul class = " plain " > {% for o in orgs %}< li > < a href = " /orgs/{{ o.name }}/settings" > {{ o.name }}</ a > </ li > {% endfor %}</ ul >
40
</ aside >
41
</ div >
42
{% endblock %}