tube/templates/upload.html
Heinrich 'Henrik' Langos 0a793f7d3f feat: Make upload path selectable (#39)
This works for me, but for a more public site, I think I'll also add a boolean attribute named "upload_allowed" and "writable" to Config.Library..

Something to allow you to configure which directories can receive new uploads, and which directories we consider writable for other purposes (like editing meta data in yml, creating new thumbnails, ...)

Co-authored-by: Heinrich Langos <gumbo2000@noreply@mills.io>
Reviewed-on: https://git.mills.io/prologic/tube/pulls/39
Co-authored-by: Heinrich 'Henrik' Langos <gumbo2000@noreply@mills.io>
Co-committed-by: Heinrich 'Henrik' Langos <gumbo2000@noreply@mills.io>
2022-11-25 02:48:06 +00:00

46 lines
2.3 KiB
HTML

{{define "content"}}
<div style="text-align: center;">
<label class="upload-container" onclick="labelClicked(event)">
<div class="upload-wrapper">
<form id="upload-form" class="upload-form" enctype="multipart/form-data" method="POST" action="/upload">
<input id="video-input" type="file" accept="video/*" onchange="fileSelected()" style="display: none;"/>
<div class="upload-box">
<img width="100" src="/static/upload-icon.png"/>
<span>Click to browse or drop file here</span>
</div>
<div class="upload-details">
<select id="target-library-path" name="target-library-path">
{{range $index, $item :=.Config.Library}}
<option value="{{$item.Path}}">{{$item.Path}}</option>
{{end}}
</select>
<input id="video-title" type="text" placeholder="Optional title" />
<textarea id="video-description" rows="2" placeholder="Optional description"></textarea>
<div id="upload-file" class="upload-file">
<span id="upload-filename"></span>
<img width="20" src="/static/close-icon.png" onclick="removeFile(event)"/>
</div>
<span id="upload-message" class="upload-message">No file selected</span>
<div id="upload-button-wrapper" class="upload-button-wrapper">
<button id="upload-button" class="upload-button" onclick="startUploading()" type="button">
<span id="upload-stopped">Upload</span>
<span id="upload-started" class="loader" style="display: none;"></span>
</button>
</div>
<div id="upload-progress-container" class="upload-progress-container">
<div id="upload-progress" class="upload-progress">
<span id="upload-progress-label" class="upload-progress-label"></span>
</div>
<div style="flex-grow: 1;"></div>
</div>
</div>
</form>
</div>
</label>
<p><a href="/import">Importing a video? Click here</a></p>
</div>
{{end}}
{{define "scripts"}}
<script>window['MAX_UPLOAD_SIZE'] = '{{.Config.Server.MaxUploadSize}}';</script>
<script type="application/javascript" src="/static/upload.js"></script>
{{end}}