Skip to content

Commit 9523df4

Browse files
ssk42claude
andcommitted
Fix grid layout on items page
The stagger animation wrapper div was breaking the Bootstrap grid by wrapping column elements. Now passing stagger_index as a Jinja variable and applying it directly to the card element. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent af2549c commit 9523df4

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

templates/items_list.html

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,9 +200,8 @@ <h2 class="h4 mb-0">{{ group.user.name }}</h2>
200200
</div>
201201
<div class="row">
202202
{% for item in group.items %}
203-
<div style="--stagger-index: {{ loop.index0 }};">
204-
{% include 'partials/_item_card.html' %}
205-
</div>
203+
{% set stagger_index = loop.index0 %}
204+
{% include 'partials/_item_card.html' %}
206205
{% endfor %}
207206
</div>
208207
</section>

templates/partials/_item_card.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{# Partial template for a single item card - used by htmx swaps #}
22
<div class="col-md-6 col-lg-4 mb-4">
3-
<div class="glass-card p-3 h-100 d-flex flex-column stagger-item" id="item-card-{{ item.id }}">
3+
<div class="glass-card p-3 h-100 d-flex flex-column stagger-item" id="item-card-{{ item.id }}" style="--stagger-index: {{ stagger_index|default(0) }};">
44
<!-- Image Section -->
55
<div class="position-relative mb-3 rounded overflow-hidden" style="height: 200px;">
66
<img src="{{ item.image_url or default_image_url }}" class="w-100 h-100 object-fit-cover"

0 commit comments

Comments
 (0)