41 lines
1.1 KiB
HTML
41 lines
1.1 KiB
HTML
|
{{ $slug := ((.Context).Value "params").Slug }}
|
||
|
{{ $file := (.Context).Value "file-data" }}
|
||
|
{{ $csrfToken := (.Context).Value "csrfToken" }}
|
||
|
|
||
|
{{ template "header" . }}
|
||
|
|
||
|
{{ if ($file).Error }}
|
||
|
<h2>File Error</h2>
|
||
|
|
||
|
<span class="adapter-error">{{($file).Error}}</span>
|
||
|
|
||
|
{{ else }}
|
||
|
{{ if ($file).IsDir }}
|
||
|
<h2>Directory: {{($file).Name}}</h2>
|
||
|
{{ else }}
|
||
|
<h2>File: {{($file).Name}}</h2>
|
||
|
{{end}}
|
||
|
|
||
|
<div class="action-panel">
|
||
|
<form class="file-move" method="POST" action="/move-select{{($file).Path}}">
|
||
|
<span>/{{($file).Path}}</span>
|
||
|
<input hidden name="csrfToken" value="{{$csrfToken}}"/>
|
||
|
<input type="submit" value="Move/Rename"/>
|
||
|
</form>
|
||
|
<details class="danger-zone"><summary>Danger Zone</summary>
|
||
|
<form class="file-delete" method="POST" action="/file-delete{{($file).Path}}">
|
||
|
<input hidden name="csrfToken" value="{{$csrfToken}}"/>
|
||
|
<label>I want to delete this file
|
||
|
<input type="checkbox" required/><br/>
|
||
|
</label>
|
||
|
<label>Yes, I'm sure!
|
||
|
<input type="checkbox" required/><br/>
|
||
|
</label>
|
||
|
<input type="submit" value="Delete"/>
|
||
|
</form>
|
||
|
</details>
|
||
|
</div>
|
||
|
|
||
|
{{ end }}
|
||
|
|
||
|
{{ template "footer" . }}
|