better product card defaults

This commit is contained in:
Priec
2026-06-25 23:20:49 +02:00
parent d6d4f19010
commit caec8b4fb3
2 changed files with 2 additions and 2 deletions

View File

@@ -35,7 +35,7 @@
<h2 class="text-xl font-bold text-on-surface-strong dark:text-on-surface-dark-strong">{{ t(key="nav-shop", lang=lang | default(value='sk')) }}</h2>
<a href="/shop" class="text-sm font-semibold text-primary dark:text-primary-dark">{{ t(key="cart-continue", lang=lang | default(value='sk')) }} →</a>
</div>
<div x-data="{ view: 'grid' }" class="grid grid-cols-2 gap-4 sm:grid-cols-3">
<div x-data="{ view: 'list' }" class="flex flex-col gap-4">
{% for product in products %}
{% include "shop/_card.html" %}
{% endfor %}

View File

@@ -10,7 +10,7 @@
Expects: query, selected_category, sort, plus the result vars consumed by
_results.html. #}
{% set L = lang | default(value='sk') %}
<div x-data="{ view: localStorage.getItem('shopView') === 'list' ? 'list' : 'grid' }"
<div x-data="{ view: localStorage.getItem('shopView') === 'grid' ? 'grid' : 'list' }"
x-init="$watch('view', v => localStorage.setItem('shopView', v))"
class="space-y-6">
<form action="/search" method="get" role="search"