samjeston / openhub Public
Sam Jeston Working vertical 9aa3c45 · History
91 lines· 5.0 KB ·HTML
Raw
1{% extends "layout_repo.html" %}
2{% block page_title %}Settings · {% endblock %}
3{% block content %}
4{% let base = r.base() %}
5<div class="narrow-wide">
6 <section class="settings-section">
7 <h2 class="settings-title">General</h2>
8 {% if let Some(e) = error %}<div class="flash flash-error">{{ crate::web::fmt::icon("circle-alert")|safe }}<span>{{ e }}</span></div>{% endif %}
9 <form method="post" action="{{ base }}/settings" class="form">
10 <label class="field">
11 <span class="field-label">Repository name</span>
12 <input class="input" type="text" name="name" value="{{ r.repo.name }}" maxlength="100" required>
13 <span class="field-hint">Renaming changes the URL. Update your remotes with <code>git remote set-url origin &lt;new url&gt;</code>.</span>
14 </label>
15 <label class="field">
16 <span class="field-label">Description</span>
17 <input class="input" type="text" name="description" value="{{ r.repo.description }}" maxlength="350">
18 </label>
19 <label class="field">
20 <span class="field-label">Default branch</span>
21 {% if branches.is_empty() %}
22 <input class="input" type="text" value="{{ r.repo.default_branch }}" disabled>
23 <span class="field-hint">Push a branch to choose a different default.</span>
24 {% else %}
25 <select class="input" name="default_branch">
26 {% for b in branches %}<option value="{{ b }}"{% if *b == r.repo.default_branch %} selected{% endif %}>{{ b }}</option>{% endfor %}
27 </select>
28 <span class="field-hint">The branch shown on the repository page and used as the default base for pull requests.</span>
29 {% endif %}
30 </label>
31 <fieldset class="field radio-cards">
32 <legend class="field-label">Visibility</legend>
33 <label class="radio-card">
34 <input type="radio" name="visibility" value="public"{% if !r.repo.is_private %} checked{% endif %}>
35 {{ crate::web::fmt::icon("book-marked")|safe }}
36 <span><strong>Public</strong><span class="text-muted">Anyone who can reach this server can see and clone it.</span></span>
37 </label>
38 <label class="radio-card">
39 <input type="radio" name="visibility" value="private"{% if r.repo.is_private %} checked{% endif %}>
40 {{ crate::web::fmt::icon("lock")|safe }}
41 <span><strong>Private</strong><span class="text-muted">Only you and collaborators can see it.</span></span>
42 </label>
43 </fieldset>
44 <div class="form-actions"><button class="btn btn-primary" type="submit">Save changes</button></div>
45 </form>
46 </section>
47
48 <section class="settings-section">
49 <h2 class="settings-title">Collaborators</h2>
50 <p class="text-muted">Collaborators can push branches, merge pull requests and see this repository if it is private.</p>
51 {% if let Some(e) = collab_error %}<div class="flash flash-error">{{ crate::web::fmt::icon("circle-alert")|safe }}<span>{{ e }}</span></div>{% endif %}
52 <div class="box">
53 <div class="box-row collaborator-row">
54 {{ crate::web::fmt::avatar(r.repo.owner, 24)|safe }}
55 <a href="/{{ r.repo.owner }}"><strong>{{ r.repo.owner }}</strong></a>
56 <span class="label">Owner</span>
57 </div>
58 {% for c in collaborators %}
59 <div class="box-row collaborator-row">
60 {{ crate::web::fmt::avatar(c.username, 24)|safe }}
61 <a href="/{{ c.username }}"><strong>{{ c.username }}</strong></a>
62 <span class="label">Write</span>
63 <form method="post" action="{{ base }}/settings/collaborators/remove" class="push-right" data-confirm="Remove {{ c.username }} as a collaborator?">
64 <input type="hidden" name="username" value="{{ c.username }}">
65 <button class="btn btn-sm btn-danger" type="submit">Remove</button>
66 </form>
67 </div>
68 {% endfor %}
69 </div>
70 <form method="post" action="{{ base }}/settings/collaborators" class="inline-form">
71 <input class="input" type="text" name="username" placeholder="Username" required autocapitalize="off" aria-label="Username">
72 <button class="btn" type="submit">{{ crate::web::fmt::icon("users")|safe }} Add collaborator</button>
73 </form>
74 </section>
75
76 <section class="settings-section">
77 <h2 class="settings-title text-danger">Danger zone</h2>
78 <div class="box danger-zone">
79 <div class="box-body">
80 <h3>Delete this repository</h3>
81 <p class="text-muted">This permanently deletes the repository, its history and all pull requests. It cannot be undone.</p>
82 <form method="post" action="{{ base }}/settings/delete" class="inline-form">
83 <input class="input" type="text" name="confirm" placeholder="{{ r.repo.owner }}/{{ r.repo.name }}" required autocomplete="off" aria-label="Type the repository name to confirm">
84 <button class="btn btn-danger" type="submit">Delete repository</button>
85 </form>
86 <p class="field-hint">Type <strong>{{ r.repo.owner }}/{{ r.repo.name }}</strong> to confirm.</p>
87 </div>
88 </div>
89 </section>
90</div>
91{% endblock %}