OXYGENHUB
# f2c9757605c1 oxygenhub / templates / repo_tabs.html
2.8 KiB · HTML · last changed Milestone 0.1: browse 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 }}/bookmarks"{% if tab == "bookmarks" %} class="on"{% endif %}>Bookmarks</a>
8
    <a href="{{ repo.url }}/tags"{% if tab == "tags" %} class="on"{% endif %}>Tags</a>
9
    <a href="{{ repo.url }}/conflicts"{% if tab == "conflicts" %} class="on"{% endif %}>Conflicts</a>
10
    <a href="{{ repo.url }}/trust"{% if tab == "trust" %} class="on"{% endif %}>Trust</a>
11
    <a href="{{ repo.url }}/pushes"{% if tab == "pushes" %} class="on"{% endif %}>Pushes</a>
12
  </div>
13
</div>
14
{% endmacro %}
15
16
{% macro sig(s) %}<span class="sig {{ s.class() }}" title="{{ s.title() }}">{{ s.glyph() }}</span>{% endmacro %}
17
18
{% 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 %}
19
20
{% macro change_row(repo, c) %}
21
<div class="chg">
22
  <div class="chg-main">
23
    <a class="title" href="{{ repo.url }}/change/{{ c.hash }}">{{ c.title }}</a>
24
    {% call labels(c) %}
25
    {% if c.resolution %}<span class="tag">resolution</span>{% endif %}
26
    {% if c.head %}<span class="tag head">head</span>{% endif %}
27
    <div class="meta"><span class="who">{{ c.author.name }}</span> · <time title="{{ c.when_ms|when }}">{{ c.when_ms|ago }}</time></div>
28
  </div>
29
  <div class="chg-side">
30
    {% call sig(c.signature) %}
31
    <a class="hash px" href="{{ repo.url }}/change/{{ c.hash }}" title="{{ c.hash }}">{{ c.short }}</a>
32
  </div>
33
</div>
34
{% endmacro %}
35
36
{% macro diff(files) %}
37
{% for f in files %}
38
<section class="file-diff" id="{{ f.anchor }}">
39
  <header>
40
    <span class="kind kind-{{ f.kind }}">{{ f.kind }}</span>
41
    <strong>{% if let Some(from) = f.from %}{{ from }} → {% endif %}{{ f.path }}</strong>
42
    <span class="counts"><span class="add">+{{ f.added }}</span> <span class="del">−{{ f.removed }}</span></span>
43
  </header>
44
  {% if f.lines.is_empty() %}<p class="empty">No line changes.</p>{% else %}
45
  <table class="code diff">
46
  {% for l in f.lines %}
47
    <tr class="{{ l.kind.class() }}">
48
      <td class="n">{% if let Some(n) = l.old_no %}{{ n }}{% endif %}</td>
49
      <td class="n">{% if let Some(n) = l.new_no %}{{ n }}{% endif %}</td>
50
      <td class="s">{{ l.kind.sign() }}</td>
51
      <td class="t"><pre>{{ l.text }}</pre></td>
52
    </tr>
53
  {% endfor %}
54
  </table>
55
  {% endif %}
56
</section>
57
{% endfor %}
58
{% endmacro %}