microservices-demo/src/frontend/templates/product.html

74 lines
2.3 KiB
HTML
Executable File

<!--
Copyright 2020 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
{{ define "product" }}
{{ template "header" . }}
<div {{ with $.platform_css }} class="{{.}}" {{ end }}>
<span class="platform-flag">
{{$.platform_name}}
</span>
</div>
<main role="main">
<div class="h-product">
<div class="row">
<div class="col">
<img src="{{$.product.Item.Picture}}" />
</div>
<div class="product-info col">
<div class="product-wrapper">
<h2>{{$.product.Item.Name}}</h2>
<p class="text-muted">
{{ renderMoney $.product.Price}}
</p>
<div>
<h6>Product Description:</h6>
{{$.product.Item.Description}}
</div>
<form method="POST" action="/cart" class="form-inline">
<input type="hidden" name="product_id" value="{{$.product.Item.Id}}" />
<div class="input-group">
<div class="input-group-prepend">
<label class="input-group-text" for="quantity">Quantity</label>
</div>
<select name="quantity" id="quantity" class="custom-select form-control form-control-lg">
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>10</option>
</select>
<button type="submit" class="btn btn-info btn-lg ml-3">Add to Cart</button>
</div>
</form>
</div>
</div>
</div>
</div>
<div class="container py-3 px-lg-5 py-lg-5">
{{ if $.recommendations}}
{{ template "recommendations" $.recommendations }}
{{ end }}
{{ with $.ad }}{{ template "text_ad" . }}{{ end}}
</div>
</main>
{{ template "footer" . }}
{{ end }}