OXYGENHUB
# 76f262e1a666 oxygenhub / templates / repo_settings.html
7.4 KiB · HTML · last changed Milestone 0.6: releases, Git mirror, code search, anchored API comments 1 month ago source blame history raw
1
{% extends "base.html" %}
2
{% import "repo_tabs.html" as m %}
3
{% block title %}Settings · {{ repo.owner }}/{{ repo.name }}{% endblock %}
4
{% block bodyattrs %} data-repo="{{ repo.url }}"{% endblock %}
5
{% block tabs %}{% call m::tabs(repo, "settings") %}{% endblock %}
6
{% block content %}
7
<div class="head"><h1>Settings <small>{{ repo.owner }}/{{ repo.name }}</small></h1></div>
8
{% if let Some(n) = notice %}<p class="note">{{ n }}</p>{% endif %}
9
{% if let Some(e) = error %}<p class="error">{{ e }}</p>{% endif %}
10
<form class="card wide" method="post" action="{{ repo.url }}/settings">
11
  <input type="hidden" name="_csrf" value="{{ shell.csrf }}">
12
  <h2>General</h2>
13
  <label for="description">Description</label><input type="text" id="description" name="description" value="{{ row.description }}">
14
  <label for="default_bookmark">Default bookmark</label><input type="text" id="default_bookmark" name="default_bookmark" value="{{ row.default_bookmark }}">
15
  <label>Visibility{% if role != crate::auth::Role::Admin %} <span class="mute">(admins only)</span>{% endif %}</label>
16
  <div class="choice">
17
    <label><input type="radio" name="visibility" value="public"{% if row.visibility == "public" %} checked{% endif %}> public</label>
18
    <label><input type="radio" name="visibility" value="internal"{% if row.visibility == "internal" %} checked{% endif %}> internal</label>
19
    <label><input type="radio" name="visibility" value="private"{% if row.visibility == "private" %} checked{% endif %}> private</label>
20
  </div>
21
  <button type="submit">SAVE</button>
22
</form>
23
<form class="card wide" method="post" action="{{ repo.url }}/settings/requirements">
24
  <input type="hidden" name="_csrf" value="{{ shell.csrf }}">
25
  <h2>Landing requirements</h2>
26
  <label for="required_approvals">Sealed approvals required</label><input type="number" id="required_approvals" name="required_approvals" min="0" value="{{ requirements.required_approvals }}">
27
  <div class="choice">
28
    <label><input type="checkbox" name="require_owners" value="1"{% if requirements.require_owners %} checked{% endif %}> code owners from <code>.oxyowners</code> must approve</label>
29
    <label><input type="checkbox" name="allow_conflicts" value="1"{% if requirements.allow_conflicts %} checked{% endif %}> allow landing with conflicts</label>
30
  </div>
31
  <button type="submit">SAVE</button>
32
</form>
33
<form class="card wide" method="post" action="{{ repo.url }}/settings/mirror">
34
  <input type="hidden" name="_csrf" value="{{ shell.csrf }}">
35
  <h2>Git mirror</h2>
36
  <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>
37
  <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>
38
  <button type="submit">SAVE</button>
39
</form>
40
<form class="card wide" method="post" action="{{ repo.url }}/settings/checks">
41
  <input type="hidden" name="_csrf" value="{{ shell.csrf }}">
42
  <h2>Required checks</h2>
43
  <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">
44
  <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>
45
  <button type="submit">SAVE</button>
46
</form>
47
{% if role == crate::auth::Role::Admin %}
48
<section class="panel">
49
  <h2>Webhooks</h2>
50
  {% if hooks.is_empty() %}<p class="mute small">None.</p>{% else %}
51
  <table class="small"><tr><th>URL</th><th>Events</th><th>Active</th><th></th></tr>
52
  {% for h in hooks %}<tr><td>{{ h.url }}</td><td>{{ h.events }}</td><td>{% if h.active %}yes{% else %}no{% endif %}</td>
53
  <td><a class="small" href="{{ repo.url }}/settings/hooks/{{ h.id }}/deliveries">deliveries</a>
54
  <form class="tiny" method="post" action="{{ repo.url }}/settings/hooks"><input type="hidden" name="_csrf" value="{{ shell.csrf }}"><input type="hidden" name="id" value="{{ h.id }}"><button name="action" value="ping">ping</button> <button name="action" value="toggle">{% if h.active %}disable{% else %}enable{% endif %}</button> <button name="action" value="delete">delete</button></form></td></tr>{% endfor %}
55
  </table>{% endif %}
56
  <form class="card" method="post" action="{{ repo.url }}/settings/hooks">
57
    <input type="hidden" name="_csrf" value="{{ shell.csrf }}">
58
    <label for="hurl">URL</label><input type="text" id="hurl" name="url" placeholder="https://…" required>
59
    <label for="hsecret">Secret (signs each delivery)</label><input type="text" id="hsecret" name="secret">
60
    <label for="hevents">Events (<code>*</code>, or a list such as <code>push,proposal,issue</code>)</label><input type="text" id="hevents" name="events" value="*">
61
    <button type="submit">ADD WEBHOOK</button>
62
  </form>
63
</section>
64
<section class="panel">
65
  <h2>Collaborators</h2>
66
  {% if collaborators.is_empty() %}<p class="mute small">Nobody beyond the owner{% if !teams.is_empty() %} and the organisation's members{% endif %}.</p>{% else %}
67
  <table class="small">
68
  {% for c in collaborators %}
69
  <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>
70
  <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>
71
  {% endfor %}
72
  </table>{% endif %}
73
  <form class="card" method="post" action="{{ repo.url }}/settings/collaborators">
74
    <input type="hidden" name="_csrf" value="{{ shell.csrf }}">
75
    <div class="row">
76
      <div><label for="username">Account</label><input type="text" id="username" name="username"></div>
77
      {% 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 %}
78
      <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>
79
    </div>
80
    <button type="submit">ADD</button>
81
  </form>
82
</section>
83
<details class="danger">
84
  <summary>Delete this repository</summary>
85
  <form class="card" method="post" action="{{ repo.url }}/settings/delete">
86
    <input type="hidden" name="_csrf" value="{{ shell.csrf }}">
87
    <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>
88
    <input type="text" name="confirm" required>
89
    <button type="submit">DELETE</button>
90
  </form>
91
</details>
92
{% endif %}
93
{% endblock %}