Skip to content
This repository was archived by the owner on Sep 2, 2024. It is now read-only.

Commit 6be162e

Browse files
committed
feat: add templates for show list of files, update link address in navbar template
1 parent 970f8b7 commit 6be162e

File tree

2 files changed

+48
-2
lines changed

2 files changed

+48
-2
lines changed

templates/fs_list.html

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{{ template "head" .}}
2+
3+
<body>
4+
{{template "navbar" .}}
5+
<div class="container p-6">
6+
<br>
7+
<h2 class="title is-2">
8+
Files
9+
</h2>
10+
<table class="table is-striped" style="width:100%;">
11+
<thead>
12+
<tr>
13+
<th style="width:40%;">Name</th>
14+
<th style="width:10%; text-align:center;">Size</th>
15+
<th style="width:10%; text-align:center;">Type</th>
16+
<th style="width:20%; text-align:center;">Uploaded</th>
17+
<th style="text-align:center;">Preview</th>
18+
<th style="text-align:center;">Delete</th>
19+
</tr>
20+
</thead>
21+
<tbody>
22+
{{range .Data}}
23+
{{$fileType := convertFileType .Key}}
24+
<tr style="height:100px;">
25+
<td>{{ parseFilename .Key }}</td>
26+
<td style="text-align:center;">{{ convertFileSize .Size }}</td>
27+
<td style="text-align:center;">{{ convertFileType .Key }}</td>
28+
<td style="text-align:center;">{{ convertFileUploadedDate .Uploaded}}</td>
29+
<td style="text-align:center;">TODO</td>
30+
<td style="text-align:center;">
31+
<a
32+
href="/ui/fs/del/{{ .ID }}"
33+
class="delete"
34+
onclick="return confirm('Are you sure you want to delete this file?\n\nThis is irreversible.')">
35+
</a>
36+
</td>
37+
</tr>
38+
{{end}}
39+
</tbody>
40+
</table>
41+
</div>
42+
43+
</body>
44+
45+
{{template "foot"}}
46+

templates/partials/navbar.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
forms
3030
</a>
3131

32-
<a class="navbar-item" href="#" onclick="alert('not implemented yet')">
32+
<a class="navbar-item" href="/ui/fs">
3333
files
3434
</a>
3535
</div>
@@ -45,4 +45,4 @@
4545
</div>
4646
</div>
4747
</nav>
48-
{{end}}
48+
{{end}}

0 commit comments

Comments
 (0)