You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

204 lines
5.3 KiB

  1. ::use 'design.mtt'::
  2. <div class="col-md-9">
  3. <div class="shop">
  4. <!-- 2018-09-27 -->
  5. <div style="display:none;">
  6. ::if(contracts!=null)::
  7. ::foreach c contracts::
  8. ::c.name::
  9. ::end::
  10. ::end::
  11. </div>
  12. <div class="header">
  13. <div style="float:right;text-align:right;">
  14. ::if place!=null::
  15. <span class="info">
  16. <span class="glyphicon glyphicon-map-marker"></span> <a href="/place/view/::place.id::">::place::</a>
  17. </span>
  18. ::end::
  19. ::if place!=null::
  20. <div class="address">
  21. $$nullSafe(::place.address1::)
  22. $$nullSafe(::place.address2::)
  23. $$nullSafe(::place.zipCode::)
  24. $$nullSafe(::place.city::)
  25. </div>
  26. ::end::
  27. </div>
  28. <div>
  29. ::set hdate = hDate(date)::
  30. <div class="info" style="font-size:1.2em;">::__("Distribution on ::date::",{date:hdate})::</div>
  31. <div class="">
  32. <span class="info">
  33. <span class="glyphicon glyphicon-time"></span> ::_("Orders will close on")::
  34. </span>
  35. ::if ArrayTool.mapLength(infos) == 1::
  36. ::hDate( infos.iterator().next()[0].orderEndDate )::
  37. ::else::
  38. <ul>
  39. ::foreach k infos.keys()::
  40. <li>
  41. ::set dists = infos.get(k)::
  42. ::if dists.length==1::
  43. ::dists[0]._contract.name::
  44. ::else::
  45. ::set tt = ""::
  46. ::foreach d dists::
  47. ::set tt = tt + d._contract.name + ". "::
  48. ::end::
  49. <span data-toggle="tooltip" title="::tt::" style="text-decoration:underline;">::_("Autres")::</span>
  50. ::end::
  51. : ::hDate(Date.fromString(k))::
  52. </li>
  53. ::end::
  54. </ul>
  55. ::end::
  56. </div>
  57. </div>
  58. </div>
  59. <div class="body">
  60. <script language="javascript">
  61. var cart;
  62. $(function(){
  63. cart = _.getCart();
  64. cart.init("::place.id::","::date.toString().substr(0,10)::");
  65. });
  66. </script>
  67. <div class="row">
  68. ::foreach p products::
  69. <div class="col-xs-12 col-sm-6 col-lg-4 product product::p.id::" style="display:none;">
  70. ::set popup = "_.overlay('/shop/productInfo/" + p.id + "?distribution=" + p.distributionId + "','" + urlEncode(p.name) +"')"::
  71. <table class="product">
  72. <tr>
  73. <td>
  74. <a onclick="::popup::" data-toggle="tooltip" data-placement="top" title="::_('Read more')::">
  75. <div style="background-image:url('::p.image::')" class="productImg" style="width:64px;height:64px;"/>
  76. </a>
  77. <div>
  78. ::if p.organic:: <img src="/img/AB.png"/> ::end::
  79. ::if p.variablePrice:: <img src="/img/weight.png"/> ::end::
  80. </div>
  81. </td>
  82. <td>
  83. <a onclick="::popup::" class="productName">
  84. ::p.name::
  85. ::if p.qt!=null && p.unitType!=null && p.qt>0::
  86. ::p.qt:: ::unit(p.unitType,p.qt>1)::
  87. ::end::
  88. </a>
  89. <div class="price">::formatNum(p.price):: ::currency()::</div>
  90. ::if p.variablePrice::
  91. <div style="font-size:0.8em;font-weight:bold;">
  92. <div class="vat">::raw pricePerUnit(p.price,p.qt,p.unitType)::</div>
  93. </div>
  94. ::end::
  95. <div>
  96. <form class="form-inline">
  97. ::if p.stock!=null && p.stock==0::
  98. <span style="color:#AAA;">::_("Out of stock")::</span>
  99. ::elseif !p.orderable::
  100. <span style="color:#AAA;">::_("Order closed")::</span>
  101. ::else::
  102. ::if p.stock!=null && p.stock>0 && p.stock<=10::
  103. <div class="warning" >::__("Only ::pstock:: items in stock",{pstock:p.stock})::</div>
  104. ::end::
  105. <div class="input-group">
  106. <input id="productQt::p.id::" type="text" value="1" style="height: 25px;width:35px;" class="form-control input-sm" maxlength="4" data-toggle="tooltip" data-placement="top" title="::_('Quantity')::"/>
  107. <span class="input-group-btn">
  108. <a class="btn btn-default btn-xs" onclick="cart.add(::p.id::)">::_("Order||Order button")::</a>
  109. </span>
  110. </div>
  111. ::end::
  112. </form>
  113. </div>
  114. </td>
  115. </tr>
  116. </table>
  117. </div>
  118. ::end::
  119. </div>
  120. </div>
  121. </div>
  122. </div>
  123. <div class="col-md-3" id="cartContainer">
  124. <div class="cartDiv">
  125. <h3>
  126. <span class="glyphicon glyphicon-shopping-cart"></span>
  127. ::_("My order")::
  128. <img id="loader" src="/img/loader.gif"/>
  129. </h3>
  130. <div id="cart"></div>
  131. <a onClick="cart.submit();" class="btn btn-default">
  132. ::if(user==null)::
  133. ::_("Sign up and validate the order")::
  134. ::else::
  135. ::_("Validate")::
  136. ::end::
  137. </a>
  138. <a class="infos" href='/contract'>::_("You can check your previous orders in 'my account' section")::</a>
  139. </div>
  140. <div class="article">
  141. <span class="tag active" id="tag0" onclick="cart.filter(0);" style="cursor:pointer;"><span class="glyphicon glyphicon-ok"></span> ::_("All products")::</span><br/>
  142. ::foreach g group.getCategoryGroups()::
  143. <div>
  144. <h4>::g.name::</h4>
  145. ::foreach c g.categs::
  146. <span class="tag" id="tag::c.id::" onclick="cart.filter(::c.id::);" style="background-color: ::g.color::;cursor:pointer;">::c.name::</span><br/>
  147. ::end::
  148. </div>
  149. ::end::
  150. </div>
  151. <!-- additionnal blocks from plugins -->
  152. ::if blocks!=null::
  153. ::foreach b blocks::
  154. <div class="block">
  155. <h3>::b.title::</h3>
  156. <p>::raw b.html::</p>
  157. </div>
  158. ::end::
  159. ::end::
  160. </div>
  161. ::end::