bloombase/plants/templates/plants/plant_detail.html
Stephan Kerkman a60c99ed93 feat: replace pruning UI with bloom months
- Add bloom_months to Plant and Species models (migration 0003)
- Swap pruning_months form field for bloom_months throughout
- Plant detail shows green bloom strip instead of pruning strip
- Dashboard shows 'Blooming now' count and list instead of overdue pruning
- Remove ✂️ pruning calendar from nav (feature hidden, backend intact)
- Update dashboard tests to reflect new context

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-28 17:03:25 +02:00

87 lines
3.3 KiB
HTML

{% extends "plants/base.html" %}
{% block title %}{{ plant.name }} — PlantDB{% endblock %}
{% block content %}
<div class="d-flex align-items-center gap-2 mb-2">
<a href="{% url 'plant_list' %}" class="btn btn-sm btn-outline-secondary"></a>
<h5 class="mb-0 flex-grow-1">{{ plant.name }}</h5>
<a href="{% url 'plant_edit' plant.pk %}" class="btn btn-sm btn-outline-secondary">✏️</a>
</div>
{% if plant.photo %}
<img src="{{ plant.photo.url }}" class="plant-hero rounded mb-3" alt="{{ plant.name }}">
{% elif plant.species and plant.species.api_image_url %}
<img src="{{ plant.species.api_image_url }}" class="plant-hero rounded mb-3" alt="{{ plant.species.common_name }}">
{% else %}
<div class="plant-hero-placeholder rounded mb-3">🌿</div>
{% endif %}
<div class="d-flex justify-content-between align-items-start mb-1">
<div>
<h6 class="mb-0">{{ plant.name }}</h6>
{% if plant.species %}<small class="text-muted fst-italic">{{ plant.species.scientific_name }}</small>{% endif %}
</div>
<span class="badge {% if plant.is_indoor %}bg-info{% else %}bg-success{% endif %}">
{% if plant.is_indoor %}Indoor{% else %}Outdoor{% endif %}
</span>
</div>
<p class="text-muted small mb-2">📍 {{ plant.location }}</p>
{% if plant.species %}
<div class="mb-3">
{% if plant.species.watering %}
<span class="care-chip" style="background:#e3f2fd; color:#1565c0;">💧 {{ plant.species.watering }}</span>
{% endif %}
{% if plant.species.sunlight %}
<span class="care-chip" style="background:#fff9c4; color:#7d4a00;">☀️ {{ plant.species.sunlight }}</span>
{% endif %}
{% if plant.species.max_height_cm %}
<span class="care-chip" style="background:#f3e5f5; color:#4a148c;">📏 up to {{ plant.species.max_height_cm }} cm</span>
{% endif %}
{% if plant.species.growth_rate %}
<span class="care-chip" style="background:#e8f5e9; color:#1b5e20;">🌱 {{ plant.species.growth_rate }}</span>
{% endif %}
</div>
{% if plant.species.api_image_url and plant.photo %}
<div class="mb-3 d-flex align-items-center gap-2">
<img src="{{ plant.species.api_image_url }}" width="60" height="60" class="rounded" style="object-fit:cover;">
<small class="text-muted">Species reference: {{ plant.species.common_name }}</small>
</div>
{% endif %}
{% endif %}
{% load plant_extras %}
{% if plant.bloom_months %}
<div class="mb-3 p-2 rounded" style="background:#d8f3dc; border-left:4px solid #52b788;">
<strong>🌸 Bloom</strong>
<div class="mt-1">{% month_strip plant.bloom_months %}</div>
</div>
{% endif %}
{% if plant.notes %}
<div class="card mb-3">
<div class="card-body py-2">
<small class="text-muted">{{ plant.notes|linebreaksbr }}</small>
</div>
</div>
{% endif %}
{% if plant.pruning_logs.all %}
<div class="mb-3">
<h6>Pruning history</h6>
<ul class="list-group list-group-flush">
{% for log in plant.pruning_logs.all %}
<li class="list-group-item py-1">
<strong>{{ log.pruned_on|date:"j M Y" }}</strong>
{% if log.notes %}<small class="text-muted ms-2">{{ log.notes }}</small>{% endif %}
</li>
{% endfor %}
</ul>
</div>
{% endif %}
<a href="{% url 'plant_delete' plant.pk %}" class="btn btn-outline-danger btn-sm">Delete plant</a>
{% endblock %}