19bb31ff Andy McCall 1 month ago ↶
1
{% extends "base.html" %}
8fb35df7 Andy McCall 1 month ago ↶
2
{% import "webhooks_panel.html" as w %}
19bb31ff Andy McCall 1 month ago ↶
3
{% block title %}{{ org.name }} settings{% endblock %}
4
{% block content %}
5
< div class = " head " > < h1 > {{ org.name }} < small > organisation settings · < a href = " /{{ org.name }}" > repositories</ a > </ small > </ h1 > </ div >
64caed18 Andy McCall 1 month ago ↶
6
< div class = " sectioned " >
7
< nav class = " section-nav " aria-label = " Sections" >
8
< a href = " #general" > General</ a >
a160b98f Andy McCall 1 month ago ↶
9
< a href = " #logo" > Logo</ a >
64caed18 Andy McCall 1 month ago ↶
10
< a href = " #members" > Members</ a >
8fb35df7 Andy McCall 1 month ago ↶
11
< a href = " #webhooks" > Webhooks</ a >
64caed18 Andy McCall 1 month ago ↶
12
< a href = " #teams" > Teams</ a >
13
</ nav >
14
< div class = " sections " >
19bb31ff Andy McCall 1 month ago ↶
15
{% if let Some(n) = notice %}< p class = " note " > {{ n }}</ p > {% endif %}
16
{% if let Some(e) = error %}< p class = " error " > {{ e }}</ p > {% endif %}
64caed18 Andy McCall 1 month ago ↶
17
< form class = " card " id = " general " method = " post" action = " /orgs/{{ org.name }}/settings" >
19bb31ff Andy McCall 1 month ago ↶
18
< input type = " hidden" name = " _csrf" value = " {{ shell.csrf }}" >
19
< label for = " display_name" > Display name</ label > < input type = " text" id = " display_name " name = " display_name" value = " {{ org.display_name }}" >
20
< label for = " description" > Description</ label > < input type = " text" id = " description " name = " description" value = " {{ org.description }}" >
21
< label for = " default_role" > Members' default role on the organisation's repositories</ label >
22
< 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 >
23
< button type = " submit" > SAVE</ button >
a160b98f Andy McCall 1 month ago ↶
24
</ form >
25
< form class = " card picture-card " id = " logo " method = " post" action = " /orgs/{{ org.name }}/settings/avatar" enctype = " multipart/form-data" >
26
< input type = " hidden" name = " _csrf" value = " {{ shell.csrf }}" >
27
< h2 > Logo</ h2 >
28
< div class = " picture-row " >
29
< img class = " avatar xl " src = " /avatar/{{ org.name }}?v={{ org.avatar }}" alt = " {{ org.name }} logo" width = " 96" height = " 96" >
30
< div >
31
< label for = " logo-file" > Upload a logo</ label >
32
< input type = " file" id = " logo-file " name = " picture" accept = " image/png,image/jpeg,image/webp" >
33
< 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 >
34
< button type = " submit" name = " action" value = " upload" > UPLOAD</ button >
35
{% if !org.avatar.is_empty() %}< button type = " submit" name = " action" value = " remove" class = " danger-btn " > REMOVE</ button > {% endif %}
36
</ div >
37
</ div >
19bb31ff Andy McCall 1 month ago ↶
38
</ form >
64caed18 Andy McCall 1 month ago ↶
39
< section class = " panel " id = " members " >
19bb31ff Andy McCall 1 month ago ↶
40
< h2 > Members</ h2 >
41
< table class = " small " > {% for (a, r) in members %}< tr > < td > < a href = " /{{ a.username }}" > {{ a.username }}</ a > </ td > < td > {{ r }}</ td >
42
< 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 >
43
< form class = " card " method = " post" action = " /orgs/{{ org.name }}/settings/members" >
44
< input type = " hidden" name = " _csrf" value = " {{ shell.csrf }}" >
45
< div class = " row " > < div > < label for = " username" > Account</ label > < input type = " text" id = " username " name = " username" required > </ div >
46
< div > < label for = " role" > Role</ label > < select id = " role " name = " role" > < option value = " member" > member</ option > < option value = " owner" > owner</ option > </ select > </ div > </ div >
47
< button type = " submit" > ADD OR CHANGE</ button >
48
</ form >
49
</ section >
64caed18 Andy McCall 1 month ago ↶
50
< section class = " panel " id = " teams " >
19bb31ff Andy McCall 1 month ago ↶
51
< h2 > Teams</ h2 >
52
{% for (t, ms) in teams %}
53
< 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 %}
54
< 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 >
55
{% endfor %}
56
< form class = " card " method = " post" action = " /orgs/{{ org.name }}/settings/teams" >
57
< input type = " hidden" name = " _csrf" value = " {{ shell.csrf }}" >
58
< div class = " row " > < div > < label for = " team" > Team</ label > < input type = " text" id = " team " name = " team" required > </ div >
59
< div > < label for = " tuser" > Account (for add or remove)</ label > < input type = " text" id = " tuser " name = " username" > </ div > </ div >
60
< 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 >
61
</ form >
62
</ section >
8fb35df7 Andy McCall 1 month ago ↶
63
{% call w::panel("/orgs/" ~ org.name ~ "/settings", hooks, shell.csrf, "These hear every repository of the organisation, as well as each repository's own webhooks.") %}
64caed18 Andy McCall 1 month ago ↶
64
</ div >
65
</ div >
19bb31ff Andy McCall 1 month ago ↶
66
{% endblock %}