OXYGENHUB
# 306aec1839aa oxygenhub / templates / tags.html
3.7 KiB · HTML · last changed Create and withdraw tags on the website (closes #295, closes #301) 11 days ago source blame history raw
1
{% extends "base.html" %}
2
{% import "repo_tabs.html" as m %}
3
{% block title %}Tags · {{ repo.owner }}/{{ repo.name }}{% endblock %}
4
{% block bodyattrs %} data-repo="{{ repo.url }}"{% endblock %}
5
{% block tabs %}{% call m::tabs(repo, "tags") %}{% endblock %}
6
{% block content %}
7
<div class="head"><h1>Tags <small>{{ tags.len() }}</small></h1></div>
8
<div class="bar"><span class="modes"><a href="{{ repo.url }}/releases">releases</a><a href="{{ repo.url }}/tags" class="on" aria-current="page">tags</a></span></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
{% if can_create %}
12
<details class="tag-create"{% if error.is_some() %} open{% endif %}><summary>Create a tag</summary>
13
  <form class="card wide" method="post" action="{{ repo.url }}/tags/create">
14
    <input type="hidden" name="_csrf" value="{{ shell.csrf }}">
15
    <label for="tag-name">Name</label><input type="text" id="tag-name" name="name" placeholder="v1.0.0" required>
16
    <label for="tag-target">Of</label><input type="text" id="tag-target" name="target" placeholder="{{ repo.default_bookmark }}">
17
    <label for="tag-message">Message</label><input type="text" id="tag-message" name="message">
18
    <p class="small mute">Signed by this hub's key as your delegate, as <code>oxy tag create</code> and a push would be. Tags never move; a mistake is withdrawn, and its name is not used again.</p>
19
    <div class="choice"><button type="submit">CREATE TAG</button></div>
20
  </form>
21
</details>
22
{% endif %}
23
{% if tags.is_empty() %}<p class="empty">No tags. <code>oxy tag create NAME -m "message"</code> then push{% if can_create %}, or create one above{% endif %}.</p>{% else %}
24
<div class="table"><table>
25
<tr><th>Tag</th><th>State</th><th>Message</th><th>Signed</th>{% if can_withdraw %}<th></th>{% endif %}</tr>
26
{% for t in tags %}
27
<tr>
28
  <td class="px"><a href="{{ repo.url }}/tree/{{ t.name }}">{{ t.name }}</a></td>
29
  <td>{% for h in t.heads %}<a class="chip" href="{{ repo.url }}/change/{{ h }}">{{ h|short }}</a> {% endfor %}</td>
30
  <td>{{ t.message }}</td>
31
  <td>{% if let Some(s) = t.signer %}<span class="sig sig-valid">✔</span> {{ s }}{% else %}<span class="sig sig-unsigned">○</span> unsigned{% endif %}</td>
32
  {% if can_withdraw %}<td class="small">{% if self.released(t.name.as_str()) %}<span class="mute" title="Delete the release first">in a release</span>{% else %}
33
    <details class="tiny"><summary>withdraw</summary><form class="tiny" method="post" action="{{ repo.url }}/tags/withdraw"><input type="hidden" name="_csrf" value="{{ shell.csrf }}"><input type="hidden" name="tag" value="{{ t.name }}"><input type="text" name="reason" placeholder="why (optional)" aria-label="Why {{ t.name }} is withdrawn"> <button type="submit" class="small danger-btn" data-confirm="Withdraw the tag {{ t.name }}? Clones drop it on their next fetch, and the name can never be used again.">WITHDRAW</button></form></details>{% endif %}</td>{% endif %}
34
</tr>
35
{% endfor %}
36
</table></div>
37
{% endif %}
38
{% if !withdrawn.is_empty() %}
39
<h2>Withdrawn <small>{{ withdrawn.len() }}</small></h2>
40
<div class="table"><table>
41
<tr><th>Tag</th><th>Named</th><th>Why</th><th>By</th><th>When</th></tr>
42
{% for w in withdrawn %}
43
<tr>
44
  <td class="px mute"><s>{{ w.name }}</s></td>
45
  <td>{% for h in w.heads %}<a class="chip" href="{{ repo.url }}/change/{{ h }}">{{ h|short }}</a> {% endfor %}</td>
46
  <td>{% if w.reason.is_empty() %}<span class="mute">—</span>{% else %}{{ w.reason }}{% endif %}</td>
47
  <td>{% if let Some(s) = w.signer %}<span class="sig sig-valid">✔</span> {{ s }}{% else %}<span class="sig sig-unsigned">○</span> unsigned{% endif %}</td>
48
  <td><time title="{{ w.when_ms|when_i }}">{{ w.when_ms|ago_i }}</time></td>
49
</tr>
50
{% endfor %}
51
</table></div>
52
{% endif %}
53
{% endblock %}