takahe/templates/activities/_image_upload.html

16 lines
621 B
HTML
Raw Normal View History

2022-12-01 17:46:49 -08:00
<form
2023-01-09 08:58:17 -08:00
hx-encoding='multipart/form-data'
hx-post='{% url "compose_image_upload" %}'
hx-target="this"
hx-swap="outerHTML"
_="on htmx:xhr:progress(loaded, total)
set #attachmentProgress.value to (loaded/total)*100">
2022-12-01 17:46:49 -08:00
{% csrf_token %}
{% include "forms/_field.html" with field=form.image %}
{% include "forms/_field.html" with field=form.description %}
<div class="buttons">
<button id="upload" _="on click show #attachmentProgress with display:block then hide me">Upload</button>
2022-12-01 17:46:49 -08:00
<progress id="attachmentProgress" value="0" max="100"></progress>
</div>
</form>