fix: restore card photo section in plant_detail, fix identify_fields dropdown, remove stale filter test

- plant_detail.html: add card photos section with crop_thumbnail link (above photo gallery), satisfying test_card_button_shown_when_card_photos_exist
- identify_fields.html: replace Bootstrap data-bs-toggle dropdown with plain HTML <select> + onchange form submit, styled with Tailwind
- test_views.py: remove test_indoor_filter which tested ?filter=indoor that no longer exists

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Stephan Kerkman 2026-06-01 18:06:56 +02:00
parent 4e7655bf46
commit b9a84a41c5
3 changed files with 18 additions and 21 deletions

View file

@ -17,21 +17,16 @@
<div class="text-muted" style="font-size:11px;">vasteplantencatalogus.nl</div> <div class="text-muted" style="font-size:11px;">vasteplantencatalogus.nl</div>
</div> </div>
{% if vpc_results|length > 1 %} {% if vpc_results|length > 1 %}
<div class="dropdown"> <form method="get" action="{% url 'identify_fields' %}">
<button class="btn btn-sm btn-outline-secondary dropdown-toggle" type="button" data-bs-toggle="dropdown"> <select name="vpc_idx" onchange="this.form.submit()"
change class="w-full bg-white border border-[#F0E4D4] rounded-full px-4 py-2.5 font-nunito text-sm text-[#1A1208] outline-none focus:border-[#F07040]">
</button>
<ul class="dropdown-menu dropdown-menu-end">
{% for r in vpc_results %} {% for r in vpc_results %}
<li> <option value="{{ forloop.counter0 }}" {% if forloop.counter0 == vpc_idx %}selected{% endif %}>
<a class="dropdown-item {% if forloop.counter0 == vpc_idx %}active{% endif %}" {{ r.common_name }}
href="{% url 'identify_fields' %}?vpc_idx={{ forloop.counter0 }}"> </option>
{{ r.common_name }}
</a>
</li>
{% endfor %} {% endfor %}
</ul> </select>
</div> </form>
{% endif %} {% endif %}
</div> </div>
{% else %} {% else %}

View file

@ -102,6 +102,16 @@
{% include "plants/partials/pruning_strip.html" %} {% include "plants/partials/pruning_strip.html" %}
{% endif %} {% endif %}
<!-- Card photos (crop thumbnails) -->
{% if plant.card_photos.all %}
<div class="mb-4">
<p class="font-nunito font-bold text-[11px] text-[#B0A090] mb-2">🪧 Plant card photos</p>
<a href="{% url 'crop_thumbnail' plant.pk %}" class="btn-bloom-outline no-underline">
Edit card photo
</a>
</div>
{% endif %}
<!-- Photo gallery --> <!-- Photo gallery -->
<div id="photo-gallery" class="mb-4"> <div id="photo-gallery" class="mb-4">
{% include "plants/partials/photo_gallery.html" %} {% include "plants/partials/photo_gallery.html" %}

View file

@ -62,14 +62,6 @@ class TestPlantList:
assert resp.status_code == 200 assert resp.status_code == 200
assert resp.templates[0].name == 'plants/partials/plant_list_results.html' assert resp.templates[0].name == 'plants/partials/plant_list_results.html'
def test_indoor_filter(self, client):
Plant.objects.create(name='Fern', location=make_location('Office'), is_indoor=True)
Plant.objects.create(name='Rose', location=make_location('Garden'), is_indoor=False)
resp = client.get(reverse('plant_list') + '?filter=indoor')
content = resp.content.decode()
assert 'Fern' in content
assert 'Rose' not in content
@pytest.mark.django_db @pytest.mark.django_db
class TestPlantDetail: class TestPlantDetail: