gitscope
← rgit / 0.1.5 / templates/repo/tree.html
https://dev.kronoz.win/r/rgit.git
templates/repo/tree.html · HTML
Blame Raw
 1{% import "macros/breadcrumbs.html" as breadcrumbs %}
 2{% extends "repo/base.html" %}
 3
 4{% block tree_nav_class %}active{% endblock %}
 5
 6{% block subnav %}
 7    {% call breadcrumbs::breadcrumbs(repo_path, query) %}
 8{% endblock %}
 9
10{% block content %}
11<div class="table-responsive">
12<table class="repositories">
13    <thead>
14    <tr>
15        <th style="width: 10rem;">Mode</th>
16        <th>Name</th>
17        <th>Size</th>
18    </tr>
19    </thead>
20
21    <tbody>
22    {% for item in items -%}
23    <tr>
24        {% match item -%}
25        {%- when crate::git::TreeItem::Tree with (tree) -%}
26        <td><pre>{{ tree.mode|file_perms }}</pre></td>
27        <td><pre><a class="nested-tree" href="/{{ repo.display() }}/tree/{{ tree.path.display() }}{{ query }}">{{ tree.name }}</a>
28            {%- for child in tree.children.ancestors().collect_vec().into_iter().rev() -%}
29                {%- if let Some(file_name) = child.file_name() %} / <a class="nested-tree" href="/{{ repo.display() }}/tree/{{ tree.path.display() }}/{{ child.display() }}{{ query }}">{{ file_name.to_string_lossy() }}</a>{%- endif -%}
30            {%- endfor -%}
31        </pre></td>
32        <td></td>
33        <td></td>
34
35        {%- when crate::git::TreeItem::File with (file) -%}
36        <td><pre>{{ file.mode|file_perms }}</pre></td>
37        <td><pre><a href="/{{ repo.display() }}/tree/{{ file.path.display() }}{{ query }}">{{ file.name }}</a></pre></td>
38        <td><pre>{{ file.size }}</pre></td>
39        <td></td>
40
41        {%- when crate::git::TreeItem::Submodule with (submodule) -%}
42        <td><pre>{{ submodule.mode|file_perms }}</pre></td>
43        <td><pre>🔗 <a href="{{ submodule.url }}">{{ submodule.name }}</a> @ {{ submodule.oid.to_hex_with_len(7) }}</pre></td>
44        <td></td>
45        <td></td>
46        {%- endmatch %}
47    </tr>
48    {% endfor -%}
49    </tbody>
50</table>
51</div>
52{% endblock %}