nirvash/templates/file_list.html

35 lines
871 B
HTML
Raw Normal View History

{{ $slug := ((.Context).Value "params").Slug }}
{{ $fileList := ((.Context).Value "file-manager").ListSubTree $slug }}
{{ template "header" .}}
{{ if ($fileList).Error }}
<h2>File Listing Error</h2>
<span class="adapter-error">{{($fileList).Error}}</span>
{{ else }}
<h2>Files: {{($fileList).Root}}</h2>
<div class="new-page-button-wrapper">
<a class="new-page-button" href="/upload{{($fileList).Root}}">Upload File</a>
</div>
<div class="page-list">
<ul>
{{ if ($fileList).Up }}
<li><a href="/static-mgr{{$fileList.Up}}">..</a></li>
{{ end }}
{{ range $dir := ($fileList).SubDirs }}
<li><a href="/static-mgr{{($fileList).Root}}{{$dir}}">{{$dir}}/</a></li>
{{ end }}
{{ range $file := ($fileList).Files }}
<li><a href="/files{{($fileList).Root}}{{$file}}">{{$file}}</a></li>
{{ end }}
</ul>
</div>
{{ end }}
{{ template "footer" .}}