-
Notifications
You must be signed in to change notification settings - Fork 1
/
product.html
116 lines (116 loc) · 5.12 KB
/
product.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
{{ printf "{{if eq $view `1`}}" | safeHTML}}
{{ printf "{{$index := productIndex $table $category $subcategory $pagenumber}}" | safeHTML}}
{{ printf "{{$products := productList $table $category $subcategory $view $pagenumber}}" | safeHTML}}
<hr>
{{ printf "{{range $products}}" | safeHTML }}
<div class="col s6">
<div style='margin:0 auto; text-align:center; width:auto;'>
{{ printf "{{.Name}}" | safeHTML }}
</div>
<div class="card horizontal">
{{ printf "{{if ne .Image1 ``}}" | safeHTML }}
{{ printf "<div class='card-image'>" | safeHTML }}
{{ printf "<a href='/img/{{if ne .Category ``}}{{.Category}}/{{end}}{{.Image1}}'>" | safeHTML }}
{{ printf "<img src='/img/{{if ne .Category ``}}{{.Category}}/{{end}}{{.Image1}}' alt='{{.Name}}' class='center'>" | safeHTML }}
{{ printf "</a>" | safeHTML }}
{{ printf "</div>" | safeHTML }}
{{ printf "{{end}}" | safeHTML }}
<br>
<div class="card-stacked">
<div class="card-content">
<div class="card-action">
<div class="center">
<p>{{ printf "{{.Description1}}" | safeHTML }}</p>
<p>{{ printf "<a href='/post/{{.PartNo}}' class='btn btn-info' role='button'>Read More</a>" | safeHTML }}</p>
<p>Price: ${{ printf "{{.Price}}" | safeHTML }}</p>
<p>In stock: {{ printf "{{.Qty}}" | safeHTML }}</p>
<p>
{{ printf "<button" | safeHTML }}
{{ printf " class='snipcart-add-item waves-effect waves-light btn'" | safeHTML }}
{{ printf " data-item-id='{{.PartNo}}'" | safeHTML }}
{{ printf " data-item-name='{{.PartNo}}'" | safeHTML }}
{{ printf " data-item-image='/img/{{.Category}}/{{.Image1}}'" | safeHTML }}
{{ printf " data-item-price='{{.Price}}'" | safeHTML }}
{{ printf " data-item-url='/post/{{.PartNo}}'" | safeHTML }}
{{ printf " data-item-description='{{.Name}}'" | safeHTML }}
{{ printf " data-item-min-quantity='{{.MinOrder}}'" | safeHTML }}
{{ printf " data-item-quantity='{{.DefaultQty}}'" | safeHTML }}
{{ printf " data-item-quantity-step='{{.StepQty}}'" | safeHTML }}
{{ printf " data-item-shippable='{{.Shippable}}'" | safeHTML }}
{{ printf " data-item-max-quantity='{{.MaxOrder}}'" | safeHTML }}
{{ printf " data-item-weight='{{convertozgrams .WeightOz}}'" | safeHTML }}
{{ printf " data-item-length='{{convertincm .Length `length`}}'" | safeHTML }}
{{ printf " data-item-width='{{convertincm .Width `width`}}'" | safeHTML }}
{{ printf " data-item-height='{{convertincm .Height `heigth`}}'" | safeHTML }}
{{ printf " data-item-has-taxes-included='false'>" | safeHTML }}
{{ printf "Add to cart" | safeHTML }}
{{ printf "</button>" | safeHTML }}
</p>
<p>
{{ printf "{{ if eq $category ``}}" | safeHTML }}
{{ printf "<a href='/cat/{{.Category}}'" | safeHTML }}
{{ printf " class='btn btn-info'" | safeHTML }}
{{ printf " role='button'>" | safeHTML }}
{{ printf "Browse: {{.Category}}" | safeHTML }}
{{ printf "</a>" | safeHTML }}
{{ printf "{{end}}" | safeHTML }}
</p>
</div>
</div>
</div>
</div>
</div>
</div>
<hr>
{{ printf "{{end}}" | safeHTML }}
{{ printf "{{end}}" | safeHTML }}
{{ printf "{{if eq $view `2`}}" | safeHTML }}
{{ printf "{{$index := productIndex $table $category $subcategory $pagenumber}}" | safeHTML}}
{{ printf "{{$products := productList $table $category $subcategory $view $pagenumber}}" | safeHTML}}
{{ printf "{{range $products}}" | safeHTML }}
<hr>
<div class="col s6">
<div style='margin:0 auto; text-align:center; width:auto;'>
{{ printf "{{.Name}}" | safeHTML }}
</div>
<div class="card horizontal">
<br>
<div class="card-stacked">
<div class="card-content">
<div class="card-action">
<div class="center">
<p>{{ printf "{{.Description1}}" | safeHTML }}</p>
<p>{{ printf "<a href='/post/{{.PartNo}}' class='btn btn-info' role='button'>Read More</a>" | safeHTML }}</p>
<p>Price: ${{ printf "{{.Price}}" | safeHTML }}</p>
<p>In stock: {{ printf "{{.Qty}}" | safeHTML }}</p>
<p>
{{ printf "<button" | safeHTML }}
{{ printf " class='snipcart-add-item waves-effect waves-light btn'" | safeHTML }}
{{ printf " data-item-id='{{.PartNo}}'" | safeHTML }}
{{ printf " data-item-name='{{.PartNo}}'" | safeHTML }}
{{ printf " data-item-image='/img/{{.Category}}/{{.Image1}}'" | safeHTML }}
{{ printf " data-item-price='{{.Price}}'" | safeHTML }}
{{ printf " data-item-url='/post/{{.PartNo}}'" | safeHTML }}
{{ printf " data-item-description='{{.Name}}'" | safeHTML }}
{{ printf " data-item-min-quantity='{{.MinOrder}}'" | safeHTML }}
{{ printf " data-item-quantity='{{.DefaultQty}}'" | safeHTML }}
{{ printf " data-item-quantity-step='{{.StepQty}}'" | safeHTML }}
{{ printf " data-item-shippable='{{.Shippable}}'" | safeHTML }}
{{ printf " data-item-max-quantity='{{.MaxOrder}}'" | safeHTML }}
{{ printf " data-item-weight='{{convertozgrams .WeightOz}}'" | safeHTML }}
{{ printf " data-item-length='{{convertincm .Length `length`}}'" | safeHTML }}
{{ printf " data-item-width='{{convertincm .Width `width`}}'" | safeHTML }}
{{ printf " data-item-height='{{convertincm .Height `heigth`}}'" | safeHTML }}
{{ printf " data-item-has-taxes-included='false'>" | safeHTML }}
{{ printf "Add to cart" | safeHTML }}
{{ printf "</button>" | safeHTML }}
</p>
</div>
</div>
</div>
</div>
</div>
</div>
<hr>
{{ printf "{{end}}" | safeHTML }}
{{ printf "{{end}}" | safeHTML }}