Krolyxon
Tag v0.1.0

ferreniumtemplatescommit.html

111 lines · 4.8 KB · HTML

1{% extends "base.html" %}
2{% block content %}
3{% include "repo_nav.html" %}
4{% include "crumbs.html" %}
5<section class="commit-head">
6 <h2 class="commit-subject">{{ subject }}</h2>
7 {%- if !body.is_empty() %}
8 <pre class="commit-body">{{ body }}</pre>
9 {%- endif %}
10</section>
11<div class="commit-grid">
12 <dl class="stats commit-meta">
13 {%- for m in meta %}
14 <div class="stat">
15 <dt class="label">{{ m.label }}</dt>
16 <dd>
17 {%- if let Some(title) = m.title %}<span title="{{ title }}">{{ m.value }}</span>{% else %}{{ m.value }}{% endif %}
18 {%- for (text, url) in m.links %}{% if !loop.first %} {% endif %}<a class="sha" href="{{ url }}">{{ text }}</a>{% endfor -%}
19 </dd>
20 </div>
21 {%- endfor %}
22 </dl>
23 <div class="diffstat-hero">
24 {%- if diff.too_many_files %}
25 <p class="diffstat-num">{{ files.len() }}</p>
26 <p class="label dim">Files changed</p>
27 {%- else %}
28 <p class="diffstat-num"><span class="add">+{{ added }}</span> <span class="del">&minus;{{ removed }}</span></p>
29 <p class="label dim">{{ files.len() }} {% if files.len() == 1 %}file{% else %}files{% endif %} changed</p>
30 {%- endif %}
31 </div>
32</div>
33<div class="commit-actions">
34 <div class="blob-actions">
35 <a class="btn-ghost" href="{{ tree_url }}">Browse files</a>
36 <a class="btn-ghost" href="{{ patch_url }}">Patch</a>
37 </div>
38 <div class="blob-actions">
39 <nav class="segmented segmented-sm" aria-label="Whitespace">
40 {%- for t in ws_toggle %}
41 <a href="{{ t.url }}"{% if t.active %} aria-current="true"{% endif %}>{{ t.label }}</a>
42 {%- endfor %}
43 </nav>
44 <span class="label dim context-ctl">
45 {%- if let Some(url) = context_less %}<a href="{{ url }}" aria-label="Less context">&minus;</a>{% else %}<span>&minus;</span>{% endif -%}
46 <span>Context {{ context }}</span>
47 {%- if let Some(url) = context_more %}<a href="{{ url }}" aria-label="More context">+</a>{% else %}<span>+</span>{% endif -%}
48 </span>
49 </div>
50</div>
51{%- if files.is_empty() %}
52<p class="status blob-note">[No changes]</p>
53{%- else %}
54<ol class="file-list">
55 {%- for row in files %}
56 <li class="file-row">
57 <span class="file-status" title="{{ row.status }}">{{ row.letter }}</span>
58 <a class="file-path" href="#{{ row.anchor }}">{% if let Some(from) = row.from %}<span class="dim">{{ from }} &rarr; </span>{% endif %}{{ row.path }}</a>
59 {%- if let Some((a, r)) = row.file.stat %}
60 <span class="file-counts"><span class="add">+{{ a }}</span> <span class="del">&minus;{{ r }}</span></span>
61 {%- else %}
62 <span class="file-counts"></span>
63 {%- endif %}
64 <span class="blocks" aria-hidden="true">{% for b in row.bar %}<i class="{{ b }}"></i>{% endfor %}</span>
65 </li>
66 {%- endfor %}
67</ol>
68{%- endif %}
69{%- if diff.too_many_files %}
70<p class="status blob-note">[Diff too large: {{ files.len() }} files] <a href="{{ patch_url }}">View patch</a></p>
71{%- else %}
72{%- for row in files %}
73<section class="diff-file" id="{{ row.anchor }}">
74 <header class="diff-head">
75 <span class="file-status" title="{{ row.status }}">{{ row.letter }}</span>
76 <span class="diff-path">{% if let Some(from) = row.from %}<span class="dim">{{ from }} &rarr; </span>{% endif %}{{ row.path }}</span>
77 {%- if let Some(url) = row.url %}
78 <a class="label diff-view" href="{{ url }}">View</a>
79 {%- endif %}
80 </header>
81 {%- if let Some((old_mode, new_mode)) = row.file.mode_change %}
82 <p class="label dim diff-note">Mode {{ old_mode }} &rarr; {{ new_mode }}</p>
83 {%- endif %}
84 {%- match row.file.body %}
85 {%- when Body::Hunks with (hunks) %}
86 <div class="code-wrap">
87 <table class="code diff">
88 <tbody>
89 {%- for hunk in hunks %}
90 <tr class="hunk"><td class="ln" colspan="2"></td><td class="lc" colspan="2">{{ hunk.header }}</td></tr>
91 {%- for line in hunk.lines %}
92 <tr class="{{ line.class() }}"><td class="ln">{% if let Some(n) = line.old %}{{ n }}{% endif %}</td><td class="ln">{% if let Some(n) = line.new %}{{ n }}{% endif %}</td><td class="sign">{{ line.sign() }}</td><td class="lc">{{ line.html|safe }}</td></tr>
93 {%- endfor %}
94 {%- endfor %}
95 </tbody>
96 </table>
97 </div>
98 {%- when Body::Unchanged %}
99 <p class="status diff-note">[No content changes]</p>
100 {%- when Body::Binary %}
101 <p class="status diff-note">[Binary file]</p>
102 {%- when Body::Submodule with { old, new } %}
103 <p class="diff-note"><span class="label">Submodule</span> <span class="mono">{% if let Some(o) = old %}{{ o.to_hex_with_len(7) }}{% else %}&mdash;{% endif %} &rarr; {% if let Some(n) = new %}{{ n.to_hex_with_len(7) }}{% else %}&mdash;{% endif %}</span></p>
104 {%- when Body::TooLarge %}
105 <p class="status diff-note">[Diff too large]{% if let Some(url) = row.url %} <a href="{{ url }}">View file</a>{% endif %}</p>
106 {%- when Body::NotShown %}
107 {%- endmatch %}
108</section>
109{%- endfor %}
110{%- endif %}
111{% endblock %}