|
c588255…
|
ragelink
|
1 |
{% extends "base.html" %} |
|
c588255…
|
ragelink
|
2 |
{% block title %}Files — {{ project.name }} — Fossilrepo{% endblock %} |
|
c588255…
|
ragelink
|
3 |
|
|
c588255…
|
ragelink
|
4 |
{% block content %} |
|
c588255…
|
ragelink
|
5 |
<h1 class="text-2xl font-bold text-gray-100 mb-2">{{ project.name }}</h1> |
|
c588255…
|
ragelink
|
6 |
{% include "fossil/_project_nav.html" %} |
|
c588255…
|
ragelink
|
7 |
|
|
c588255…
|
ragelink
|
8 |
<div class="flex items-center justify-between mb-6"> |
|
c588255…
|
ragelink
|
9 |
<h2 class="text-lg font-semibold text-gray-200">Unversioned Files</h2> |
|
c588255…
|
ragelink
|
10 |
<div> |
|
7e1aaf6…
|
ragelink
|
11 |
<span class="search-wrap"> |
|
c588255…
|
ragelink
|
12 |
<input type="search" |
|
c588255…
|
ragelink
|
13 |
name="search" |
|
c588255…
|
ragelink
|
14 |
value="{{ search }}" |
|
c588255…
|
ragelink
|
15 |
placeholder="Search files..." |
|
7e1aaf6…
|
ragelink
|
16 |
aria-label="Search files" |
|
c588255…
|
ragelink
|
17 |
class="rounded-md border-gray-700 bg-gray-800 text-gray-100 shadow-sm focus:border-brand focus:ring-brand text-sm px-3 py-1.5" |
|
c588255…
|
ragelink
|
18 |
hx-get="{% url 'fossil:unversioned' slug=project.slug %}" |
|
c588255…
|
ragelink
|
19 |
hx-trigger="input changed delay:300ms, search" |
|
c588255…
|
ragelink
|
20 |
hx-target="#unversioned-content" |
|
c588255…
|
ragelink
|
21 |
hx-swap="innerHTML" |
|
7e1aaf6…
|
ragelink
|
22 |
hx-push-url="true" |
|
7e1aaf6…
|
ragelink
|
23 |
hx-indicator="closest .search-wrap" /> |
|
7e1aaf6…
|
ragelink
|
24 |
<svg class="search-spinner animate-spin h-4 w-4" fill="none" viewBox="0 0 24 24"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"></path></svg> |
|
7e1aaf6…
|
ragelink
|
25 |
</span> |
|
c588255…
|
ragelink
|
26 |
</div> |
|
c588255…
|
ragelink
|
27 |
</div> |
|
c588255…
|
ragelink
|
28 |
|
|
c588255…
|
ragelink
|
29 |
<div id="unversioned-content"> |
|
c588255…
|
ragelink
|
30 |
{% if files %} |
|
2f13242…
|
ragelink
|
31 |
<div class="overflow-x-auto rounded-lg bg-gray-800 shadow-sm border border-gray-700"> |
|
c588255…
|
ragelink
|
32 |
<table class="min-w-full divide-y divide-gray-700"> |
|
2f13242…
|
ragelink
|
33 |
<thead class="bg-gray-900/80"> |
|
c588255…
|
ragelink
|
34 |
<tr> |
|
c588255…
|
ragelink
|
35 |
<th class="px-6 py-3 text-left text-xs font-medium text-gray-400 uppercase tracking-wider">Name</th> |
|
c588255…
|
ragelink
|
36 |
<th class="px-6 py-3 text-left text-xs font-medium text-gray-400 uppercase tracking-wider">Size</th> |
|
c588255…
|
ragelink
|
37 |
<th class="px-6 py-3 text-left text-xs font-medium text-gray-400 uppercase tracking-wider">Modified</th> |
|
c588255…
|
ragelink
|
38 |
<th class="px-6 py-3 text-right text-xs font-medium text-gray-400 uppercase tracking-wider"></th> |
|
c588255…
|
ragelink
|
39 |
</tr> |
|
c588255…
|
ragelink
|
40 |
</thead> |
|
2f13242…
|
ragelink
|
41 |
<tbody class="divide-y divide-gray-700/70"> |
|
c588255…
|
ragelink
|
42 |
{% for file in files %} |
|
2f13242…
|
ragelink
|
43 |
<tr class="hover:bg-gray-700/30 transition-colors"> |
|
c588255…
|
ragelink
|
44 |
<td class="px-6 py-3 text-sm text-gray-200 font-mono">{{ file.name }}</td> |
|
c588255…
|
ragelink
|
45 |
<td class="px-6 py-3 text-sm text-gray-400">{{ file.size|filesizeformat }}</td> |
|
46f6d5e…
|
ragelink
|
46 |
<td class="px-6 py-3 text-sm text-gray-400">{% if file.mtime %}{{ file.mtime|date:"Y-m-d H:i" }} UTC{% else %}--{% endif %}</td> |
|
c588255…
|
ragelink
|
47 |
<td class="px-6 py-3 text-right"> |
|
c588255…
|
ragelink
|
48 |
<a href="{% url 'fossil:unversioned_download' slug=project.slug filename=file.name %}" |
|
c588255…
|
ragelink
|
49 |
class="inline-flex items-center rounded-md bg-gray-700 px-3 py-1 text-xs font-semibold text-gray-300 hover:bg-gray-600"> |
|
c588255…
|
ragelink
|
50 |
Download |
|
c588255…
|
ragelink
|
51 |
</a> |
|
c588255…
|
ragelink
|
52 |
</td> |
|
c588255…
|
ragelink
|
53 |
</tr> |
|
c588255…
|
ragelink
|
54 |
{% endfor %} |
|
c588255…
|
ragelink
|
55 |
</tbody> |
|
c588255…
|
ragelink
|
56 |
</table> |
|
c588255…
|
ragelink
|
57 |
</div> |
|
c588255…
|
ragelink
|
58 |
{% else %} |
|
c588255…
|
ragelink
|
59 |
<div class="rounded-lg bg-gray-800 border border-gray-700 p-8 text-center"> |
|
c588255…
|
ragelink
|
60 |
<p class="text-sm text-gray-500">{% if search %}No files matching "{{ search }}".{% else %}No unversioned files.{% endif %}</p> |
|
c588255…
|
ragelink
|
61 |
</div> |
|
c588255…
|
ragelink
|
62 |
{% endif %} |
|
c588255…
|
ragelink
|
63 |
{% include "includes/_pagination_manual.html" %} |
|
c588255…
|
ragelink
|
64 |
</div> |
|
c588255…
|
ragelink
|
65 |
|
|
c588255…
|
ragelink
|
66 |
{% if has_admin %} |
|
c588255…
|
ragelink
|
67 |
<div class="mt-6"> |
|
c588255…
|
ragelink
|
68 |
<form method="post" |
|
c588255…
|
ragelink
|
69 |
action="{% url 'fossil:unversioned_upload' slug=project.slug %}" |
|
c588255…
|
ragelink
|
70 |
enctype="multipart/form-data" |
|
2f13242…
|
ragelink
|
71 |
class="rounded-lg bg-gray-800 border border-gray-700 p-4 shadow-sm"> |
|
c588255…
|
ragelink
|
72 |
{% csrf_token %} |
|
c588255…
|
ragelink
|
73 |
<h4 class="text-sm font-medium text-gray-300 mb-3">Upload File</h4> |
|
c588255…
|
ragelink
|
74 |
<div class="flex items-center gap-3"> |
|
c588255…
|
ragelink
|
75 |
<input type="file" name="file" required |
|
c588255…
|
ragelink
|
76 |
class="block w-full text-sm text-gray-400 file:mr-4 file:py-1.5 file:px-3 file:rounded-md file:border-0 file:text-sm file:font-semibold file:bg-brand file:text-white hover:file:bg-brand-hover" /> |
|
c588255…
|
ragelink
|
77 |
<button type="submit" |
|
2f13242…
|
ragelink
|
78 |
class="rounded-md bg-brand px-4 py-1.5 text-sm font-semibold text-white shadow-sm hover:bg-brand-hover focus:outline-none focus:ring-2 focus:ring-brand focus:ring-offset-2 focus:ring-offset-gray-950 transition-colors whitespace-nowrap"> |
|
c588255…
|
ragelink
|
79 |
Upload |
|
c588255…
|
ragelink
|
80 |
</button> |
|
c588255…
|
ragelink
|
81 |
</div> |
|
c588255…
|
ragelink
|
82 |
<p class="mt-2 text-xs text-gray-500">Unversioned files do not preserve history. Only the latest version is kept.</p> |
|
c588255…
|
ragelink
|
83 |
</form> |
|
c588255…
|
ragelink
|
84 |
</div> |
|
c588255…
|
ragelink
|
85 |
{% endif %} |
|
c588255…
|
ragelink
|
86 |
{% endblock %} |