From 39de3983f137e59ec6c89e5cfdaebbd825dcc859 Mon Sep 17 00:00:00 2001 From: Stephan Kerkman Date: Thu, 28 May 2026 21:56:09 +0200 Subject: [PATCH] feat: add card gallery partial and plant card page templates --- .../plants/partials/card_gallery.html | 38 ++++++++++++++++++- plants/templates/plants/plant_card.html | 7 +++- 2 files changed, 43 insertions(+), 2 deletions(-) diff --git a/plants/templates/plants/partials/card_gallery.html b/plants/templates/plants/partials/card_gallery.html index 4e9c7ac..585d5b8 100644 --- a/plants/templates/plants/partials/card_gallery.html +++ b/plants/templates/plants/partials/card_gallery.html @@ -1 +1,37 @@ -
+
+ {% with card_photos=plant.card_photos.all %} + {% if card_photos %} +
+ {% for photo in card_photos %} +
+ +
+
+ {% csrf_token %} + +
+
+
+ {% endfor %} +
+ {% endif %} + {% endwith %} + + {% if plant.card_photos.count < 3 %} +
+ {% csrf_token %} +
+ + +
+
+ {% endif %} + Up to 3 photos — front & back of the label +
diff --git a/plants/templates/plants/plant_card.html b/plants/templates/plants/plant_card.html index 5eb3d04..3a97e4e 100644 --- a/plants/templates/plants/plant_card.html +++ b/plants/templates/plants/plant_card.html @@ -1,9 +1,14 @@ {% extends "plants/base.html" %} {% block title %}Plant card — {{ plant.name }} — PlantDB{% endblock %} {% block content %} +
← {{ plant.name }}
Plant card
- + + + {% endblock %}