diff options
author | Andrew Godwin | 2022-12-01 18:46:49 -0700 |
---|---|---|
committer | Andrew Godwin | 2022-12-01 18:47:04 -0700 |
commit | 6f2f28a3a752cc47d9dc96bda862ed67cd75c9af (patch) | |
tree | 1165843b5c207d9e50028bf48db399df20cf7552 /templates/activities/_image_upload.html | |
parent | a826ae18ea41e44614ce20d5caad9425d76aa60d (diff) | |
download | takahe-6f2f28a3a752cc47d9dc96bda862ed67cd75c9af.tar.gz takahe-6f2f28a3a752cc47d9dc96bda862ed67cd75c9af.tar.bz2 takahe-6f2f28a3a752cc47d9dc96bda862ed67cd75c9af.zip |
Image attachment uploads
Diffstat (limited to 'templates/activities/_image_upload.html')
-rw-r--r-- | templates/activities/_image_upload.html | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/templates/activities/_image_upload.html b/templates/activities/_image_upload.html new file mode 100644 index 0000000..974884a --- /dev/null +++ b/templates/activities/_image_upload.html @@ -0,0 +1,15 @@ +<form + 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"> + {% csrf_token %} + {% include "forms/_field.html" with field=form.image %} + {% include "forms/_field.html" with field=form.description %} + <div class="buttons"> + <button _="on click show #attachmentProgress with display:block then hide me">Upload</button> + <progress id="attachmentProgress" value="0" max="100"></progress> + </div> +</form> |