wayver's git archive


a simple self-hosted git server
git clone https://git.wayver.dev/bile

templates/tree.html@db2bc30f716095872b4ea33adafe072c0a8a7242

raw
Date Commit Message Author Files + -
2026-02-17 21:07 initial mvp wayverd 74 10800 0
...

1{% extends "base.html" %}
2
3{% block title %}{{repo|repo_name}} {{path.display()}} - {{crate::config().site_name}}{% endblock %}
4
5{% block content %}
6  {% include "repo-navbar.html" %}
7  <div class="main">
8    <table>
9      <tbody>
10        <tr>
11          <td>
12            {% if path.to_string_lossy() != "" %}
13              <h3>{{path.to_string_lossy()}}/@<a href="/{{repo|repo_name|urlencode_strict}}/tree/{{spec}}">{{spec}}</a></h3>
14            {% else %}
15              <h3>{{ spec }}</h3>
16            {% endif %}
17          </td>
18        </tr>
19      </tbody>
20    </table>
21    {% include "last-commit.html" %}
22    <table id="files">
23      <thead>
24        <tr>
25          <th>Mode</th>
26          <th>Name</th>
27          <th>Size</th>
28        </tr>
29      </thead>
30      <tbody>
31        {% for entry in tree %}
32          <tr>
33            <td class="permissions">
34              {{ entry.filemode()|unix_perms }}
35            </td>
36            {% let obj = entry.to_object(repo.as_inner()) %}
37            {% if obj.is_ok() %}
38              {% let o = obj.unwrap() %}
39              <td class="file-name">
40                <a href="/{{repo|repo_name|urlencode_strict}}/tree/{{ spec }}/item/{{path.join(entry.name().unwrap()).to_string_lossy()}}">{{entry.name().unwrap() }}{% if o.as_tree().is_some() %}/{% endif %}</a>
41              </td>
42              <td class="file-size">
43                {% if o.as_blob().is_some() %}
44                  {{ o.into_blob().unwrap().content().len()|filesizeformat }}
45                {% endif %}
46              </td>
47            {% else %}
48              <td class="file-name">{{ entry.name().unwrap() }}</td>
49              <td class="file-size"></td>
50            {% endif %}
51          </tr>
52        {% endfor %}
53      </tbody>
54    </table>
55  </div>
56{% endblock %}