OXYGENHUB
# 67b24adbf35a oxygenhub / templates / repo_settings.html
6.9 KiB · HTML · last changed Organisation webhooks under the organisation's settings, sharing the repository webhook code; an admin storage page with sizes, loose objects and packs, and maintenance (oxy gc) per repository or for all 1 month ago source blame history raw
1
{% extends "base.html" %}
2
{% import "webhooks_panel.html" as w %}
3
{% import "repo_tabs.html" as m %}
4
{% block title %}Settings · {{ repo.owner }}/{{ repo.name }}{% endblock %}
5
{% block bodyattrs %} data-repo="{{ repo.url }}"{% endblock %}
6
{% block tabs %}{% call m::tabs(repo, "settings") %}{% endblock %}
7
{% block content %}
8
<div class="head"><h1>Settings <small>{{ repo.owner }}/{{ repo.name }}</small></h1></div>
9
{% if let Some(n) = notice %}<p class="note">{{ n }}</p>{% endif %}
10
{% if let Some(e) = error %}<p class="error">{{ e }}</p>{% endif %}
11
<div class="sectioned">
12
<nav class="section-nav" aria-label="Sections">
13
  <a href="#general">General</a>
14
  <a href="#landing">Landing requirements</a>
15
  <a href="#git-mirror">Git mirror</a>
16
  <a href="#checks">Required checks</a>
17
  {% if role == crate::auth::Role::Admin %}<a href="#webhooks">Webhooks</a>
18
  <a href="#collaborators">Collaborators</a>
19
  <a href="#danger">Delete</a>{% endif %}
20
</nav>
21
<div class="sections">
22
<form class="card wide" id="general" method="post" action="{{ repo.url }}/settings">
23
  <input type="hidden" name="_csrf" value="{{ shell.csrf }}">
24
  <h2>General</h2>
25
  <label for="description">Description</label><input type="text" id="description" name="description" value="{{ row.description }}">
26
  <label for="topics">Topics</label><input type="text" id="topics" name="topics" value="{{ row.topics }}" placeholder="rust version-control retro">
27
  <p class="small mute">Separated by spaces or commas; letters, digits and dashes. People find repositories by them under Explore.</p>
28
  <label for="default_bookmark">Default bookmark</label><input type="text" id="default_bookmark" name="default_bookmark" value="{{ row.default_bookmark }}">
29
  <label>Visibility{% if role != crate::auth::Role::Admin %} <span class="mute">(admins only)</span>{% endif %}</label>
30
  <div class="choice">
31
    <label><input type="radio" name="visibility" value="public"{% if row.visibility == "public" %} checked{% endif %}> public</label>
32
    <label><input type="radio" name="visibility" value="internal"{% if row.visibility == "internal" %} checked{% endif %}> internal</label>
33
    <label><input type="radio" name="visibility" value="private"{% if row.visibility == "private" %} checked{% endif %}> private</label>
34
  </div>
35
  <button type="submit">SAVE</button>
36
</form>
37
<form class="card wide" id="landing" method="post" action="{{ repo.url }}/settings/requirements">
38
  <input type="hidden" name="_csrf" value="{{ shell.csrf }}">
39
  <h2>Landing requirements</h2>
40
  <label for="required_approvals">Sealed approvals required</label><input type="number" id="required_approvals" name="required_approvals" min="0" value="{{ requirements.required_approvals }}">
41
  <div class="choice">
42
    <label><input type="checkbox" name="require_owners" value="1"{% if requirements.require_owners %} checked{% endif %}> code owners from <code>.oxyowners</code> must approve</label>
43
    <label><input type="checkbox" name="allow_conflicts" value="1"{% if requirements.allow_conflicts %} checked{% endif %}> allow landing with conflicts</label>
44
  </div>
45
  <button type="submit">SAVE</button>
46
</form>
47
<form class="card wide" id="git-mirror" method="post" action="{{ repo.url }}/settings/mirror">
48
  <input type="hidden" name="_csrf" value="{{ shell.csrf }}">
49
  <h2>Git mirror</h2>
50
  <div class="choice"><label><input type="checkbox" name="enabled" value="1"{% if row.git_mirror %} checked{% endif %}> keep a read-only Git mirror of <strong>{{ row.default_bookmark }}</strong></label></div>
51
  <p class="small mute">For tools that only speak Git (CI runners, IDEs): <code>git clone {{ shell.base_url }}{{ repo.url }}.git</code>. Private repositories take a personal access token as the password. Pushing to the mirror is refused.{% if row.git_mirror && !row.git_mirror_state.is_empty() %} Last exported state <code>{{ row.git_mirror_state|short }}</code>.{% endif %}</p>
52
  <button type="submit">SAVE</button>
53
</form>
54
<form class="card wide" id="checks" method="post" action="{{ repo.url }}/settings/checks">
55
  <input type="hidden" name="_csrf" value="{{ shell.csrf }}">
56
  <h2>Required checks</h2>
57
  <label for="required_checks">Check names that must pass on a proposal's projected state (comma-separated)</label><input type="text" id="required_checks" name="required_checks" value="{{ required_checks }}" placeholder="build, test">
58
  <p class="small mute">Any token with <code>checks:write</code> reports checks with <code>POST {{ shell.base_url }}/api/v1/repos/{{ repo.owner }}/{{ repo.name }}/checks</code>.</p>
59
  <button type="submit">SAVE</button>
60
</form>
61
{% if role == crate::auth::Role::Admin %}
62
{% call w::panel(repo.url ~ "/settings", hooks, shell.csrf, "Each delivery is signed with the secret (X-Oxyhub-Signature) and retried with backoff for a day.") %}
63
<section class="panel" id="collaborators">
64
  <h2>Collaborators</h2>
65
  {% if collaborators.is_empty() %}<p class="mute small">Nobody beyond the owner{% if !teams.is_empty() %} and the organisation's members{% endif %}.</p>{% else %}
66
  <table class="small">
67
  {% for c in collaborators %}
68
  <tr><td>{% if let Some(a) = c.account %}<a href="/{{ a.username }}">{{ a.username }}</a>{% else if let Some(t) = c.team %}team {{ t.name }}{% endif %}</td><td>{{ c.role }}</td>
69
  <td><form class="tiny" method="post" action="{{ repo.url }}/settings/collaborators"><input type="hidden" name="_csrf" value="{{ shell.csrf }}">{% if let Some(a) = c.account %}<input type="hidden" name="username" value="{{ a.username }}">{% else if let Some(t) = c.team %}<input type="hidden" name="team" value="{{ t.name }}">{% endif %}<button name="remove" value="1">remove</button></form></td></tr>
70
  {% endfor %}
71
  </table>{% endif %}
72
  <form class="card" method="post" action="{{ repo.url }}/settings/collaborators">
73
    <input type="hidden" name="_csrf" value="{{ shell.csrf }}">
74
    <div class="row">
75
      <div><label for="username">Account</label><input type="text" id="username" name="username"></div>
76
      {% if !teams.is_empty() %}<div><label for="team">or team</label><select id="team" name="team"><option value="">—</option>{% for t in teams %}<option value="{{ t.name }}">{{ t.name }}</option>{% endfor %}</select></div>{% endif %}
77
      <div><label for="role">Role</label><select id="role" name="role"><option value="read">read</option><option value="triage">triage</option><option value="write" selected>write</option><option value="maintain">maintain</option><option value="admin">admin</option></select></div>
78
    </div>
79
    <button type="submit">ADD</button>
80
  </form>
81
</section>
82
<details class="danger" id="danger">
83
  <summary>Delete this repository</summary>
84
  <form class="card" method="post" action="{{ repo.url }}/settings/delete">
85
    <input type="hidden" name="_csrf" value="{{ shell.csrf }}">
86
    <p class="small">The repository moves to the trash and is removed after the retention period. Type <code>{{ repo.owner }}/{{ repo.name }}</code> to confirm.</p>
87
    <input type="text" name="confirm" required>
88
    <button type="submit">DELETE</button>
89
  </form>
90
</details>
91
{% endif %}
92
</div>
93
</div>
94
{% endblock %}