shop.tonybtw.com

shop.tonybtw.com

https://git.tonybtw.com/shop.tonybtw.com.git git://git.tonybtw.com/shop.tonybtw.com.git
458 bytes raw
1
package views
2
3
import "shop.tonybtw.com/internal/models"
4
5
templ Home(products []models.Product, cart_count int) {
6
	@Layout("Shop") {
7
		<h1>Products</h1>
8
		<div class="product-grid">
9
			for _, product := range products {
10
				<a href={ templ.URL("/product/" + product.Slug) } class="product-card">
11
					<img src={ product.Image_URL } alt={ product.Name }/>
12
					<h2>{ product.Name }</h2>
13
					<p>{ Format_Price(product.Price) }</p>
14
				</a>
15
			}
16
		</div>
17
	}
18
}