FossilRepo

fossilrepo / templates / fossil / partials / file_tree.html
1
<div id="file-tree" class="overflow-x-auto">
2
{% if tree %}
3
<table class="min-w-full">
4
<tbody class="divide-y divide-gray-700">
5
{% for entry in tree %}
6
<tr class="hover:bg-gray-700/30 transition-colors">
7
<td class="px-4 py-2 whitespace-nowrap" style="width: 35%;">
8
{% if entry.is_dir %}
9
<a href="{% url 'fossil:code_dir' slug=project.slug dirpath=entry.path %}" class="flex items-center gap-2 text-sm text-gray-200 hover:text-brand-light">
10
<svg class="h-4 w-4 text-brand-light flex-shrink-0" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
11
<path stroke-linecap="round" stroke-linejoin="round" d="M2.25 12.75V12A2.25 2.25 0 014.5 9.75h15A2.25 2.25 0 0121.75 12v.75m-8.69-6.44l-2.12-2.12a1.5 1.5 0 00-1.061-.44H4.5A2.25 2.25 0 002.25 6v12a2.25 2.25 0 002.25 2.25h15A2.25 2.25 0 0021.75 18V9a2.25 2.25 0 00-2.25-2.25h-5.379a1.5 1.5 0 01-1.06-.44z" />
12
</svg>
13
{{ entry.name }}
14
</a>
15
{% else %}
16
<a href="{% url 'fossil:code_file' slug=project.slug filepath=entry.path %}" class="flex items-center gap-2 text-sm text-gray-300 hover:text-brand-light">
17
<svg class="h-4 w-4 text-gray-500 flex-shrink-0" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
18
<path stroke-linecap="round" stroke-linejoin="round" d="M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m2.25 0H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z" />
19
</svg>
20
{{ entry.name }}
21
</a>
22
{% endif %}
23
</td>
24
<td class="px-4 py-2 text-sm text-gray-500 truncate max-w-md">
25
{{ entry.commit_message|truncatechars:60 }}
26
</td>
27
<td class="px-4 py-2 whitespace-nowrap text-xs text-gray-600 text-right">
28
{% if entry.size %}{{ entry.size|filesizeformat }}{% endif %}
29
</td>
30
<td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500 text-right">
31
{% if entry.commit_time %}{{ entry.commit_time|timesince }} ago{% endif %}
32
</td>
33
</tr>
34
{% endfor %}
35
</tbody>
36
</table>
37
{% else %}
38
<p class="text-sm text-gray-500 py-8 text-center">No files in this directory.</p>
39
{% endif %}
40
</div>
41

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button