| 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="{{ download_url }}">Download</a> |
| 16 | </div> |
| 17 | </div> |
| 18 | {%- match body %} |
| 19 | {%- when Body::Code with { lines } %} |
| 20 | <div class="code-wrap"> |
| 21 | <table class="code" data-lines> |
| 22 | <tbody> |
| 23 | {%- for line in lines.iter() %} |
| 24 | <tr id="L{{ loop.index }}"><td class="ln"><a href="#L{{ loop.index }}">{{ loop.index }}</a></td><td class="lc">{{ line|safe }}</td></tr> |
| 25 | {%- endfor %} |
| 26 | </tbody> |
| 27 | </table> |
| 28 | </div> |
| 29 | {%- when Body::Markdown with { html } %} |
| 30 | <article class="markdown blob-markdown">{{ html|safe }}</article> |
| 31 | {%- when Body::Image with { src } %} |
| 32 | <figure class="image-view dot-grid"><img src="{{ src }}" alt="{{ here.as_deref().unwrap_or_default() }}"></figure> |
| 33 | {%- when Body::Symlink with { target, url } %} |
| 34 | <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> |
| 35 | {%- when Body::Binary %} |
| 36 | <p class="status blob-note">[Binary file]</p> |
| 37 | {%- when Body::TooLarge %} |
| 38 | <p class="status blob-note">[Too large to display] <a href="{{ raw_url }}">View raw</a></p> |
| 39 | {%- when Body::Empty %} |
| 40 | <p class="status blob-note">[Empty file]</p> |
| 41 | {%- endmatch %} |
| 42 | {% endblock %} |