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.

135 lines
8.2 KiB

5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <odoo>
  3. <template id="point_retrait_choose">
  4. <a class="card-link " data-toggle="collapse" t-att-href="'#slots_point_retrait_%i' % point_retrait.id" t-att-id="'point_retrait_%i' % point_retrait.id">
  5. <input t-att-value="point_retrait.id" t-att-id="'point_retrait2_%i' % point_retrait.id" type="radio" name="point_retrait_type" t-att-checked="order.vracoop_point_retrait_id and order.vracoop_point_retrait_id.id == point_retrait.id and 'checked' or False" t-att-class="'d-none' if point_retrait_nb == 1 else 'radio_hide'"/>
  6. </a>
  7. <strong><label class="label-optional" t-field="point_retrait.name" t-att-for="'point_retrait2_%i' % point_retrait.id"/></strong>
  8. <t t-if="point_retrait.street">
  9. <br/><span><t t-esc="point_retrait.street"/></span><br/>
  10. </t>
  11. <t t-if="point_retrait.street2">
  12. <span><t t-esc="point_retrait.street2"/></span><br/>
  13. </t>
  14. <span><t t-esc="point_retrait.city"/>
  15. <t t-esc="point_retrait.zip"/></span><br/><br/>
  16. <div t-att-class="'collapse show' if point_retrait_nb == 1 else 'collapse'" data-parent="#retrait_method" t-att-id="'slots_point_retrait_%i' % point_retrait.id">
  17. <h5>Sélectionner le jour et le créneau pour votre retrait</h5>
  18. <t t-set="list_slots" t-value="point_retrait.slot_calculate()"/>
  19. <div class="top-content mt-4 mb-4">
  20. <div class="container-fluid">
  21. <div t-att-id="'carousel_%i' % point_retrait.id" class="carousel slide" data-ride="carousel" data-interval="false">
  22. <ul class="nav nav-tabs carousel-inner row w-100 mx-auto" role="tablist">
  23. <t t-foreach="list_slots" t-as="slot">
  24. <t t-if="slot_first">
  25. <li class="nav-item carousel-item col-12 col-sm-6 col-md-4 col-lg-3 active">
  26. <a data-toggle="tab" class="nav-link active btn btn-primary" t-attf-href='##{slot[1].strftime("%A")}#{point_retrait.id}'>
  27. <label class=" label_radio_button" role="radio">
  28. <input t-attf-id='#{slot[1].day}-#{slot[1].month}-#{point_retrait.id}' name="day_select d-none" type="radio" class="radio_hide" t-attf-value='#{slot[1].day}-#{slot[1].month}-#{point_retrait.id}'/>
  29. <span class="span_radio_button">
  30. <t class="week_day" t-esc="slot[0]"/><br/>
  31. <t t-esc="slot[1].day"/><br/>
  32. <t t-esc="slot[2]"/>
  33. </span>
  34. </label>
  35. </a>
  36. </li>
  37. </t>
  38. <t t-else="">
  39. <li class="nav-item carousel-item col-12 col-sm-6 col-md-4 col-lg-3">
  40. <a data-toggle="tab" class="nav-link btn btn-primary" t-attf-href='##{slot[1].strftime("%A")}#{point_retrait.id}'>
  41. <label class=" label_radio_button" role="radio">
  42. <input t-attf-id='#{slot[1].day}-#{slot[1].month}-#{point_retrait.id}' name="day_select" type="radio" class="radio_hide d-none" t-attf-value='#{slot[1].day}-#{slot[1].month}-#{point_retrait.id}' />
  43. <span class="span_radio_button">
  44. <t class="week_day" t-esc="slot[0]"/><br/>
  45. <t t-esc="slot[1].day"/><br/>
  46. <t t-esc="slot[2]"/>
  47. </span>
  48. </label>
  49. </a>
  50. </li>
  51. </t>
  52. </t>
  53. </ul>
  54. <a class="carousel-control-prev" t-att-href="'#carousel_%i' % point_retrait.id" role="button" data-slide="prev">
  55. <span class="carousel-control-prev-icon"></span>
  56. <span class="sr-only">Previous</span>
  57. </a>
  58. <a class="carousel-control-next" t-att-href="'#carousel_%i' % point_retrait.id" role="button" data-slide="next">
  59. <span class="carousel-control-next-icon" ></span>
  60. <span class="sr-only">Next</span>
  61. </a>
  62. </div>
  63. </div>
  64. </div>
  65. <div class="tab-content">
  66. <t t-foreach="list_slots" t-as="slot">
  67. <t t-if="slot_first">
  68. <div class="container tab-pane active" t-attf-id='#{slot[1].strftime("%A")}#{point_retrait.id}'>
  69. <t t-foreach="slot[3]" t-as="slot_by_day">
  70. <label class="label_radio_button" role="radio">
  71. <input name="hour_select" type="radio" class="radio_hide" t-attf-value="#{slot[1].day}-#{slot[1].month}-#{slot_by_day[0]}-#{point_retrait.id}" t-attf-id="#{slot_by_day_index}"/>
  72. <span class="btn btn-outline-primary span_radio_button">
  73. <t t-esc="slot_by_day[0]"/> :
  74. <t t-esc="slot_by_day[1]"/>
  75. </span>
  76. </label>
  77. </t>
  78. </div>
  79. </t>
  80. <t t-else="">
  81. <div class="container tab-pane fade" t-attf-id='#{slot[1].strftime("%A")}#{point_retrait.id}'>
  82. <t t-foreach="slot[3]" t-as="slot_by_day">
  83. <label class=" label_radio_button" role="radio">
  84. <input t-attf-id="#{slot_by_day_index}" name="hour_select" type="radio" class="radio_hide" t-attf-value="#{slot[1].day}-#{slot[1].month}-#{slot_by_day[0]}-#{point_retrait.id}"/>
  85. <span class="btn btn-outline-primary span_radio_button">
  86. <t t-esc="slot_by_day[0]"/> :
  87. <t t-esc="slot_by_day[1]"/>
  88. </span>
  89. </label>
  90. </t>
  91. </div>
  92. </t>
  93. </t>
  94. </div>
  95. </div>
  96. </template>
  97. <template id="vracoop_payment_delivery" inherit_id="website_sale_delivery.payment_delivery">
  98. <xpath expr="//div[@id='payment_method']" position="before">
  99. <div t-if="points_retrait" id="point_retrait" class="d-none mt-3">
  100. <t t-set="point_retrait_nb" t-value="len(points_retrait)"/>
  101. <h3 t-if="point_retrait_nb" class="mb24">Choisir un point de retrait</h3>
  102. <div t-if="point_retrait_nb &gt; 1" class="card border-0" id="retrait_method">
  103. <ul class="list-group">
  104. <t t-foreach="points_retrait" t-as="point_retrait">
  105. <li class="list-group-item">
  106. <t t-call="vracoop_click_and_collect.point_retrait_choose"/>
  107. </li>
  108. </t>
  109. </ul>
  110. </div>
  111. <div t-if="point_retrait_nb == 1" class="card border-0" id="retrait_method">
  112. <ul class="list-group">
  113. <t t-foreach="points_retrait" t-as="point_retrait">
  114. <li class="list-group-item">
  115. <t t-call="vracoop_click_and_collect.point_retrait_choose"/>
  116. </li>
  117. </t>
  118. </ul>
  119. </div>
  120. </div>
  121. </xpath>
  122. </template>
  123. </odoo>