Krolyxon
Commit e758199

ferreniumtemplatesblob.html

44 lines · 1.9 KB · HTML

1{% extends "base.html" %}
2{% block content %}
3{% include "repo_nav.html" %}
4{% include "crumbs.html" %}
5<div class="blob-bar">
6 <p class="label blob-facts">{% for fact in facts %}{% if !loop.first %} · {% endif %}{{ fact }}{% endfor %}</p>
7 <div class="blob-actions">
8 {%- if let Some(toggle) = toggle %}
9 <nav class="segmented segmented-sm" aria-label="View">
10 <a href="{{ toggle.preview_url }}"{% if !toggle.source %} aria-current="true"{% endif %}>Preview</a>
11 <a href="{{ toggle.source_url }}"{% if toggle.source %} aria-current="true"{% endif %}>Source</a>
12 </nav>
13 {%- endif %}
14 <a class="btn-ghost" href="{{ raw_url }}">Raw</a>
15 <a class="btn-ghost" href="{{ blame_url }}">Blame</a>
16 <a class="btn-ghost" href="{{ log_url }}">History</a>
17 <a class="btn-ghost" href="{{ download_url }}">Download</a>
18 </div>
19</div>
20{%- match body %}
21{%- when Body::Code with { lines } %}
22<div class="code-wrap">
23<table class="code" data-lines>
24<tbody>
25{%- for line in lines.iter() %}
26<tr id="L{{ loop.index }}"><td class="ln"><a href="#L{{ loop.index }}">{{ loop.index }}</a></td><td class="lc">{{ line|safe }}</td></tr>
27{%- endfor %}
28</tbody>
29</table>
30</div>
31{%- when Body::Markdown with { html } %}
32<article class="markdown blob-markdown">{{ html|safe }}</article>
33{%- when Body::Image with { src } %}
34<figure class="image-view dot-grid"><img src="{{ src }}" alt="{{ here.as_deref().unwrap_or_default() }}"></figure>
35{%- when Body::Symlink with { target, url } %}
36<p class="blob-note"><span class="label">Symlink to</span> {% if let Some(url) = url %}<a class="mono" href="{{ url }}">{{ target }}</a>{% else %}<span class="mono">{{ target }}</span>{% endif %}</p>
37{%- when Body::Binary %}
38<p class="status blob-note">[Binary file]</p>
39{%- when Body::TooLarge %}
40<p class="status blob-note">[Too large to display] <a href="{{ raw_url }}">View raw</a></p>
41{%- when Body::Empty %}
42<p class="status blob-note">[Empty file]</p>
43{%- endmatch %}
44{% endblock %}