added safety and color
This commit is contained in:
parent
a7ce92ba57
commit
25d607e68c
3 changed files with 129 additions and 41 deletions
|
|
@ -1,27 +1,65 @@
|
|||
<!DOCTYPE html>
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head><title>{{.Title}}</title><link rel="stylesheet" href="/static/css/style.css"></head>
|
||||
<body>
|
||||
<header><a class="logo" href="/">💿 ISOSilo</a></header>
|
||||
<main>
|
||||
<nav class="bc">
|
||||
{{range $i, $c := .Breadcrumbs}}<a href="{{$c.URL}}">{{$c.Name}}</a> {{if lt (add1 $i) (len $.Breadcrumbs)}}/{{end}} {{end}}
|
||||
</nav>
|
||||
<table class="tbl">
|
||||
<thead><tr><th>Name</th><th>Size</th><th>Action</th></tr></thead>
|
||||
<tbody>
|
||||
{{range .Entries}}
|
||||
<tr>
|
||||
<td>
|
||||
{{if .IsDir}}📁 <a href="/browse/{{urlenc $.ISOName}}/{{urlenc .Path}}" style="color:var(--text); text-decoration:none;">{{.Name}}</a>
|
||||
{{else}}{{fileIcon .Name}} <a href="/file/{{urlenc $.ISOName}}/{{urlenc .Path}}" target="_blank" style="color:var(--text); text-decoration:none;">{{.Name}}</a>{{end}}
|
||||
</td>
|
||||
<td>{{if .IsDir}}—{{else}}{{humanSize .Size}}{{end}}</td>
|
||||
<td>{{if not .IsDir}}<a href="/file/{{urlenc $.ISOName}}/{{urlenc .Path}}" class="dl-btn" download>Download</a>{{end}}</td>
|
||||
</tr>
|
||||
{{end}}
|
||||
</tbody>
|
||||
</table>
|
||||
</main>
|
||||
</body>
|
||||
<head>
|
||||
<title>{{.Title}}</title>
|
||||
<link rel="stylesheet" href="/static/css/style.css" />
|
||||
</head>
|
||||
<body>
|
||||
<header><a class="logo" href="/">💿 ISOSilo</a></header>
|
||||
<main>
|
||||
<nav class="bc">
|
||||
{{range $i, $c := .Breadcrumbs}}<a href="{{$c.URL}}"
|
||||
>{{$c.Name}}</a
|
||||
>
|
||||
{{if lt (add1 $i) (len $.Breadcrumbs)}}/{{end}} {{end}}
|
||||
</nav>
|
||||
<table class="tbl">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Size</th>
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{range .Entries}}
|
||||
<tr>
|
||||
<td>
|
||||
{{if .IsDir}}📁
|
||||
<a
|
||||
href="/browse/{{urlenc $.ISOName}}/{{urlenc .Path}}"
|
||||
style="
|
||||
color: var(--text);
|
||||
text-decoration: none;
|
||||
"
|
||||
>{{.Name}}</a
|
||||
>
|
||||
{{else}}{{fileIcon .Name}}
|
||||
<a
|
||||
href="/file/{{urlenc $.ISOName}}/{{urlenc .Path}}"
|
||||
target="_blank"
|
||||
style="
|
||||
color: var(--text);
|
||||
text-decoration: none;
|
||||
"
|
||||
>{{.Name}}</a
|
||||
>{{end}}
|
||||
</td>
|
||||
<td>
|
||||
{{if .IsDir}}—{{else}}{{humanSize .Size}}{{end}}
|
||||
</td>
|
||||
<td>
|
||||
{{if not .IsDir}}<a
|
||||
href="/file/{{urlenc $.ISOName}}/{{urlenc .Path}}"
|
||||
class="btn"
|
||||
download
|
||||
>Download</a
|
||||
>{{end}}
|
||||
</td>
|
||||
</tr>
|
||||
{{end}}
|
||||
</tbody>
|
||||
</table>
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue