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