moved html and css out to seperate files.
This commit is contained in:
parent
a4c02cdbc1
commit
f9cfd3fc3b
5 changed files with 152 additions and 126 deletions
27
templates/browse.html
Normal file
27
templates/browse.html
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
<!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>
|
||||
</html>
|
||||
38
templates/index.html
Normal file
38
templates/index.html
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
<!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>
|
||||
|
||||
<div class="grid">
|
||||
{{range .Items}}
|
||||
{{if .IsDir}}
|
||||
<a href="/{{urlenc .RelativePath}}" class="card">
|
||||
<div class="folder-icon">📁</div>
|
||||
<div class="card-body"><span class="card-name">{{.Name}}</span></div>
|
||||
</a>
|
||||
{{else}}
|
||||
<div class="card">
|
||||
<a href="/browse/{{urlenc .RelativePath}}">
|
||||
{{if .HasImage}}<img src="/raw/{{urlenc (trimExt .RelativePath)}}{{.ImageExt}}" class="card-img">
|
||||
{{else}}<div class="iso-icon">💿</div>{{end}}
|
||||
</a>
|
||||
<div class="card-body">
|
||||
<a href="/browse/{{urlenc .RelativePath}}" class="card-name">{{.Name}}</a>
|
||||
<p class="card-desc">{{if .Description}}{{.Description}}{{else}}ISO Disk Image{{end}}</p>
|
||||
<div style="margin-top:1rem; display:flex; gap:0.5rem;">
|
||||
<a href="/browse/{{urlenc .RelativePath}}" class="dl-btn">Browse</a>
|
||||
<a href="/raw/{{urlenc .RelativePath}}" class="dl-btn" download>ISO</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
{{end}}
|
||||
</div>
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Add table
Add a link
Reference in a new issue