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.

macros.html.twig 8.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  1. {% trans_default_domain 'lcshop' %}
  2. {% macro box_info(user) %}
  3. <div class="card card-primary card-outline">
  4. <div class="card-body box-profile">
  5. <h3 class="profile-username">
  6. <i class="fa fa-user"></i> &nbsp; {{ user.gender == 1 ? 'Mme.' : 'M.' }} {{ user.name }} {{ user.age < 200 ? '('~user.age~' ans)' : ''}}
  7. </h3>
  8. <ul class="list-group list-group-unbordered">
  9. {% if user.age < 200 %}
  10. <li class="list-group-item">
  11. <b> <i class="fa fa-birthday-cake"></i> Age </b>
  12. <span class="float-right"> &nbsp; ans ({{ user.birthdate|date('d/m/Y') }})</span>
  13. </li>
  14. {% endif %}
  15. <li class="list-group-item">
  16. <b> <i class="fa fa-envelope"></i> Email</b>
  17. <span class="float-right"> {{ user.email }}</span>
  18. </li>
  19. <li class="list-group-item">
  20. <b> <i class="fa fa-phone"></i> Téléphone</b>
  21. <span class="float-right"> {{ user.phone }}</span>
  22. </li>
  23. <li class="list-group-item">
  24. <b><i class="fa fa-fw fa-bullhorn"></i> Newsletters</b>
  25. {% for newsletter in user.newsletters %}
  26. <span class="badge badge-success float-right">{{ newsletter }}</span>
  27. {% else %}
  28. <span class="badge badge-dark float-right">Aucune</span>
  29. {% endfor %}
  30. </li>
  31. <li class="list-group-item">
  32. <b> <i class="fa fa-users"></i> Groupes</b>
  33. {% for group in user.groups %}
  34. <span class="badge badge-info float-right">{{ group }}</span>&nbsp;
  35. {% else %}
  36. <span class="badge badge-dark float-right">Aucun</span>
  37. {% endfor %}
  38. </li>
  39. {% if is_granted('ROLE_SUPER_ADMIN') == false %}
  40. <li class="list-group-item">
  41. <b> <i class="fa fa-user-shield"></i> Roles</b>
  42. {% for role in user.roles %}
  43. <span class="badge badge-danger float-right">{{ role }}</span>&nbsp;
  44. {% endfor %}
  45. </li>
  46. {% endif %}
  47. </ul>
  48. </div>
  49. </div>
  50. {% endmacro box_info %}
  51. {% macro box_rank_sum_order(user) %}
  52. {% embed '@LcShop/backend/default/block/embed_figure_box.twig' %}
  53. {% block class %}bg-maroon{% endblock %}
  54. {% block icon %}cubes{% endblock %}
  55. {% block label %} Classement par total dépensés{% endblock %}
  56. {% block value %}
  57. {% set rankSumOrder = orderUtils.rankSumOrderByUser(user) %}
  58. {% if rankSumOrder %}
  59. {{ rankSumOrder }} <small style="opacity: 0.7"> / {{ orderUtils.countUsersWithValidOrderShop() }}</small>
  60. {% else %}
  61. Non classé
  62. {% endif %}
  63. {% endblock %}
  64. {% endembed %}
  65. {% endmacro box_rank_sum_order %}
  66. {% macro box_total_spent(user) %}
  67. {% embed '@LcShop/backend/default/block/embed_figure_box.twig' %}
  68. {% trans_default_domain 'lcshop' %}
  69. {% block class %}bg-pink{% endblock %}
  70. {% block icon %}euro-sign{% endblock %}
  71. {% block label %} Total dépensés{% endblock %}
  72. {% block value %}
  73. {{ orderUtils.totalSpentByUser(user)|format_price(false) }}
  74. {% endblock %}
  75. {% endembed %}
  76. {% endmacro box_total_spent %}
  77. {% macro box_rank_total_order(user) %}
  78. {% embed '@LcShop/backend/default/block/embed_figure_box.twig' %}
  79. {% block class %}bg-info{% endblock %}
  80. {% block icon %}cubes{% endblock %}
  81. {% block label %}Classement par nombre de commande {% endblock %}
  82. {% block value %}
  83. {% set rankTotalOrder = orderUtils.rankTotalOrderByUser(user) %}
  84. {% if rankTotalOrder %}
  85. {{ rankTotalOrder }} <small style="opacity: 0.7"> / {{ orderUtils.countUsersWithValidOrderShop() }}</small>
  86. {% else %}
  87. Non classé
  88. {% endif %}
  89. {% endblock %}
  90. {% endembed %}
  91. {% endmacro box_rank_total_order %}
  92. {% macro box_total_order(user) %}
  93. {% embed '@LcShop/backend/default/block/embed_figure_box.twig' %}
  94. {% trans_default_domain 'lcshop' %}
  95. {% block class %}bg-lightblue{% endblock %}
  96. {% block icon %}shopping-cart{% endblock %}
  97. {% block label %} Nombre de commandes{% endblock %}
  98. {% block value %}
  99. {{ orderUtils.countValidOrderShopByUser(user) }}
  100. {% endblock %}
  101. {% endembed %}
  102. {% endmacro box_total_order %}
  103. {% macro box_register_since(user) %}
  104. {% embed '@LcShop/backend/default/block/embed_figure_box.twig' %}
  105. {% trans_default_domain 'lcshop' %}
  106. {% block class %}bg-success{% endblock %}
  107. {% block icon %}calendar-plus{% endblock %}
  108. {% block label %}Date de l'inscription{% endblock %}
  109. {% block value %}
  110. {{ user.createdAt|date('d/m/Y H:i') }}
  111. {% endblock %}
  112. {% endembed %}
  113. {% endmacro box_register_since %}
  114. {% macro box_login_since(user) %}
  115. {% embed '@LcShop/backend/default/block/embed_figure_box.twig' %}
  116. {% trans_default_domain 'lcshop' %}
  117. {% block class %}bg-olive{% endblock %}
  118. {% block icon %}calendar-check{% endblock %}
  119. {% block label %}Date de dernière visite{% endblock %}
  120. {% block value %}
  121. {{ user.lastLogin|date('d/m/Y H:i') }}
  122. {% endblock %}
  123. {% endembed %}
  124. {% endmacro box_login_since %}
  125. {% macro list_order_product_redelivery(orderProductsRedelivery) %}
  126. <table class="table lc-table-list table-striped">
  127. <thead>
  128. <tr>
  129. <th>Id</th>
  130. <th>Produit</th>
  131. <th>Quantité</th>
  132. <th>Date de livraison</th>
  133. <th>Statut</th>
  134. <th></th>
  135. </tr>
  136. </thead>
  137. <tbody>
  138. {% for orderProduct in orderProductsRedelivery %}
  139. <tr>
  140. <td>{{ orderProduct.id }}</td>
  141. <td>{{ orderProduct.title }}</td>
  142. <td>{{ orderProduct.quantityOrder }}</td>
  143. <td>
  144. {% include '@LcShop/backend/default/field/datetime.html.twig' with {value : orderProduct.orderShop.deliveryDate} %}</td>
  145. <td>{% include '@LcShop/backend/order/field/order_status.html.twig' with {value : orderProduct.orderShop.orderStatus} %}</td>
  146. <td>
  147. {% import '@LcShop/backend/default/block/macros.html.twig' as macros %}
  148. {% if orderProduct.orderShop.isCart() %}
  149. {{ macros.button('OrderProductRedelivery', 'edit', orderProduct.id, 'primary') }} &nbsp;
  150. {% endif %}
  151. {{ macros.button('OrderShop', 'show', orderProduct.orderShop.id) }}
  152. </td>
  153. </tr>
  154. {% endfor %}
  155. </tbody>
  156. </table>
  157. {% endmacro list_order_product_redelivery %}
  158. {% macro list_order_shops(orderShops) %}
  159. <table class="table table-striped">
  160. <tbody>
  161. <thead>
  162. <tr>
  163. <th>Id</th>
  164. <th>WeekId</th>
  165. <th>Numéro de semaine</th>
  166. <th>Référence</th>
  167. <th>Montant TTC</th>
  168. <th>Statut</th>
  169. <th></th>
  170. </tr>
  171. </thead>
  172. <tbody>
  173. {% for orderShop in orderShops %}
  174. <tr>
  175. <td>{{ orderShop.id }}</td>
  176. <td>{{ orderShop.weekId }}</td>
  177. <td>{{ orderShop.weekNumber }}</td>
  178. <td>{{ orderShop.reference }}</td>
  179. <td>{{ priceUtils.getTotalWithTax(orderShop, true)|format_price(false) }}</td>
  180. <td>{% include '@LcShop/backend/order/field/order_status.html.twig' with {value : orderShop.orderStatus} %}</td>
  181. <td>
  182. {% import '@LcShop/backend/default/block/macros.html.twig' as macros %}
  183. {{ macros.button('OrderShop', 'show', orderShop.id) }}
  184. </td>
  185. </tr>
  186. {% endfor %}
  187. </tbody>
  188. </table>
  189. {% endmacro list_order_shops %}