moved to templ
This commit is contained in:
parent
24722ee61c
commit
303d9703f1
28 changed files with 1522 additions and 853 deletions
32
templates/wyroby_ciasta.templ
Normal file
32
templates/wyroby_ciasta.templ
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
package templates
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"piekarnikgosi/types"
|
||||
)
|
||||
|
||||
templ card(product types.Product) {
|
||||
<div class="card">
|
||||
<div>
|
||||
<img alt={ product.Name } src={ fmt.Sprint("images/wyroby/", product.Image, ".avif") }/>
|
||||
</div>
|
||||
<div>
|
||||
<h3>{ product.Name }</h3>
|
||||
<span>{ product.Price }zł</span>
|
||||
<p>{ product.Description }</p>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
templ WyrobyCiasta(products []types.Product) {
|
||||
@layout("wyroby") {
|
||||
<main>
|
||||
@wyrobyHeader("wyroby")
|
||||
<div id="wyroby">
|
||||
for _, product:= range products {
|
||||
@card(product)
|
||||
}
|
||||
</div>
|
||||
</main>
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue