Skip to content

Instantly share code, notes, and snippets.

@simt2
Created February 21, 2017 08:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save simt2/d513d1ba7ee0199ab41225fbe21abfba to your computer and use it in GitHub Desktop.
Save simt2/d513d1ba7ee0199ab41225fbe21abfba to your computer and use it in GitHub Desktop.
mesh-go-example productDetail.html
{{define "content"}}
{{with $product := index .Products 0}}
<div>
<h1>{{ $product.Get "fields.name" }}</h1>
<div class="row">
<div class="col-md-6">
<form name="productForm">
<div class="form-group">
<label for="name">Product Name</label>
<input type="text"
class="form-control"
id="name"
name="name"
placeholder="Name"
required
value="{{ $product.Get "fields.name" }}">
</div>
<div class="form-group">
<label for="description">Description</label>
<textarea class="form-control"
rows="7"
id="description"
name="description"
required
>{{ $product.Get "fields.description" }}</textarea>
</div>
<div class="form-group">
<label for="sku">SKU</label>
<input type="text"
class="form-control"
id="sku"
name="sku"
placeholder="SKU"
value="{{ $product.Get "fields.SKU" }}">
</div>
<div class="row">
<div class="col-sm-4 form-group">
<label for="price">Price</label>
<input type="number"
step="0.01"
min="0"
class="form-control"
id="price"
name="price"
value="{{ $product.Get "fields.price" }}">
</div>
<div class="col-sm-4 form-group">
<label for="weight">Weight</label>
<input type="number"
class="form-control"
min="0"
id="weight"
name="weight"
value="{{ $product.Get "fields.weight" }}">
</div>
<div class="col-sm-4 form-group">
<label for="stock">Stock Level</label>
<input type="number"
min="0"
class="form-control"
id="stock"
name="stock"
value="{{ $product.Get "fields.stocklevel" }}">
</div>
</div>
</form>
</div>
<div class="col-md-6">
<img style="width: 100%;" class="img-thumbnail" src="{{ $product.Get "fields.vehicleImage.path" }}">
</div>
</div>
</div>
{{end}}
{{end}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment