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