Blob: tree.html

Blob id: 8502ed81d0561911e5e1ee4a4699c5a8aa71c210

Size: 1.4 KB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
{% extends "base.html" %}

{% block content %}
    <h2>Tree</h2>
    {% if path %}
    <p>
        <a href="{{ url_for('repo_tree_path', repo_name=repo_name) }}?ref={{ ref }}">root</a>
        {% set parts = path.split('/') %}
        {% for part in parts %}
            / <a href="{{ url_for('repo_tree_path', repo_name=repo_name, path=parts[:loop.index]|join('/')) }}?ref={{ ref }}">{{ part }}</a>
        {% endfor %}
    </p>
    {% endif %}
    
    <table>
        <thead>
            <tr style="font-weight: bold;">
                <td>Name</td>
                <td>Type</td>
                <td>Size</td>
            </tr>
        </thead>
        <tbody>
            {% for item in tree_items %}
                <tr>
                    <td>
                        {% if item.type == 'tree' %}
                            <a href="{{ url_for('repo_tree_path', repo_name=repo_name, path=item.path) }}?ref={{ ref }}">{{ item.name }}/</a>
                        {% else %}
                            <a href="{{ url_for('repo_blob_path', repo_name=repo_name, path=item.path) }}?ref={{ ref }}">{{ item.name }}</a>
                        {% endif %}
                    </td>
                    <td>{{ item.type }}</td>
                    <td>{% if item.type == 'blob' %}{{ item.size | size }}{% endif %}</td>
                </tr>
            {% endfor %}
        </tbody>
    </table>
{% endblock %}