30 lines
942 B
HTML
30 lines
942 B
HTML
{{ $slug := ((.Context).Value "params").Slug }}
|
|
{{ $csrfToken := (.Context).Value "csrfToken" }}
|
|
{{ $fileData := ((.Context).Value "file-manager").GetFileData $slug }}
|
|
|
|
{{ template "header" . }}
|
|
|
|
{{ if ($fileData).Error }}
|
|
|
|
<h2>Filesystem Error</h2>
|
|
<span class="adapter-error">{{($fileData).Error}}</span>
|
|
|
|
{{ else }}
|
|
<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/>
|
|
<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>
|
|
<input type="submit" value="Upload"/>
|
|
</form>
|
|
|
|
{{ end }}
|
|
|
|
{{ template "footer" . }}
|