OXYGENHUB
# de505df5cf8d oxygenhub / templates / repo_settings.html
4.6 KiB · HTML · last changed Milestone 0.3: proposals and review 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
{% if role == crate::auth::Role::Admin %}
34
<section class="panel">
35
  <h2>Collaborators</h2>
36
  {% if collaborators.is_empty() %}<p class="mute small">Nobody beyond the owner{% if !teams.is_empty() %} and the organisation's members{% endif %}.</p>{% else %}
37
  <table class="small">
38
  {% for c in collaborators %}
39
  <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>
40
  <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>
41
  {% endfor %}
42
  </table>{% endif %}
43
  <form class="card" method="post" action="{{ repo.url }}/settings/collaborators">
44
    <input type="hidden" name="_csrf" value="{{ shell.csrf }}">
45
    <div class="row">
46
      <div><label for="username">Account</label><input type="text" id="username" name="username"></div>
47
      {% 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 %}
48
      <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>
49
    </div>
50
    <button type="submit">ADD</button>
51
  </form>
52
</section>
53
<details class="danger">
54
  <summary>Delete this repository</summary>
55
  <form class="card" method="post" action="{{ repo.url }}/settings/delete">
56
    <input type="hidden" name="_csrf" value="{{ shell.csrf }}">
57
    <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>
58
    <input type="text" name="confirm" required>
59
    <button type="submit">DELETE</button>
60
  </form>
61
</details>
62
{% endif %}
63
{% endblock %}