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.5KB

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