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
+26 -5
View File
@@ -19,8 +19,15 @@
<div class="cart-item">
<img src="{{.Product.ImageURL}}" alt="{{.Product.Name}}" class="cart-item__img">
<div class="cart-item__info">
<h3>{{.Product.Name}}</h3>
<p class="cart-item__price">{{printf "%.0f" .Product.Price}} ₽</p>
<h3><a href="/product/{{.ProductID}}">{{.Product.Name}}</a></h3>
<div class="price-block">
{{if .Product.HasSale}}
<span class="price-block__old">{{printf "%.0f" .Product.Price}} ₽</span>
<span class="price-block__sale">{{printf "%.0f" .Product.SalePrice}} ₽</span>
{{else}}
<span class="cart-item__price">{{printf "%.0f" .Product.Price}} ₽</span>
{{end}}
</div>
</div>
<form method="POST" action="/cart/update" class="cart-item__qty">
<input type="hidden" name="product_id" value="{{.ProductID}}">
@@ -164,10 +171,24 @@
{{range .Orders}}
<div class="order-card">
<div class="order-card__head">
<strong>Заказ #{{.ID}}</strong>
<span>{{.CreatedAt.Format "02.01.2006 15:04"}}</span>
<span class="admin-badge admin-badge--ok">{{.Status}}</span>
<div>
<strong>Заказ #{{.ID}}</strong>
<span class="order-card__date">{{.CreatedAt.Format "02.01.2006 15:04"}}</span>
</div>
<span class="order-status {{orderClass .Status}}">{{orderLabel .Status}}</span>
</div>
{{if ne .Status "cancelled"}}
<div class="order-timeline">
{{range orderTimeline}}
<div class="order-timeline__step {{if stepCurrent $.Status .}}order-timeline__step--current{{end}} {{if stepDone $.Status .}}order-timeline__step--done{{end}}">
<span class="order-timeline__dot"></span>
<span class="order-timeline__label">{{orderLabel .}}</span>
</div>
{{end}}
</div>
{{end}}
<ul class="order-card__items">
{{range .Items}}
<li>{{.ProductName}} × {{.Quantity}} — {{printf "%.0f" .Price}} ₽</li>