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