style: use prefetched queryset length in card_gallery template
This commit is contained in:
parent
39de3983f1
commit
52acd9e1f1
1 changed files with 3 additions and 3 deletions
|
|
@ -19,9 +19,8 @@
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endwith %}
|
|
||||||
|
|
||||||
{% if plant.card_photos.count < 3 %}
|
{% if card_photos|length < 3 %}
|
||||||
<form method="post" action="{% url 'upload_card_photo' plant.pk %}" enctype="multipart/form-data"
|
<form method="post" action="{% url 'upload_card_photo' plant.pk %}" enctype="multipart/form-data"
|
||||||
hx-post="{% url 'upload_card_photo' plant.pk %}" hx-target="#card-gallery" hx-swap="outerHTML"
|
hx-post="{% url 'upload_card_photo' plant.pk %}" hx-target="#card-gallery" hx-swap="outerHTML"
|
||||||
hx-encoding="multipart/form-data">
|
hx-encoding="multipart/form-data">
|
||||||
|
|
@ -32,6 +31,7 @@
|
||||||
<button type="submit" class="btn btn-sm btn-outline-secondary">Upload</button>
|
<button type="submit" class="btn btn-sm btn-outline-secondary">Upload</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
{% endif %}
|
|
||||||
<small class="text-muted">Up to 3 photos — front & back of the label</small>
|
<small class="text-muted">Up to 3 photos — front & back of the label</small>
|
||||||
|
{% endif %}
|
||||||
|
{% endwith %}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue