31 lines
1.2 KiB
HTML
31 lines
1.2 KiB
HTML
{{define "content"}}
|
|
<script type="text/javascript">
|
|
function buy() {
|
|
location.href = 'http://127.0.0.1:8000/addToCart?id=' + {{.product.Id}} + '&quantity=' + document.getElementById("quantity").value;
|
|
}
|
|
</script>
|
|
<div class="productDescription">
|
|
<div class="productDescriptionColumn">
|
|
<div class="productDescriptionContent">
|
|
<h1>{{.product.Name}}</h1>
|
|
<div class="productDescriptionIcon" style="background-image: url({{ .product.ImgUrl }});"></div>
|
|
</div>
|
|
</div>
|
|
<div class="productDescriptionColumn">
|
|
<div class="productDescriptionText">
|
|
{{.product.Description}}<br><br>
|
|
{{if gt .product.Quantity 0}}
|
|
<div class="productPrice">Ilość sztuk: <input id="quantity" type="number" name="quantity" min="1" max="{{.product.Quantity}}" value="1"></div>
|
|
<small>Dostępna Ilość: {{.product.Quantity}}</small><br><br>
|
|
{{end}}
|
|
<div class="productPrice">Cena: {{.product.Price}} zł</div><br>
|
|
{{if gt .product.Quantity 0}}
|
|
<input type="button" value="Dodaj do koszyka" onclick="buy();">
|
|
{{else}}
|
|
<div class="productUnavailable">Produkt niedostępny</div>
|
|
{{end}}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{{end}}
|