19bb31ff Andy McCall 1 month ago ↶
1
{% extends "base.html" %}
2
{% block title %}{{ org.name }} settings{% endblock %}
3
{% block content %}
4
< div class = " head " > < h1 > {{ org.name }} < small > organisation settings · < a href = " /{{ org.name }}" > repositories</ a > </ small > </ h1 > </ div >
64caed18 Andy McCall 1 month ago ↶
5
< div class = " sectioned " >
6
< nav class = " section-nav " aria-label = " Sections" >
7
< a href = " #general" > General</ a >
a160b98f Andy McCall 1 month ago ↶
8
< a href = " #logo" > Logo</ a >
64caed18 Andy McCall 1 month ago ↶
9
< a href = " #members" > Members</ a >
10
< a href = " #teams" > Teams</ a >
11
</ nav >
12
< div class = " sections " >
19bb31ff Andy McCall 1 month ago ↶
13
{% if let Some(n) = notice %}< p class = " note " > {{ n }}</ p > {% endif %}
14
{% if let Some(e) = error %}< p class = " error " > {{ e }}</ p > {% endif %}
64caed18 Andy McCall 1 month ago ↶
15
< form class = " card " id = " general " method = " post" action = " /orgs/{{ org.name }}/settings" >
19bb31ff Andy McCall 1 month ago ↶
16
< input type = " hidden" name = " _csrf" value = " {{ shell.csrf }}" >
17
< label for = " display_name" > Display name</ label > < input type = " text" id = " display_name " name = " display_name" value = " {{ org.display_name }}" >
18
< label for = " description" > Description</ label > < input type = " text" id = " description " name = " description" value = " {{ org.description }}" >
19
< label for = " default_role" > Members' default role on the organisation's repositories</ label >
20
< select id = " default_role " name = " default_role" > {% for r in ["none", "read", "triage", "write", "maintain", "admin"] %}< option value = " {{ r }}" {% if org.default_role.as_str () == *r %} selected {% endif %}> {{ r }}</ option > {% endfor %}</ select >
21
< button type = " submit" > SAVE</ button >
a160b98f Andy McCall 1 month ago ↶
22
</ form >
23
< form class = " card picture-card " id = " logo " method = " post" action = " /orgs/{{ org.name }}/settings/avatar" enctype = " multipart/form-data" >
24
< input type = " hidden" name = " _csrf" value = " {{ shell.csrf }}" >
25
< h2 > Logo</ h2 >
26
< div class = " picture-row " >
27
< img class = " avatar xl " src = " /avatar/{{ org.name }}?v={{ org.avatar }}" alt = " {{ org.name }} logo" width = " 96" height = " 96" >
28
< div >
29
< label for = " logo-file" > Upload a logo</ label >
30
< input type = " file" id = " logo-file " name = " picture" accept = " image/png,image/jpeg,image/webp" >
31
< p class = " small mute " > PNG (transparency is kept), JPEG or WebP, up to 5 MiB. It is cropped to the middle square and resized to 400×400.</ p >
32
< button type = " submit" name = " action" value = " upload" > UPLOAD</ button >
33
{% if !org.avatar.is_empty() %}< button type = " submit" name = " action" value = " remove" class = " danger-btn " > REMOVE</ button > {% endif %}
34
</ div >
35
</ div >
19bb31ff Andy McCall 1 month ago ↶
36
</ form >
64caed18 Andy McCall 1 month ago ↶
37
< section class = " panel " id = " members " >
19bb31ff Andy McCall 1 month ago ↶
38
< h2 > Members</ h2 >
39
< table class = " small " > {% for (a, r) in members %}< tr > < td > < a href = " /{{ a.username }}" > {{ a.username }}</ a > </ td > < td > {{ r }}</ td >
40
< td > < form class = " tiny " method = " post" action = " /orgs/{{ org.name }}/settings/members" > < input type = " hidden" name = " _csrf" value = " {{ shell.csrf }}" > < input type = " hidden" name = " username" value = " {{ a.username }}" > < button name = " remove" value = " 1" > remove</ button > </ form > </ td > </ tr > {% endfor %}</ table >
41
< form class = " card " method = " post" action = " /orgs/{{ org.name }}/settings/members" >
42
< input type = " hidden" name = " _csrf" value = " {{ shell.csrf }}" >
43
< div class = " row " > < div > < label for = " username" > Account</ label > < input type = " text" id = " username " name = " username" required > </ div >
44
< div > < label for = " role" > Role</ label > < select id = " role " name = " role" > < option value = " member" > member</ option > < option value = " owner" > owner</ option > </ select > </ div > </ div >
45
< button type = " submit" > ADD OR CHANGE</ button >
46
</ form >
47
</ section >
64caed18 Andy McCall 1 month ago ↶
48
< section class = " panel " id = " teams " >
19bb31ff Andy McCall 1 month ago ↶
49
< h2 > Teams</ h2 >
50
{% for (t, ms) in teams %}
51
< p > < strong > {{ t.name }}</ strong > : {% for a in ms %}{{ a.username }}{% if !loop.last %}, {% endif %}{% endfor %}{% if ms.is_empty() %}< span class = " mute " > nobody yet</ span > {% endif %}
52
< form class = " tiny " method = " post" action = " /orgs/{{ org.name }}/settings/teams" > < input type = " hidden" name = " _csrf" value = " {{ shell.csrf }}" > < input type = " hidden" name = " team" value = " {{ t.name }}" > < button name = " action" value = " delete" > delete team</ button > </ form > </ p >
53
{% endfor %}
54
< form class = " card " method = " post" action = " /orgs/{{ org.name }}/settings/teams" >
55
< input type = " hidden" name = " _csrf" value = " {{ shell.csrf }}" >
56
< div class = " row " > < div > < label for = " team" > Team</ label > < input type = " text" id = " team " name = " team" required > </ div >
57
< div > < label for = " tuser" > Account (for add or remove)</ label > < input type = " text" id = " tuser " name = " username" > </ div > </ div >
58
< div class = " choice " > < button type = " submit" name = " action" value = " create" > CREATE TEAM</ button > < button type = " submit" name = " action" value = " add" > ADD MEMBER</ button > < button type = " submit" name = " action" value = " remove" > REMOVE MEMBER</ button > </ div >
59
</ form >
60
</ section >
64caed18 Andy McCall 1 month ago ↶
61
</ div >
62
</ div >
19bb31ff Andy McCall 1 month ago ↶
63
{% endblock %}