OXYGENHUB
# 19bb31ff1f5c oxygenhub / templates / repo_settings.html
3.8 KiB · HTML · last changed Milestone 0.2: accounts and access 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
{% if role == crate::auth::Role::Admin %}
24
<section class="panel">
25
  <h2>Collaborators</h2>
26
  {% if collaborators.is_empty() %}<p class="mute small">Nobody beyond the owner{% if !teams.is_empty() %} and the organisation's members{% endif %}.</p>{% else %}
27
  <table class="small">
28
  {% for c in collaborators %}
29
  <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>
30
  <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>
31
  {% endfor %}
32
  </table>{% endif %}
33
  <form class="card" method="post" action="{{ repo.url }}/settings/collaborators">
34
    <input type="hidden" name="_csrf" value="{{ shell.csrf }}">
35
    <div class="row">
36
      <div><label for="username">Account</label><input type="text" id="username" name="username"></div>
37
      {% 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 %}
38
      <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>
39
    </div>
40
    <button type="submit">ADD</button>
41
  </form>
42
</section>
43
<details class="danger">
44
  <summary>Delete this repository</summary>
45
  <form class="card" method="post" action="{{ repo.url }}/settings/delete">
46
    <input type="hidden" name="_csrf" value="{{ shell.csrf }}">
47
    <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>
48
    <input type="text" name="confirm" required>
49
    <button type="submit">DELETE</button>
50
  </form>
51
</details>
52
{% endif %}
53
{% endblock %}