v0.30: product pages, categories, sale prices and order status timeline

This commit is contained in:
shop
2026-06-25 17:29:43 +03:00
parent 532351e1c9
commit e000264bb1
26 changed files with 1061 additions and 248 deletions
+2 -19
View File
@@ -43,7 +43,7 @@
<h2 class="section__title">Популярные категории</h2>
<div class="categories">
{{range .Categories}}
<a href="#catalog" class="category-card">
<a href="/category/{{.Slug}}" class="category-card">
<span class="category-card__name">{{.Name}}</span>
<span class="category-card__count">{{.Count}} товаров</span>
</a>
@@ -60,24 +60,7 @@
</div>
<div class="products">
{{range .Products}}
<article class="product-card">
<div class="product-card__image">
<img src="{{.ImageURL}}" alt="{{.Name}}" loading="lazy">
<span class="product-card__badge">{{.Category}}</span>
</div>
<div class="product-card__body">
<h3 class="product-card__title">{{.Name}}</h3>
<p class="product-card__desc">{{plain .Description}}</p>
<div class="product-card__footer">
<span class="product-card__price">{{printf "%.0f" .Price}} ₽</span>
<form method="POST" action="/cart/add">
<input type="hidden" name="product_id" value="{{.ID}}">
<input type="hidden" name="quantity" value="1">
<button type="submit" class="btn btn--primary btn--sm">В корзину</button>
</form>
</div>
</div>
</article>
{{template "product_card" .}}
{{else}}
<p class="empty">Товары скоро появятся в каталоге.</p>
{{end}}