Template paths set to static

This commit is contained in:
mikgor 2018-10-27 17:30:25 +02:00
parent 4eafe2fe00
commit 4264ff0bf6
6 changed files with 9 additions and 13 deletions

View File

@ -10,13 +10,9 @@
</head>
<body>
<header>
<div class="headerColumn"><a href="http://127.0.0.1:8000"><div class="logoIcon"></div></a></div>
<div class="headerColumn">
<span id="purchasementsUrl"><a href="/purchasements">Lista zamówień</a></span></div>
<div class="headerColumn">
<a href="/cart"><div class="cartIcon"><div class="cartItems">{{.cart.ItemsTotal}}</div></div></a>
</div>
<div class="headerColumn"><a href="/"><div class="logoIcon"></div></a></div>
<div class="headerColumn"><span id="purchasementsUrl"><a href="/purchasements">Lista zamówień</a></span></div>
<div class="headerColumn"><a href="/cart"><div class="cartIcon"><div class="cartItems">{{.cart.ItemsTotal}}</div></div></a></div>
</header>
<div id="container">{{template "content" .}}</div>
</body>

View File

@ -1,7 +1,7 @@
{{define "content"}}
<script type="text/javascript">
function deleteitem(id) {
location.href = 'http://127.0.0.1:8000/removeFromCart?id=' + id;
location.href = '/removeFromCart?id=' + id;
}
</script>
<h1>Koszyk</h1>
@ -15,7 +15,7 @@ function deleteitem(id) {
{{range $.cart.Products}}
<div class="cartItem">
<div class="cartItemColumn">
<a href="http://127.0.0.1:8000/product?id={{ .Product.Id }}"><b>{{ .Product.Name }}</b>
<a href="/product?id={{ .Product.Id }}"><b>{{ .Product.Name }}</b>
<div class="cartItemIcon" style="background-image: url({{ .Product.ImgUrl }});"></div></a>
</div>
<div class="cartItemColumn">{{ .Product.Price }} zł</div>

View File

@ -1,7 +1,7 @@
{{define "content"}}
<h1>{{.category.Name}}</h1>
{{range $.products}}
<a href="http://127.0.0.1:8000/product?id={{ .Id }}">
<a href="/product?id={{ .Id }}">
<div class="productTile">
{{if le .Quantity 0}}
<div class="productUnavailable" style="width: 350px; position:absolute;">Produkt niedostępny</div>

View File

@ -34,7 +34,7 @@ function pay() {
var fN = document.getElementById("fname").value;
var lN = document.getElementById("lname").value;
if (fN!='' && lN!='')
location.href = 'http://127.0.0.1:8000/paymentDone?fn=' + fN + '&ln=' + lN + "&pm=" + pM + "&dd=" + dD;
location.href = '/paymentDone?fn=' + fN + '&ln=' + lN + "&pm=" + pM + "&dd=" + dD;
}
</script>
<h1>Podsumowanie</h1>

View File

@ -4,7 +4,7 @@
<a href="/category?id={{ .Id }}">
<div class="categoryTile">
<div class="categoryTileContent">
<div class="categoryIcon" style="background-image: url(http://127.0.0.1:8000/static/icons/{{ .Name }}.png);"></div>
<div class="categoryIcon" style="background-image: url(/static/icons/{{ .Name }}.png);"></div>
<div class="categoryName">{{ .Name }}</div>
</div>
</div>

View File

@ -1,7 +1,7 @@
{{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;
location.href = '/addToCart?id=' + {{.product.Id}} + '&quantity=' + document.getElementById("quantity").value;
}
</script>
<div class="productDescription">