gitscope
← rgit / main / templates/repo/file.html
https://dev.kronoz.win/r/rgit.git
templates/repo/file.html · HTML
Blame Raw
 1{% import "macros/link.html" as link %}
 2{% import "macros/breadcrumbs.html" as breadcrumbs %}
 3{% import "macros/sidebar_toggle.html" as sidebar_toggle %}
 4{% extends "repo/base.html" %}
 5
 6{% block head %}
 7    <link rel="stylesheet" type="text/css" href="/highlight-{{ crate::HIGHLIGHT_CSS_HASH.get().unwrap() }}.css" />
 8    <link rel="stylesheet" type="text/css" href="/highlight-dark-{{ crate::DARK_HIGHLIGHT_CSS_HASH.get().unwrap() }}.css" />
 9{%- endblock %}
10
11{% block tree_nav_class %}active{% endblock %}
12
13{% block subnav %}
14    {% call breadcrumbs::breadcrumbs(repo_path, filters::branch_query(branch.as_deref())) %}
15{% endblock %}
16
17{% block extra_nav_links %}
18    <a href="?raw=true{% call link::maybe_branch_suffix(branch) %}">plain</a>
19{% endblock %}
20
21{% block content %}
22{% call sidebar_toggle::sidebar_toggle("Open file browser") %}
23
24<div class="two-col">
25    <div class="sidebar">
26        {{ FileTree::new(full_tree.get(), &self.repo, Default::default(), query, Some(repo_path)).render()?|safe }}
27    </div>
28
29    <div>
30        <pre>
31            {%- match file.content -%}
32                {%- when crate::git::Content::Text with (content) -%}
33                    {{- content|safe -}}
34                {%- when crate::git::Content::Binary with (_) -%}
35                    &lt;binary file not displayed&gt;
36            {%- endmatch -%}
37        </pre>
38    </div>
39</div>
40{% endblock %}