From 0f53adc6a81714e48a11d5f1b60c378f54c9af4b Mon Sep 17 00:00:00 2001 From: Stephan Kerkman Date: Sat, 30 May 2026 21:21:04 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20photo=20upload=20UX=20=E2=80=94=20remove?= =?UTF-8?q?=20camera=20capture,=20auto-submit=20on=20pick,=20update=20hero?= =?UTF-8?q?=20via=20HTMX=20OOB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plants/partials/photo_gallery.html | 26 ++++++++++++++++--- plants/templates/plants/plant_detail.html | 2 ++ 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/plants/templates/plants/partials/photo_gallery.html b/plants/templates/plants/partials/photo_gallery.html index 7bcae6f..0a41fee 100644 --- a/plants/templates/plants/partials/photo_gallery.html +++ b/plants/templates/plants/partials/photo_gallery.html @@ -35,12 +35,30 @@
+ hx-encoding="multipart/form-data" hx-indicator="#photo-upload-spinner" + id="photo-upload-form"> {% csrf_token %} +
- - + + Uploading…
+ +{% if request.htmx %} +
+{% if plant.species and plant.species.api_image_url %} +{{ plant.species.common_name }} +{% elif plant.thumbnail_url %} +{{ plant.name }} +{% else %} +
🌿
+{% endif %} +
+{% endif %} diff --git a/plants/templates/plants/plant_detail.html b/plants/templates/plants/plant_detail.html index eff6f5a..97085b4 100644 --- a/plants/templates/plants/plant_detail.html +++ b/plants/templates/plants/plant_detail.html @@ -8,6 +8,7 @@ ✏️ +
{% if plant.species and plant.species.api_image_url %} {{ plant.species.common_name }} {% elif plant.thumbnail_url %} @@ -15,6 +16,7 @@ {% else %}
🌿
{% endif %} +