OXYGENHUB
# 36e5a9c15a84 oxygenhub / templates / repo_tabs.html
6.0 KiB · HTML · last changed Tests tab: a bookmark's test results over its runs (part 2) 29 days ago source blame history raw
1
{% macro tabs(repo, tab) %}
2
<nav class="tabs" aria-label="Repository">
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.archived %} <span class="tag warn" title="This repository is archived: read-only">archived</span>{% endif %} <span class="vis vis-{{ repo.visibility }}" title="{% if repo.visibility == "public" %}Anyone can see this repository{% else if repo.visibility == "internal" %}Anyone signed in to this hub can see this repository{% else %}Only people given access can see this repository{% endif %}"><span aria-hidden="true">{% if repo.visibility == "public" %}◯{% else if repo.visibility == "internal" %}◐{% else %}●{% endif %}</span> {{ repo.visibility }}</span>{% if let Some(b) = repo.stored_in %} <span class="tag" title="This repository's data lives in {% if repo.can(crate::auth::Access::Admin) %}{{ b }}, {% endif %}its owner's bucket">bucket</span>{% endif %}</span>
5
    <a href="{{ repo.url }}"{% if tab == "code" %} class="on" aria-current="page"{% endif %}>Code</a>
6
    <a href="{{ repo.url }}/changes/{{ repo.default_bookmark }}"{% if tab == "changes" %} class="on" aria-current="page"{% endif %}>Changes</a>
7
    <a href="{{ repo.url }}/proposals"{% if tab == "proposals" %} class="on" aria-current="page"{% 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" aria-current="page"{% endif %}>Issues{% if repo.open_issues > 0 %} <span class="count-chip">{{ repo.open_issues }}</span>{% endif %}</a>
9
    {% if repo.wiki || repo.can(crate::auth::Access::Write) %}<a href="{{ repo.url }}/wiki"{% if tab == "wiki" %} class="on" aria-current="page"{% endif %}>Wiki</a>{% endif %}
10
    <a href="{{ repo.url }}/flow"{% if tab == "flow" %} class="on" aria-current="page"{% endif %}>Flow</a>
11
    {% if repo.tests %}<a href="{{ repo.url }}/tests"{% if tab == "tests" %} class="on" aria-current="page"{% endif %}>Tests</a>{% endif %}
12
    {% if repo.coverage %}<a href="{{ repo.url }}/coverage"{% if tab == "coverage" %} class="on" aria-current="page"{% endif %}>Coverage</a>{% endif %}
13
    <a href="{{ repo.url }}/bookmarks"{% if tab == "bookmarks" %} class="on" aria-current="page"{% endif %}>Bookmarks</a>
14
    <a href="{{ repo.url }}/releases"{% if tab == "releases" %} class="on" aria-current="page"{% endif %}>Releases</a>
15
    <a href="{{ repo.url }}/tags"{% if tab == "tags" %} class="on" aria-current="page"{% endif %}>Tags</a>
16
    <a href="{{ repo.url }}/conflicts"{% if tab == "conflicts" %} class="on" aria-current="page"{% endif %}>Conflicts</a>
17
    <a href="{{ repo.url }}/trust"{% if tab == "trust" %} class="on" aria-current="page"{% endif %}>Trust</a>
18
    <a href="{{ repo.url }}/pushes"{% if tab == "pushes" %} class="on" aria-current="page"{% endif %}>Pushes</a>
19
    {% if repo.can_maintain() %}<a href="{{ repo.url }}/settings"{% if tab == "settings" %} class="on" aria-current="page"{% endif %}>Settings</a>{% endif %}
20
  </div>
21
</nav>
22
{% endmacro %}
23
24
{% macro sig(s) %}<span class="sig {{ s.class() }}" title="{{ s.title() }}">{{ s.glyph() }}</span>{% endmacro %}
25
26
{% 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 %}
27
28
{% macro change_row(repo, c) %}
29
<div class="chg">
30
  <div class="chg-main">
31
    <a class="title" href="{{ repo.url }}/change/{{ c.hash }}">{{ c.title }}</a>
32
    {% call labels(c) %}
33
    {% if c.resolution %}<span class="tag">resolution</span>{% endif %}
34
    {% if c.head %}<span class="tag head">head</span>{% endif %}
35
    <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 %}{% if let Some(v) = c.via %} <span class="mute">via {{ v.name }}</span> <span class="tag{% if v.revoked %} bad{% endif %}" title="{{ v.title() }}">agent</span>{% endif %}</span> · <time title="{{ c.when_ms|when }}">{{ c.when_ms|ago }}</time></div>
36
  </div>
37
  <div class="chg-side">
38
    {% call sig(c.signature) %}
39
    <a class="hash px" href="{{ repo.url }}/change/{{ c.hash }}" title="{{ c.hash }}">{{ c.short }}</a>
40
  </div>
41
</div>
42
{% endmacro %}
43
44
{% 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 %}
45
46
{% macro diff_bar(ignore_ws, keep) %}
47
<div class="diff-bar">
48
  <span class="modes" data-diff-modes hidden><a href="#" data-diff-mode="unified">unified</a><a href="#" data-diff-mode="split">split</a></span>
49
  <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>
50
  <a class="small" href="#" data-diff-collapse hidden>collapse all</a>
51
</div>
52
{% endmacro %}
53
54
{% macro diff(files, ignore_ws, keep) %}
55
{% if !files.is_empty() %}{% call diff_bar(ignore_ws, keep) %}{% endif %}
56
{% for f in files %}
57
<details class="file-diff" id="{{ f.anchor }}"{% if f.lines.len() <= 400 %} open{% endif %}>
58
  <summary>
59
    <span class="kind kind-{{ f.kind }}">{{ f.kind }}</span>
60
    <strong>{% if let Some(from) = f.from %}{{ from }} → {% endif %}{{ f.path }}</strong>
61
    <span class="counts"><span class="add">+{{ f.added }}</span> <span class="del">−{{ f.removed }}</span></span>
62
  </summary>
63
  {% if f.lines.is_empty() %}<p class="empty">No line changes.</p>{% else %}
64
  <table class="code diff">
65
  {% for l in f.lines %}
66
    <tr class="{{ l.kind.class() }}">
67
      <td class="n">{% if let Some(n) = l.old_no %}{{ n }}{% endif %}</td>
68
      <td class="n">{% if let Some(n) = l.new_no %}{{ n }}{% endif %}</td>
69
      <td class="s">{{ l.kind.sign() }}</td>
70
      <td class="t">{% call line_text(l) %}</td>
71
    </tr>
72
  {% endfor %}
73
  </table>
74
  {% endif %}
75
</details>
76
{% endfor %}
77
{% endmacro %}