I tried to use ../, and ../../ to make the routes relatives, but it would not work well because the same page would have two URLs, one ending with slash and another without, and the relative links would be different on each case.
39 lines
1.4 KiB
Plaintext
39 lines
1.4 KiB
Plaintext
<!--
|
|
SPDX-FileCopyrightText: 2023 jordi fita mas <jordi@tandem.blog>
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
-->
|
|
{{ define "title" -}}
|
|
{{( pgettext "Upload Media" "title" )}}
|
|
{{- end }}
|
|
|
|
{{ define "breadcrumb" -}}
|
|
<li><a href="/admin/media">{{( pgettext "Media" "title" )}}</a></li>
|
|
{{- end }}
|
|
|
|
{{ define "content" -}}
|
|
{{- /*gotype: dev.tandem.ws/tandem/camper/pkg/media.uploadForm*/ -}}
|
|
<form id="mediaUpload" enctype="multipart/form-data" action="/admin/media" method="post" data-hx-boost="true">
|
|
<h2>{{( pgettext "Upload Media" "title" )}}</h2>
|
|
{{ CSRFInput }}
|
|
<fieldset>
|
|
{{ with .File -}}
|
|
<label>
|
|
{{( pgettext "File" "input" )}}
|
|
<input type="file" name="{{ .Name }}"
|
|
required {{ template "error-attrs" . }}><br>
|
|
</label>
|
|
<p>{{ printf (gettext "Maximum upload file size: %s") (.MaxSize | humanizeBytes) }}</p>
|
|
{{ template "error-message" . }}
|
|
{{- end }}
|
|
</fieldset>
|
|
<footer>
|
|
<button type="submit">{{( pgettext "Upload" "action" )}}</button>
|
|
<progress value="0" max="100"></progress>
|
|
</footer>
|
|
</form>
|
|
<script type="module">
|
|
import {camperUploadForm} from "/static/camper.js?v={{ camperVersion }}";
|
|
camperUploadForm(document.getElementById('mediaUpload'));
|
|
</script>
|
|
{{- end }}
|