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.

257 lines
9.9KB

  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_prepaid_account(user) %}
  85. {% embed '@LcShop/backend/default/block/embed_figure_box.twig' %}
  86. {% set userMerchant = creditUtils.getUserMerchant() %}
  87. {% trans_default_domain 'lcshop' %}
  88. {% block class %}bg-blue{% endblock %}
  89. {% block icon %}cash-register{% endblock %}
  90. {% block label %}
  91. <a class="text-white" href="{{ path('easyadmin', {"action" : 'show', 'entity': 'UserMerchant', 'id': userMerchant.id}) }}">
  92. <i class="fa fa-pen"></i> Éditer
  93. </a> - Solde compte prépayé
  94. {% endblock %}
  95. {% block value %}
  96. {{ userMerchant.getCredit()|format_price(false) }}
  97. {% if userMerchant.getCreditActive() ==false %}
  98. <small>(inactif)</small>
  99. {% endif %}
  100. {% endblock %}
  101. {% endembed %}
  102. {% endmacro box_prepaid_account %}
  103. {% macro box_average_products(user) %}
  104. {% embed '@LcShop/backend/default/block/embed_figure_box.twig' %}
  105. {% trans_default_domain 'lcshop' %}
  106. {% block class %}bg-navy{% endblock %}
  107. {% block icon %}shopping-basket{% endblock %}
  108. {% block label %} Panier moyen{% endblock %}
  109. {% block value %}
  110. {{ orderUtils.getAverageProductsByUser(user)|format_price|raw }}
  111. {% endblock %}
  112. {% endembed %}
  113. {% endmacro box_average_products %}
  114. {% macro box_rank_total_order(user) %}
  115. {% embed '@LcShop/backend/default/block/embed_figure_box.twig' %}
  116. {% block class %}bg-info{% endblock %}
  117. {% block icon %}cubes{% endblock %}
  118. {% block label %}Classement par nombre de commande {% endblock %}
  119. {% block value %}
  120. {% set rankTotalOrder = orderUtils.rankTotalOrderByUser(user) %}
  121. {% if rankTotalOrder %}
  122. {{ rankTotalOrder }} <small style="opacity: 0.7"> / {{ orderUtils.countUsersWithValidOrderShop() }}</small>
  123. {% else %}
  124. Non classé
  125. {% endif %}
  126. {% endblock %}
  127. {% endembed %}
  128. {% endmacro box_rank_total_order %}
  129. {% macro box_total_order(user) %}
  130. {% embed '@LcShop/backend/default/block/embed_figure_box.twig' %}
  131. {% trans_default_domain 'lcshop' %}
  132. {% block class %}bg-lightblue{% endblock %}
  133. {% block icon %}shopping-cart{% endblock %}
  134. {% block label %} Nombre de commandes{% endblock %}
  135. {% block value %}
  136. {{ orderUtils.countValidOrderShopByUser(user) }}
  137. {% endblock %}
  138. {% endembed %}
  139. {% endmacro box_total_order %}
  140. {% macro box_register_since(user) %}
  141. {% embed '@LcShop/backend/default/block/embed_figure_box.twig' %}
  142. {% trans_default_domain 'lcshop' %}
  143. {% block class %}bg-success{% endblock %}
  144. {% block icon %}calendar-plus{% endblock %}
  145. {% block label %}Date de l'inscription{% endblock %}
  146. {% block value %}
  147. {{ user.createdAt|date('d/m/Y H:i') }}
  148. {% endblock %}
  149. {% endembed %}
  150. {% endmacro box_register_since %}
  151. {% macro box_login_since(user) %}
  152. {% embed '@LcShop/backend/default/block/embed_figure_box.twig' %}
  153. {% trans_default_domain 'lcshop' %}
  154. {% block class %}bg-olive{% endblock %}
  155. {% block icon %}calendar-check{% endblock %}
  156. {% block label %}Date de dernière visite{% endblock %}
  157. {% block value %}
  158. {{ user.lastLogin|date('d/m/Y H:i') }}
  159. {% endblock %}
  160. {% endembed %}
  161. {% endmacro box_login_since %}
  162. {% macro list_order_product_redelivery(orderProductsRedelivery) %}
  163. <table class="table lc-table-list table-striped">
  164. <thead>
  165. <tr>
  166. <th>Id</th>
  167. <th>Produit</th>
  168. <th>Quantité</th>
  169. <th>Date de livraison</th>
  170. <th>Statut</th>
  171. <th></th>
  172. </tr>
  173. </thead>
  174. <tbody>
  175. {% for orderProduct in orderProductsRedelivery %}
  176. <tr>
  177. <td>{{ orderProduct.id }}</td>
  178. <td>{{ orderProduct.title }}</td>
  179. <td>{{ orderProduct.quantityOrder }}</td>
  180. <td>
  181. {% include '@LcShop/backend/default/field/datetime.html.twig' with {value : orderProduct.orderShop.deliveryDate} %}</td>
  182. <td>{% include '@LcShop/backend/order/field/order_status.html.twig' with {value : orderProduct.orderShop.orderStatus} %}</td>
  183. <td>
  184. {% import '@LcShop/backend/default/block/macros.html.twig' as macros %}
  185. {% if orderProduct.orderShop.isCart() %}
  186. {{ macros.button('OrderProductRedelivery', 'edit', orderProduct.id, 'primary') }} &nbsp;
  187. {% endif %}
  188. {{ macros.button('OrderShop', 'show', orderProduct.orderShop.id) }}
  189. </td>
  190. </tr>
  191. {% endfor %}
  192. </tbody>
  193. </table>
  194. {% endmacro list_order_product_redelivery %}
  195. {% macro list_order_shops(orderShops) %}
  196. <table class="table table-striped">
  197. <tbody>
  198. <thead>
  199. <tr>
  200. <th>Id</th>
  201. <th>WeekId</th>
  202. <th>Numéro de semaine</th>
  203. <th>Référence</th>
  204. <th>Montant TTC</th>
  205. <th>Statut</th>
  206. <th></th>
  207. </tr>
  208. </thead>
  209. <tbody>
  210. {% for orderShop in orderShops %}
  211. <tr>
  212. <td>{{ orderShop.id }}</td>
  213. <td>{{ orderShop.weekId }}</td>
  214. <td>{{ orderShop.weekNumber }}</td>
  215. <td>{{ orderShop.reference }}</td>
  216. <td>{{ priceUtils.getTotalWithTax(orderShop, true)|format_price(false) }}</td>
  217. <td>{% include '@LcShop/backend/order/field/order_status.html.twig' with {value : orderShop.orderStatus} %}</td>
  218. <td>
  219. {% import '@LcShop/backend/default/block/macros.html.twig' as macros %}
  220. {{ macros.button('OrderShop', 'show', orderShop.id) }}
  221. </td>
  222. </tr>
  223. {% endfor %}
  224. </tbody>
  225. </table>
  226. {% endmacro list_order_shops %}