2022-06-12 06:00:38 +00:00
|
|
|
{{ $slug := ((.Context).Value "params").Slug }}
|
2022-06-15 07:33:56 +00:00
|
|
|
{{ $file := ((.Context).Value "file-manager").GetFileData $slug }}
|
2022-06-12 06:00:38 +00:00
|
|
|
{{ $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">
|
2022-06-15 07:33:56 +00:00
|
|
|
<form class="file-move" method="GET" action="/file-move/{{($file).Path}}">
|
2022-06-12 06:00:38 +00:00
|
|
|
<span>/{{($file).Path}}</span>
|
|
|
|
<input type="submit" value="Move/Rename"/>
|
|
|
|
</form>
|
|
|
|
<details class="danger-zone"><summary>Danger Zone</summary>
|
2022-06-13 06:32:14 +00:00
|
|
|
<form class="file-delete" method="POST" action="/file-delete/{{($file).Path}}">
|
2022-06-12 06:00:38 +00:00
|
|
|
<input hidden name="csrfToken" value="{{$csrfToken}}"/>
|
2022-06-13 06:32:14 +00:00
|
|
|
<label>I want to delete this {{if ($file).IsDir }} diretory and everything under it {{ else }} file {{ end }}
|
2022-06-12 06:00:38 +00:00
|
|
|
<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" . }}
|