sliproad/assets/web/listing.html

52 lines
1.8 KiB
HTML
Raw Normal View History

{{ $path := .Path }}
{{ $prev := .Previous }}
{{ $prefix := .Prefix }}
{{ $singleprefix := .SinglePrefix }}
<html>
<head>
<title>{{ $path }} | PiNas</title>
<link rel="stylesheet" href="/assets/styles.css">
2019-03-01 06:27:13 +00:00
<script type="text/javascript" src="/assets/fileListing.js"></script>
</head>
2019-03-01 06:27:13 +00:00
<body ondragenter="dragEnter(event)" ondragexit="dragExit(event)">
<div id="uploadoverlay" class="fileupload hidden">
<p><img src="/assets/svgs/newfile.svg" alt="">Upload</p>
</div>
2019-02-24 10:59:16 +00:00
<header>
<a href="/" class="back-button">
<img src="/assets/svgs/back.svg" alt="">
2019-02-24 10:59:16 +00:00
</a>
<h1 style="display: inline-block">PiNas</h1>
</header>
<main>
<div>
<h1>{{$prefix}}/{{$path}}</h1>
</div>
<div class="content">
{{ if eq $prefix "files" }}
<form action="/upload" method="post" enctype="multipart/form-data">
2019-03-01 06:27:13 +00:00
<input id="path" type="value" value="{{$path}}" name="path">
<input type="file" data-multiple-caption="{count} files selected" multiple name="file">
<input type="submit" value="Upload">
</form>
{{end}}
<p class="directory"><a href="/{{$prefix}}/{{$prev}}">..</a></p>
{{range $file := .Files}}
{{ if $file.IsDir }}
2019-02-24 10:59:16 +00:00
<p class="directory"><a href="/{{$prefix}}/{{$path}}/{{$file.Name}}">
<img src="/assets/svgs/directory.svg" alt="">
{{$file.Name}}</a>
2019-02-24 10:59:16 +00:00
</p>
{{ end }}
{{ if not $file.IsDir }}
2019-02-24 10:59:16 +00:00
<p class="file"><a href="/{{$singleprefix}}/{{$path}}/{{$file.Name}}">
<img src="/assets/svgs/file.svg" alt="">
2019-02-24 10:59:16 +00:00
{{$file.Name}}</a>
</p>
{{end}}
{{end}}
</div>
</main>
</body>
</html>