OXYGENHUB
# 2a83f5303458 oxygenhub / templates / org_settings.html
6.7 KiB · HTML · last changed Variables for pipelines at the site, organisation and repository 1 month ago source blame history raw
19bb31ff Andy McCall ↶ 1
{% extends "base.html" %}
8fb35df7 Andy McCall ↶ 2
{% import "webhooks_panel.html" as w %}
e71846aa Andy McCall ↶ 3
{% import "assistants_panel.html" as ai %}
2a83f530 Andy McCall ↶ 4
{% import "variables_panel.html" as va %}
19bb31ff Andy McCall ↶ 5
{% block title %}{{ org.name }} settings{% endblock %}
6
{% block content %}
7
<div class="head"><h1>{{ org.name }} <small>organisation settings · <a href="/{{ org.name }}">repositories</a></small></h1></div>
64caed18 Andy McCall ↶ 8
<div class="sectioned">
9
<nav class="section-nav" aria-label="Sections">
10
  <a href="#general">General</a>
a160b98f Andy McCall ↶ 11
  <a href="#logo">Logo</a>
64caed18 Andy McCall ↶ 12
  <a href="#members">Members</a>
8fb35df7 Andy McCall ↶ 13
  <a href="#webhooks">Webhooks</a>
2a83f530 Andy McCall ↶ 14
  <a href="#variables">Variables</a>
e71846aa Andy McCall ↶ 15
  <a href="#assistants">AI assistants</a>
64caed18 Andy McCall ↶ 16
  <a href="#teams">Teams</a>
17
</nav>
18
<div class="sections">
19bb31ff Andy McCall ↶ 19
{% if let Some(n) = notice %}<p class="note">{{ n }}</p>{% endif %}
20
{% if let Some(e) = error %}<p class="error">{{ e }}</p>{% endif %}
64caed18 Andy McCall ↶ 21
<form class="card" id="general" method="post" action="/orgs/{{ org.name }}/settings">
19bb31ff Andy McCall ↶ 22
  <input type="hidden" name="_csrf" value="{{ shell.csrf }}">
23
  <label for="display_name">Display name</label><input type="text" id="display_name" name="display_name" value="{{ org.display_name }}">
24
  <label for="description">Description</label><input type="text" id="description" name="description" value="{{ org.description }}">
25
  <label for="default_role">Members' default role on the organisation's repositories</label>
26
  <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>
27
  <button type="submit">SAVE</button>
a160b98f Andy McCall ↶ 28
</form>
29
<form class="card picture-card" id="logo" method="post" action="/orgs/{{ org.name }}/settings/avatar" enctype="multipart/form-data">
30
  <input type="hidden" name="_csrf" value="{{ shell.csrf }}">
31
  <h2>Logo</h2>
32
  <div class="picture-row">
33
    <img class="avatar xl" src="/avatar/{{ org.name }}?v={{ org.avatar }}" alt="{{ org.name }} logo" width="96" height="96">
34
    <div>
35
      <label for="logo-file">Upload a logo</label>
36
      <input type="file" id="logo-file" name="picture" accept="image/png,image/jpeg,image/webp">
37
      <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>
38
      <button type="submit" name="action" value="upload">UPLOAD</button>
39
      {% if !org.avatar.is_empty() %}<button type="submit" name="action" value="remove" class="danger-btn">REMOVE</button>{% endif %}
40
    </div>
41
  </div>
19bb31ff Andy McCall ↶ 42
</form>
64caed18 Andy McCall ↶ 43
<section class="panel" id="members">
19bb31ff Andy McCall ↶ 44
  <h2>Members</h2>
45
  <table class="small">{% for (a, r) in members %}<tr><td><a href="/{{ a.username }}">{{ a.username }}</a></td><td>{{ r }}</td>
46
  <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>
47
  <form class="card" method="post" action="/orgs/{{ org.name }}/settings/members">
48
    <input type="hidden" name="_csrf" value="{{ shell.csrf }}">
49
    <div class="row"><div><label for="username">Account</label><input type="text" id="username" name="username" required></div>
50
    <div><label for="role">Role</label><select id="role" name="role"><option value="member">member</option><option value="owner">owner</option></select></div></div>
51
    <button type="submit">ADD OR CHANGE</button>
52
  </form>
53
</section>
64caed18 Andy McCall ↶ 54
<section class="panel" id="teams">
19bb31ff Andy McCall ↶ 55
  <h2>Teams</h2>
56
  {% for (t, ms) in teams %}
57
  <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 %}
58
  <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>
59
  {% endfor %}
60
  <form class="card" method="post" action="/orgs/{{ org.name }}/settings/teams">
61
    <input type="hidden" name="_csrf" value="{{ shell.csrf }}">
62
    <div class="row"><div><label for="team">Team</label><input type="text" id="team" name="team" required></div>
63
    <div><label for="tuser">Account (for add or remove)</label><input type="text" id="tuser" name="username"></div></div>
64
    <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>
65
  </form>
66
</section>
7974adb0 Andy McCall ↶ 67
<section class="panel" id="runners">
68
  <h2>Runners</h2>
69
  <p class="small">The OxygenFlow runners that may take this organisation's jobs: the site's, the organisation's, and those of its repositories.</p>
70
  {% if let Some(t) = runner_token %}<p class="note">Register a runner for the organisation with:</p><pre class="snippet">flow runner register {{ shell.base_url }} --token {{ t }} --name NAME</pre>{% endif %}
71
  {% if runners.is_empty() %}<p class="mute small">None yet: runs wait until a runner that serves them is added.</p>{% else %}
72
  <div class="table"><table>
73
  <tr><th>Runner</th><th>Status</th><th>Serves</th><th>Machine</th><th></th></tr>
74
  {% for (r, serves, own) in runners %}<tr><td><strong>{{ r.name }}</strong></td><td><span class="runner-status st-{{ r.status() }}">{{ r.status() }}</span></td><td class="small">{{ serves }}</td><td class="small">{% if r.arch.is_empty() %}<span class="mute">unknown</span>{% else %}{{ r.arch }} · {{ r.os }}{% endif %}</td>
75
  <td>{% if *own %}<form class="tiny" method="post" action="/orgs/{{ org.name }}/settings/runners/{{ r.id }}/remove" onsubmit="return confirm('Remove {{ r.name }}? Its credential stops working.')"><input type="hidden" name="_csrf" value="{{ shell.csrf }}"><button class="danger-btn">remove</button></form>{% endif %}</td></tr>{% endfor %}
76
  </table></div>{% endif %}
77
  <form method="post" action="/orgs/{{ org.name }}/settings/runners/token"><input type="hidden" name="_csrf" value="{{ shell.csrf }}"><button type="submit">Add a runner for the organisation</button></form>
78
</section>
8fb35df7 Andy McCall ↶ 79
{% 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.") %}
2a83f530 Andy McCall ↶ 80
{% call va::panel("/orgs/" ~ org.name ~ "/settings", variables, shell.csrf, "Jobs of every repository of the organisation get these, beside the site's and each repository's own.") %}
e71846aa Andy McCall ↶ 81
{% call ai::panel("/orgs/" ~ org.name ~ "/settings", assistants, shell.csrf, "Every repository of the organisation may ask these, beside the site's and its own.") %}
64caed18 Andy McCall ↶ 82
</div>
83
</div>
19bb31ff Andy McCall ↶ 84
{% endblock %}