shop.html 2.4 KB

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