2022-12-01 17:46:49 -08:00
|
|
|
<div class="uploaded-image">
|
|
|
|
<input type="hidden" name="attachment" value="{{ attachment.pk }}">
|
2022-12-12 06:22:11 -08:00
|
|
|
<img src="{{ attachment.thumbnail_url.relative }}">
|
2022-12-01 17:46:49 -08:00
|
|
|
<p>
|
|
|
|
{{ attachment.name|default:"(no description)" }}
|
|
|
|
</p>
|
|
|
|
<div class="buttons">
|
2023-01-08 11:20:05 -08:00
|
|
|
<button class="button delete left" _="on click remove closest .uploaded-image">Remove</button>
|
2022-12-01 17:46:49 -08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% if request.htmx %}
|
2023-01-09 08:58:17 -08:00
|
|
|
<button class="add-image"
|
|
|
|
hx-get='{% url "compose_image_upload" %}'
|
|
|
|
hx-target="this"
|
|
|
|
hx-swap="outerHTML"
|
|
|
|
_="on load if length of <.uploaded-image/> > 3 then hide me">
|
|
|
|
Add Image
|
|
|
|
</button>
|
2022-12-01 17:46:49 -08:00
|
|
|
{% endif %}
|