OXYGENHUB
# 1b770a1fecf0 oxygenhub / templates / repo_tabs.html
4.4 KiB · HTML · last changed OxygenFlow runs: pushes start pipeline runs, a runner API with job tokens, jobs as checks, and a Flow tab with the job graph and live logs 1 month ago source blame history raw
1
{% macro tabs(repo, tab) %}
2
<div class="tabs">
3
  <div class="tabs-in">
4
    <span class="crumb"><a href="/{{ repo.owner }}">{{ repo.owner }}</a> / <a href="{{ repo.url }}"><strong>{{ repo.name }}</strong></a>{% if repo.visibility != "public" %} <span class="tag">{{ repo.visibility }}</span>{% endif %}</span>
5
    <a href="{{ repo.url }}"{% if tab == "code" %} class="on"{% endif %}>Code</a>
6
    <a href="{{ repo.url }}/changes/{{ repo.default_bookmark }}"{% if tab == "changes" %} class="on"{% endif %}>Changes</a>
7
    <a href="{{ repo.url }}/proposals"{% if tab == "proposals" %} class="on"{% endif %}>Proposals{% if repo.open_proposals > 0 %} <span class="count-chip">{{ repo.open_proposals }}</span>{% endif %}</a>
8
    <a href="{{ repo.url }}/issues"{% if tab == "issues" %} class="on"{% endif %}>Issues{% if repo.open_issues > 0 %} <span class="count-chip">{{ repo.open_issues }}</span>{% endif %}</a>
9
    <a href="{{ repo.url }}/flow"{% if tab == "flow" %} class="on"{% endif %}>Flow</a>
10
    <a href="{{ repo.url }}/bookmarks"{% if tab == "bookmarks" %} class="on"{% endif %}>Bookmarks</a>
11
    <a href="{{ repo.url }}/releases"{% if tab == "releases" %} class="on"{% endif %}>Releases</a>
12
    <a href="{{ repo.url }}/tags"{% if tab == "tags" %} class="on"{% endif %}>Tags</a>
13
    <a href="{{ repo.url }}/conflicts"{% if tab == "conflicts" %} class="on"{% endif %}>Conflicts</a>
14
    <a href="{{ repo.url }}/trust"{% if tab == "trust" %} class="on"{% endif %}>Trust</a>
15
    <a href="{{ repo.url }}/pushes"{% if tab == "pushes" %} class="on"{% endif %}>Pushes</a>
16
    {% if repo.can_maintain() %}<a href="{{ repo.url }}/settings"{% if tab == "settings" %} class="on"{% endif %}>Settings</a>{% endif %}
17
  </div>
18
</div>
19
{% endmacro %}
20
21
{% macro sig(s) %}<span class="sig {{ s.class() }}" title="{{ s.title() }}">{{ s.glyph() }}</span>{% endmacro %}
22
23
{% macro labels(c) %}{% for l in c.labels %}<span class="lbl {% if l.kind == crate::repos::view::RefKind::Tag %}lbl-tag{% else %}lbl-bm{% endif %}">{{ l.name }}</span>{% endfor %}{% endmacro %}
24
25
{% macro change_row(repo, c) %}
26
<div class="chg">
27
  <div class="chg-main">
28
    <a class="title" href="{{ repo.url }}/change/{{ c.hash }}">{{ c.title }}</a>
29
    {% call labels(c) %}
30
    {% if c.resolution %}<span class="tag">resolution</span>{% endif %}
31
    {% if c.head %}<span class="tag head">head</span>{% endif %}
32
    <div class="meta"><span class="who">{% if let Some(a) = c.author.account %}<a href="/{{ a }}">{{ c.author.name }}</a>{% else %}{{ c.author.name }}{% endif %}</span> · <time title="{{ c.when_ms|when }}">{{ c.when_ms|ago }}</time></div>
33
  </div>
34
  <div class="chg-side">
35
    {% call sig(c.signature) %}
36
    <a class="hash px" href="{{ repo.url }}/change/{{ c.hash }}" title="{{ c.hash }}">{{ c.short }}</a>
37
  </div>
38
</div>
39
{% endmacro %}
40
41
{% macro line_text(l) %}<pre>{% if l.segments.is_empty() %}{{ l.text }}{% else %}{% for g in l.segments %}{% if g.changed %}<span class="wx">{{ g.text }}</span>{% else %}{{ g.text }}{% endif %}{% endfor %}{% endif %}</pre>{% endmacro %}
42
43
{% macro diff_bar(ignore_ws, keep) %}
44
<div class="diff-bar">
45
  <span class="modes" data-diff-modes hidden><a href="#" data-diff-mode="unified">unified</a><a href="#" data-diff-mode="split">split</a></span>
46
  <a class="small" href="?{{ keep }}w={% if ignore_ws %}0{% else %}1{% endif %}">{% if ignore_ws %}show whitespace changes{% else %}hide whitespace changes{% endif %}</a>
47
  <a class="small" href="#" data-diff-collapse hidden>collapse all</a>
48
</div>
49
{% endmacro %}
50
51
{% macro diff(files, ignore_ws, keep) %}
52
{% if !files.is_empty() %}{% call diff_bar(ignore_ws, keep) %}{% endif %}
53
{% for f in files %}
54
<details class="file-diff" id="{{ f.anchor }}"{% if f.lines.len() <= 400 %} open{% endif %}>
55
  <summary>
56
    <span class="kind kind-{{ f.kind }}">{{ f.kind }}</span>
57
    <strong>{% if let Some(from) = f.from %}{{ from }} → {% endif %}{{ f.path }}</strong>
58
    <span class="counts"><span class="add">+{{ f.added }}</span> <span class="del">−{{ f.removed }}</span></span>
59
  </summary>
60
  {% if f.lines.is_empty() %}<p class="empty">No line changes.</p>{% else %}
61
  <table class="code diff">
62
  {% for l in f.lines %}
63
    <tr class="{{ l.kind.class() }}">
64
      <td class="n">{% if let Some(n) = l.old_no %}{{ n }}{% endif %}</td>
65
      <td class="n">{% if let Some(n) = l.new_no %}{{ n }}{% endif %}</td>
66
      <td class="s">{{ l.kind.sign() }}</td>
67
      <td class="t">{% call line_text(l) %}</td>
68
    </tr>
69
  {% endfor %}
70
  </table>
71
  {% endif %}
72
</details>
73
{% endfor %}
74
{% endmacro %}