2022-06-13 06:32:14 +00:00
|
|
|
{{ $slug := ((.Context).Value "params").Slug }}
|
|
|
|
{{ $csrfToken := (.Context).Value "csrfToken" }}
|
2022-06-15 07:33:56 +00:00
|
|
|
{{ $fileData := ((.Context).Value "file-manager").GetFileData $slug }}
|
2022-06-13 06:32:14 +00:00
|
|
|
|
|
|
|
{{ template "header" . }}
|
|
|
|
|
2022-06-15 07:33:56 +00:00
|
|
|
{{ if ($fileData).Error }}
|
2022-06-14 04:03:34 +00:00
|
|
|
|
2022-06-18 06:17:08 +00:00
|
|
|
<h2>Filesystem Error</h2>
|
2022-06-15 07:33:56 +00:00
|
|
|
<span class="adapter-error">{{($fileData).Error}}</span>
|
2022-06-14 04:03:34 +00:00
|
|
|
|
|
|
|
{{ else }}
|
2022-06-13 06:32:14 +00:00
|
|
|
<h2>File Upload</h2>
|
|
|
|
|
|
|
|
<form class="uploader" enctype="multipart/form-data" method="POST" action="/upload-process/{{$slug}}">
|
|
|
|
<input hidden type="text" name="csrfToken" value="{{$csrfToken}}"/>
|
|
|
|
|
|
|
|
<span>Uploading file to /{{$slug}}</span><br/>
|
|
|
|
<span class="upload-warning">(file with the same name as your upload will be overwritten!)</span><br/>
|
2022-06-14 04:03:34 +00:00
|
|
|
<div class="upload-wrapper">
|
|
|
|
<label for="file-upload">Select File</label><br/>
|
|
|
|
<input required type="file" id="file-upload" name="file"/>
|
|
|
|
<div class="file-feedback"></div>
|
|
|
|
</div>
|
2022-06-13 06:32:14 +00:00
|
|
|
<input type="submit" value="Upload"/>
|
|
|
|
</form>
|
|
|
|
|
2022-06-14 04:03:34 +00:00
|
|
|
{{ end }}
|
|
|
|
|
|
|
|
{{ template "footer" . }}
|