shop_html_file.go 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. package template
  2. var VarShopHtmlFile = []byte(`{{template "header.html" .}}
  3. <div class="mb-4">
  4. {{if $.Data.Shop.HaveProducts}}
  5. <div class="grid-products">
  6. {{range $.Data.Shop.Products}}
  7. <div class="card card-product">
  8. <div class="card-img-link">
  9. <a href="{{.Permalink}}">
  10. {{if .HaveImages }}
  11. <img class="card-img-top" src="{{.Image.Thumbnail1}}" alt="{{$.Data.EscapeString .Name}}">
  12. {{else}}
  13. <img class="card-img-top" src="{{$.Data.ImagePlaceholderHref}}" alt="{{$.Data.EscapeString .Name}}">
  14. {{end}}
  15. </a>
  16. </div>
  17. <div class="card-body">
  18. <h5 class="card-title">
  19. <a href="{{.Permalink}}">
  20. {{if ne .Group ""}}
  21. {{.Group}}
  22. {{else}}
  23. {{.Name}}
  24. {{end}}
  25. </a>
  26. </h5>
  27. <div class="card-text">{{.Briefly}}</div>
  28. </div>
  29. <div class="card-footer">
  30. {{if le .Quantity 0}}<span class="badge badge-primary">Out of stock</span>{{end}}
  31. <a href="{{.Permalink}}" class="btn btn-success">View</a>
  32. <span class="price{{if gt .PriceOld 0.00}} price_red{{end}}">{{.PriceNice}} {{$.Data.Shop.CurrentCurrency.Code}}</span>
  33. {{if gt .PriceOld 0.00}}<span class="price price_old"><strike>{{.PriceOldNice}} {{$.Data.Shop.CurrentCurrency.Code}}</strike></span>{{else}}<span class="price price_old">&nbsp;</span>{{end}}
  34. </div>
  35. </div>
  36. {{end}}
  37. </div>
  38. {{else}}
  39. <div class="card">
  40. <div class="card-body">
  41. Sorry, no products matched your criteria
  42. </div>
  43. </div>
  44. {{end}}
  45. </div>
  46. {{if $.Data.Shop.HaveProducts}}
  47. {{if gt $.Data.Shop.ProductsMaxPage 1 }}
  48. <nav>
  49. <ul class="pagination mb-4">
  50. {{if $.Data.Shop.PaginationPrev}}
  51. <li class="page-item{{if $.Data.Shop.PaginationPrev.Current}} disabled{{end}}">
  52. <a class="page-link" href="{{$.Data.Shop.PaginationPrev.Link}}">Previous</a>
  53. </li>
  54. {{end}}
  55. {{range $.Data.Shop.Pagination}}
  56. {{if .Dots}}
  57. <li class="page-item disabled"><a class="page-link" href="">...</a></li>
  58. {{else}}
  59. <li class="page-item{{if .Current}} active{{end}}">
  60. <a class="page-link" href="{{.Link}}">{{.Num}}</a>
  61. </li>
  62. {{end}}
  63. {{end}}
  64. {{if $.Data.Shop.PaginationNext}}
  65. <li class="page-item{{if $.Data.Shop.PaginationNext.Current}} disabled{{end}}">
  66. <a class="page-link" href="{{$.Data.Shop.PaginationNext.Link}}">Next</a>
  67. </li>
  68. {{end}}
  69. </ul>
  70. </nav>
  71. {{end}}
  72. {{end}}
  73. {{template "footer.html" .}}`)