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.

311 lines
10 KiB

  1. <macros>
  2. <macro name="jsConfirm(?text)">confirm(::if text==null::'Confirmer cette action ?'::else::'::escapeJS(text)::'::end::)</macro>
  3. <macro name="confirm(?text)" onclick="return $$jsConfirm(::text::)"/>
  4. <macro name="file(id,?def)">
  5. ::if id == null && def != null::
  6. ::def::
  7. ::else::
  8. /file/::makeFileSign(id)::.jpg
  9. ::end::
  10. </macro>
  11. <macro name="img(id,?def)"><img src="$$file(::id::,::def::)"/></macro>
  12. <macro name="browse(b,url)">$$browseCustom(::b::,::url::,Page ::b.page:: ::if b.pages::/::b.pages:: ::end::)</macro>
  13. <macro name="browseCustom(b,url,custom)">
  14. &lt;
  15. ::if b.prev::<a href="::url::/?page=::b.prev::">::_("Previous")::</a>::else:: ::_("Previous"):: ::end::
  16. | ::custom:: |
  17. ::if b.next::<a href="::url::/?page=::b.next::">::_("Next")::</a>::else:: ::_("Next"):: ::end:: &gt;
  18. </macro>
  19. <macro name="nullSafe(text)">::if text==null::::else::::text::::end::</macro>
  20. <macro name="edit(text,url)">
  21. <a href="::url::" class="btn btn-default btn-sm">
  22. <span class="glyphicon glyphicon-edit" aria-hidden="true"></span>
  23. &nbsp;::text::
  24. </a>
  25. </macro>
  26. <macro name="insert(text,url)">
  27. <!--<img src="/img/icons/add.png" style="vertical-align:middle;" />&nbsp;<a href="::url::">::text::</a>-->
  28. <a href="::url::" class="btn btn-default btn-sm">
  29. <span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
  30. &nbsp;::text::
  31. </a>
  32. </macro>
  33. <macro name="delete(text,url)">
  34. <a href="::url::" $$confirm(::_("Delete ?")::) class="btn btn-default btn-sm" >
  35. <span class="glyphicon glyphicon-remove" aria-hidden="true"></span>
  36. ::if text!=null && text!=""::
  37. &nbsp;::text::
  38. ::end::
  39. </a>
  40. </macro>
  41. <macro name="export(url)">
  42. <a href="::url::" class="btn btn-default btn-sm"><span class="glyphicon glyphicon-list-alt"></span> ::_("Excel/CSV Export")::</a>
  43. </macro>
  44. <macro name="bool(v)">
  45. ::if v==true::
  46. <img src="/img/icons/accept.png" />
  47. ::else::
  48. <img src="/img/icons/stop.png" />
  49. ::end::
  50. </macro>
  51. <macro name="check(v)">
  52. ::if(v==true || v==1)::
  53. <span class="glyphicon glyphicon-ok" style="color:#060"></span>
  54. ::else::
  55. <span class="glyphicon glyphicon-exclamation-sign" style="color:#a94442"></span>
  56. ::end::
  57. </macro>
  58. <macro name="date(dow,d,m,y,place)">
  59. <div class="dateBox" >
  60. <div class="box">
  61. <div>::dow::</div>
  62. <div style="font-size:28px;color:#990000;">::d::</div>
  63. <div>::m::</div>
  64. </div>
  65. ::if place!=null::
  66. <div style="margin-top:6px;">
  67. <span class="glyphicon glyphicon-map-marker"></span>
  68. <a href="#" onclick="_.overlay('/group/place/::place.id::','::urlEncode(place.name)::')">::place::</a>
  69. </div>
  70. ::end::
  71. </div>
  72. </macro>
  73. <macro name="place(place)">
  74. <span class="glyphicon glyphicon-map-marker"></span>
  75. <a onclick="_.overlay('/group/place/::place.id::','::urlEncode(place.name)::')">::place::</a>
  76. <div class="address">
  77. $$nullSafe(::place.address1::)
  78. $$nullSafe(::place.address2::)
  79. $$nullSafe(::place.zipCode::)
  80. $$nullSafe(::place.city::)
  81. </div>
  82. </macro>
  83. <macro name="today(dow,d,m,y,h,place)">
  84. <div class="dateBox" style="background-color:#080;" >
  85. <img src="/img/go.png"/>
  86. <div style="font-size:16px;margin-bottom:8px;">
  87. ::if Std.parseInt(h)<=12::
  88. ::_("THIS MORNING")::
  89. ::elseif Std.parseInt(h)<18::
  90. <span style="font-size:14px;">CET<br/>::_("AFTERNOON")::</span>
  91. ::else::
  92. ::_("THIS EVENING")::
  93. ::end::
  94. </div>
  95. ::if place!=null::
  96. <div style="margin-top:6px;">
  97. <span class="glyphicon glyphicon-map-marker"></span>
  98. <a href="#" onclick="_.overlay('/group/place/::place.id::','::urlEncode(place.name)::')">::place::</a>
  99. </div>
  100. ::end::
  101. </div>
  102. </macro>
  103. <macro name="contact(u)">
  104. <i class="icon-user"></i>
  105. ::if u!=null::
  106. <b>::u.firstName:: ::u.lastName::</b><br/>
  107. <span ::cond u.email!=null::>
  108. <span class="glyphicon glyphicon-envelope"></span> <a href="mailto: ::u.email::">::u.email::</a><br/>
  109. </span>
  110. <span ::cond u.phone!=null::>
  111. <span class="glyphicon glyphicon-phone-alt"></span> ::u.phone::<br/>
  112. </span>
  113. ::else::
  114. ::_("No contact")::
  115. ::end::
  116. </macro>
  117. <macro name="alert(msg)">
  118. <div class="alert alert-danger">
  119. <span class="glyphicon glyphicon-exclamation-sign"></span>
  120. ::raw msg::
  121. </div>
  122. </macro>
  123. <macro name="operation(t)">
  124. ::set x = t.getTypeIndex()::
  125. <!--::if x==2:: ::set class="text-right":: ::end:: -->
  126. <td class="::class::">
  127. ::if x==0::
  128. <i class="fa fa-shopping-cart" aria-hidden="true"></i>&nbsp;::_("Order")::
  129. ::elseif x==1::
  130. <i class="fa fa-shopping-basket" aria-hidden="true"></i>&nbsp;::raw _("CSA&nbsp;contract")::
  131. ::elseif x==2::
  132. <!--<span style="margin-left:48px;">::_("Payment"):: ::_(t.getPaymentType())::</span>-->
  133. <i class="fa fa-credit-card" aria-hidden="true"></i> ::_("Payment"):: ::t.getPaymentTypeName()::
  134. ::else::
  135. <i class="fa fa-user" aria-hidden="true"></i> ::_("Subscription")::
  136. ::end::
  137. </td>
  138. <td>
  139. ::if t.pending==true::
  140. <i class="fa fa-circle-thin" style="color:#CCC;" aria-hidden="true"></i>
  141. ::else::
  142. <i class="fa fa-check" aria-hidden="true"></i>
  143. ::end::
  144. </td>
  145. <td style="font-size:1em;">
  146. ::t.name::<br/>
  147. ::if x==2 && t.pending==true::
  148. ::if(t.getPaymentType()=="check")::
  149. <span style="color:red;">::_("Check to be given at the collection of products")::</span>
  150. ::elseif(t.getPaymentType()=="cash")::
  151. <span style="color:red;">::_("Cash to be given at the collection of products")::</span>
  152. ::elseif(t.getPaymentType()=="transfer")::
  153. <span style="color:red;">::_("This transfer must be validated by a coordinator")::</span>
  154. ::else::
  155. ::t.name::<br/>
  156. <span style="font-size:0.90em;color:#AAA;">::hDate(t.date)::</span>
  157. ::end::
  158. ::else::
  159. <span style="font-size:0.90em;color:#AAA;">::hDate(t.date)::</span>
  160. ::end::
  161. </td>
  162. <td class="text-right">
  163. ::if(t.amount<0)::
  164. -
  165. ::end::
  166. </td>
  167. <td>::formatNum(Math.abs(t.amount))::&nbsp;::currency()::</td>
  168. ::set class=""::
  169. </macro>
  170. <macro name="back()">
  171. <a href="#" onclick="window.history.back();" class="btn btn-default btn-sm pull-right"><span class="glyphicon glyphicon-chevron-left"></span> ::_("Back")::</a>
  172. </macro>
  173. <macro name="deliveryPro(k,showBtns)">
  174. ::set now = Date.now()::
  175. <div class="row">
  176. <div class="col-md-4 text-center">
  177. <!-- find color/icon to display -->
  178. ::set open = 0::
  179. ::set notyetopened = 0::
  180. ::set closed = 0::
  181. ::foreach d k::
  182. ::if d.orderStartDate!=null::
  183. ::if now.getTime() > d.orderStartDate.getTime() && now.getTime() < d.orderEndDate.getTime()::
  184. <!-- commande en cours -->
  185. ::set open = open+1::
  186. ::elseif now.getTime() > d.orderEndDate.getTime()::
  187. <!-- commande terminée -->
  188. ::set closed = closed+1::
  189. ::else::
  190. <!-- commande pas ouverte -->
  191. ::set notyetopened = notyetopened+1::
  192. ::end::
  193. ::else::
  194. <!-- AMAP : commande terminée -->
  195. ::set closed = closed+1::
  196. ::end::
  197. ::end::
  198. <div style="display:inline-block;">
  199. ::set x = getDate(k[0].date)::
  200. $$date(::x.dow::,::x.d::,::x.m::,::x.y::,::k[0]._place::)
  201. </div>
  202. <div style="text-align: center;font-weight: bold;margin-top: 12px;font-size: 1.2em;color:#666;">::x.h+":"+x.i::</div>
  203. </div>
  204. <div class="col-md-8">
  205. ::if (open==k.length)::
  206. <span class="fa-stack fa-lg" data-toggle="tooltip" title="Commande en cours.">
  207. <i class="fa fa-circle fa-stack-2x" style="color:#F80;"></i>
  208. <i class="fa fa-shopping-basket fa-stack-1x fa-inverse"></i>
  209. </span>
  210. ::elseif(closed==k.length)::
  211. <span class="fa-stack fa-lg" data-toggle="tooltip" title="Commande close. Préparez votre livraison">
  212. <i class="fa fa-circle fa-stack-2x" style="color:#0A0;"></i>
  213. <i class="fa fa-truck fa-stack-1x fa-inverse"></i>
  214. </span>
  215. ::elseif(notyetopened==k.length)::
  216. <span class="fa-stack fa-lg" data-toggle="tooltip" title="Commande pas encore ouverte">
  217. <i class="fa fa-circle fa-stack-2x" style="color:#999;" ></i>
  218. <i class="fa fa-clock-o fa-stack-1x fa-inverse"></i>
  219. </span>
  220. ::else::
  221. <span class="fa-stack fa-lg" data-toggle="tooltip" title="Statut mixte">
  222. <i class="fa fa-circle fa-stack-2x" style="color:#999;" ></i>
  223. <i class="fa fa-truck fa-stack-1x fa-inverse"></i>
  224. </span>
  225. ::end::
  226. <b>::k[0]._contract._amap.name::</b><br/>
  227. <table>
  228. ::foreach d k::
  229. <tr>
  230. <td>
  231. ::if d.orderStartDate!=null::
  232. ::if now.getTime() > d.orderStartDate.getTime() && now.getTime() < d.orderEndDate.getTime()::
  233. <!-- commande en cours -->
  234. <i class="fa fa-circle" style="color:#F80;" data-toggle="tooltip" title="Commande en cours."></i>
  235. ::elseif now.getTime() > d.orderEndDate.getTime()::
  236. <!-- commande terminée -->
  237. <i class="fa fa-circle" style="color:#0A0;" data-toggle="tooltip" title="Commande close. Préparez votre livraison"></i>
  238. ::else::
  239. <!-- commande pas ouverte -->
  240. <i class="fa fa-circle-thin" style="color:#666;" data-toggle="tooltip" title="Commande pas encore ouverte"></i>
  241. ::end::
  242. ::else::
  243. <!-- AMAP -->
  244. <i class="fa fa-circle" style="color:#0A0;" data-toggle="tooltip" title="Commande close. Préparez votre livraison"></i>
  245. ::end::
  246. ::set c = getCatalog(d)::
  247. <a href="/p/pro/delivery/view/::d.id::">::c.name::</a>&nbsp;&nbsp;
  248. </td>
  249. <td>
  250. ::if showBtns::
  251. <div class="btn-group">
  252. <a href="/p/pro/delivery/edit/::d.id::" title="::_("Edit")::" data-toggle="tooltip" class="btn btn-default btn-sm">
  253. <span class="glyphicon glyphicon-edit" aria-hidden="true"></span>
  254. </a>
  255. <a href="/p/pro/delivery/delete/::d.id::?token=::token::" title="::_("Delete")::" data-toggle="tooltip" $$confirm(::_("Delete ?")::) class="btn btn-default btn-sm" >
  256. <span class="glyphicon glyphicon-remove" aria-hidden="true"></span>
  257. </a>
  258. </div>
  259. ::end::
  260. </td>
  261. </tr>
  262. ::end::
  263. </table>
  264. </div>
  265. </div>
  266. </macro>
  267. </macros>