src/Flexy/FrontBundle/Themes/Lasalle/templates/admin/shopadmin/customer/detail.html.twig line 1

  1. {# @var ea \EasyCorp\Bundle\EasyAdminBundle\Context\AdminContext #}
  2. {# @var entity \EasyCorp\Bundle\EasyAdminBundle\Dto\EntityDto #}
  3. {% extends ea.templatePath('layout') %}
  4. {% block body_id 'ea-detail-' ~ entity.name ~ '-' ~ entity.primaryKeyValue %}
  5. {% block body_class 'ea-detail ea-detail-' ~ entity.name %}
  6. {% set ea_field_assets = ea.crud.fieldAssets(constant('EasyCorp\\Bundle\\EasyAdminBundle\\Config\\Crud::PAGE_DETAIL')) %}
  7. {% block configured_head_contents %}
  8.     {{ parent() }}
  9.  
  10.    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/print-js/1.6.0/print.css" integrity="sha512-tKGnmy6w6vpt8VyMNuWbQtk6D6vwU8VCxUi0kEMXmtgwW+6F70iONzukEUC3gvb+KTJTLzDKAGGWc1R7rmIgxQ==" crossorigin="anonymous" referrerpolicy="no-referrer" />
  11.    <style>
  12.  i.icon-2x {
  13.   font-size: 24px;
  14. }
  15. .color-light{
  16.     color:#FFFFFF;
  17. }
  18. /*Colored Content Boxes
  19. ------------------------------------*/
  20. .servive-block {
  21.   padding: 6px 30px;
  22.   text-align: center;
  23.   margin-bottom: 10px;
  24. }
  25. .servive-block p,
  26. .servive-block h2 {
  27.   color: #fff;
  28. }
  29. .servive-block h2 a:hover{
  30.   text-decoration: none;
  31. }
  32. .servive-block-light,
  33. .servive-block-default {
  34.   background: #fafafa;
  35.   border: solid 1px #eee; 
  36. }
  37. .servive-block-default:hover {
  38.   box-shadow: 0 0 8px #eee;
  39. }
  40. .servive-block-light p,
  41. .servive-block-light h2,
  42. .servive-block-default p,
  43. .servive-block-default h2 {
  44.   color: #555;
  45. }
  46. .servive-block-u {
  47.   background: #72c02c;
  48. }
  49. .servive-block-blue {
  50.   background: #3498db;
  51. }
  52. .servive-block-red {
  53.   background: #e74c3c;
  54. }
  55. .servive-block-sea {
  56.   background: #1abc9c;
  57. }
  58. .servive-block-grey {
  59.   background: #95a5a6;
  60. }
  61. .servive-block-yellow {
  62.   background: #f1c40f;
  63. }
  64. .servive-block-orange {
  65.   background: #e67e22;
  66. }
  67. .servive-block-green {
  68.   background: #2ecc71;
  69. }
  70. .servive-block-purple {
  71.   background: #9b6bcc;
  72. }
  73. .servive-block-aqua {
  74.   background: #27d7e7;
  75. }
  76. .servive-block-brown {
  77.   background: #9c8061;
  78. }
  79. .servive-block-dark-blue {
  80.   background: #4765a0;
  81. }
  82. .servive-block-light-green {
  83.   background: #79d5b3;
  84. }
  85. .servive-block-dark {
  86.   background: #555;
  87. }
  88. .servive-block-light {
  89.   background: #ecf0f1;
  90. }
  91.    </style>
  92.     {% for htmlContent in ea_field_assets.headContents %}
  93.         {{ htmlContent|raw }}
  94.     {% endfor %}
  95. {% endblock %}
  96. {% block configured_body_contents %}
  97.     {{ parent() }}
  98.     {% for htmlContent in ea_field_assets.bodyContents %}
  99.         {{ htmlContent|raw }}
  100.     {% endfor %}
  101. {% endblock %}
  102. {% block content_title %}
  103.     {%- apply spaceless -%}
  104.         {% set custom_page_title = ea.crud.customPageTitle(pageName, entity ? entity.instance : null, ea.i18n.translationParameters) %}
  105.         {{ custom_page_title is null
  106.             ? ea.crud.defaultPageTitle(null, null, ea.i18n.translationParameters)|trans|raw
  107.             : custom_page_title|trans|raw }}
  108.     {%- endapply -%}
  109. {% endblock %}
  110. {% block page_actions %}
  111.  
  112.  <button id="printInvoice" onclick="printJS('{{asset("uploads/lasalle/customers/"~entity.instance.firstName~"-"~entity.instance.lastName~"-"~entity.instance.id~"/profile-card.png")}}', 'image')" class="btn btn-info"  style="float:right; margin:0 20px;"><i class="fa fa-print"></i> Imprimer la carte</button> 
  113.     {% for action in entity.actions %}
  114.         {{ include(action.templatePath, { action: action }, with_context = false) }}
  115.     {% endfor %}
  116.    {% endblock %}
  117. {% block content_footer_wrapper '' %}
  118. {% block main %}
  119. {% set adherent = entity.instance %}
  120. {{front.createImage(adherent)}}
  121.  
  122. <div class="container bootstrap snippets bootdey">
  123.     <div class="row margin-bottom-10">
  124.        <div class="col-md-8 col-sm-8" >
  125.              <img  src="{{asset("uploads/lasalle/customers/"~entity.instance.firstName~"-"~entity.instance.lastName~"-"~entity.instance.id~"/profile-card.png")}}" style="box-shadow:0 0 10px #33333390 ;border-radius:5px;width:400px;" >
  126.         </div>
  127.        
  128.         <div class="col-md-4 col-sm-4" style=" width: 13% !important;">
  129.             <div class="servive-block servive-block-yellow">
  130.                 <i class="icon-2x color-light fa  fa-blind"></i>
  131.                 <h2 class="heading-md" style="font-size: 1rem !important;">Visites</h2>
  132.                 <h2 style="font-size: 1rem !important;"><b>{{ adherent.visits|length}}</b></h2>
  133.      </div>
  134.         </div>
  135.         <div class="col-md-4 col-sm-4" style=" width: 13% !important;">
  136.             <div class="servive-block servive-block-grey">
  137.                 <i class="icon-2x color-light fa  fa-file"></i>
  138.                 <h2 class="heading-md" style="font-size: 1rem !important;">Contrats</h2>
  139.                 <h2 style="font-size: 1rem !important;"><b>{{adherent.productSubscriptions|length}}</b></h2>
  140.      </div>
  141.         </div>
  142.         
  143.       </div>
  144.     {% set field_layout = ea_create_field_layout(entity.fields) %}
  145.     {% block detail_fields %}
  146.         {% if field_layout.hasTabs %}
  147.             {{ _self.render_detail_fields_with_tabs(entity, field_layout) }}
  148.         {% else %}
  149.             {{ _self.render_detail_fields(entity, field_layout.fields) }}
  150.         {% endif %}
  151.     {% endblock detail_fields %}
  152.     {% block delete_form %}
  153.         {{ include('@EasyAdmin/crud/includes/_delete_form.html.twig', { entity_id: entity.primaryKeyValue }, with_context = false) }}
  154.     {% endblock delete_form %}
  155. {% endblock %}
  156. {% macro render_detail_fields_with_tabs(entity, field_layout) %}
  157.     <div class="col-12">
  158.         <div class="nav-tabs-custom form-tabs">
  159.             <ul class="nav nav-tabs">
  160.                 {% for tab in field_layout.tabs %}
  161.                     <li class="nav-item">
  162.                         <a class="nav-link {% if loop.first %}active{% endif %}" href="#tab-pane-{{ tab.uniqueId }}" id="tab-{{ tab.uniqueId }}" data-bs-toggle="tab">
  163.                             {%- if tab.customOption('icon') -%}
  164.                                 <i class="fa-fw {{ tab.customOption('icon') }}"></i>
  165.                             {%- endif -%}
  166.                             {{ tab.label|trans(domain = ea.i18n.translationDomain)|trans(domain = 'EasyAdminBundle') }}
  167.                         </a>
  168.                     </li>
  169.                 {% endfor %}
  170.             </ul>
  171.             <div class="tab-content">
  172.                 {% for tab in field_layout.tabs %}
  173.                     <div id="tab-pane-{{ tab.uniqueId }}" class="tab-pane {% if loop.first %}active{% endif %} {{ tab.cssClass|default('') }}">
  174.                         {% if tab.help|default(false) %}
  175.                             <div class="content-header-help tab-help">
  176.                                 {{ tab.help|trans(domain = ea.i18n.translationDomain)|raw }}
  177.                             </div>
  178.                         {% endif %}
  179.                         <div class="row">
  180.                             {{ _self.render_detail_fields(entity, field_layout.fieldsInTab(tab.uniqueId)) }}
  181.                         </div>
  182.                     </div>
  183.                 {% endfor %}
  184.             </div>
  185.         </div>
  186.     </div>
  187. {% endmacro %}
  188. {% macro render_detail_fields(entity, fields) %}
  189.     {% set form_panel_is_already_open = false %}
  190.     {% for field in fields %}
  191.         {% set is_form_field_panel = 'field-form_panel' in field.cssClass %}
  192.         {% if is_form_field_panel or (loop.first and not is_form_field_panel) %}
  193.             {% if form_panel_is_already_open %}
  194.                 {{ _self.close_form_field_panel() }}
  195.                 {% set form_panel_is_already_open = false %}
  196.             {% endif %}
  197.             {{ _self.open_form_field_panel(is_form_field_panel ? field : null) }}
  198.             {% set form_panel_is_already_open = true %}
  199.         {% endif %}
  200.         {% block detail_field %}
  201.             {% if not is_form_field_panel %}
  202.                 {{ _self.render_field(entity, field) }}
  203.             {% endif %}
  204.             
  205.         {% endblock %}
  206.     {% endfor %}
  207.     {% if form_panel_is_already_open %}
  208.         {{ _self.close_form_field_panel() }}
  209.         {% set form_panel_is_already_open = false %}
  210.     {% endif %}
  211. {% endmacro %}
  212. {% macro open_form_field_panel(field = null) %}
  213.     {% set panel_name = field is null ? null : 'content-' ~ field.uniqueId %}
  214.     {% set collapsible = field is null ? false : field.customOption('collapsible') %}
  215.     {% set collapsed = field is null ? false : field.customOption('collapsed') %}
  216.     {% set panel_icon = field is null ? null : (field.customOptions.get('icon')|default(false)) %}
  217.     {% set panel_label = field is null ? null : field.label %}
  218.     {% set panel_help = field is null ? null : field.help|default(false)%}
  219.     {% set panel_has_header = collapsible or panel_icon or panel_label or panel_help %}
  220.     <div class="{{ field.cssClass ?? '' }}">
  221.         <div class="form-panel">
  222.             {% if panel_has_header %}
  223.                 <div class="form-panel-header {{ collapsible ? 'collapsible' }} {{ panel_help is not empty ? 'with-help' }}">
  224.                     <div class="form-panel-title">
  225.                         <a {% if not collapsible %}
  226.                             href="#" class="not-collapsible"
  227.                         {% else %}
  228.                             href="#{{ panel_name }}" data-bs-toggle="collapse"
  229.                             class="form-panel-collapse {{ collapsed ? 'collapsed' }}"
  230.                             aria-expanded="{{ collapsed ? 'false' : 'true' }}" aria-controls="{{ panel_name }}"
  231.                         {% endif %}
  232.                         >
  233.                             {% if collapsible %}
  234.                                 <i class="fas fw fa-chevron-right form-panel-collapse-marker"></i>
  235.                             {% endif %}
  236.                             {% if panel_icon %}
  237.                                 <i class="form-panel-icon {{ panel_icon }}"></i>
  238.                             {% endif %}
  239.                             {{ panel_label|trans|raw }}
  240.                         </a>
  241.                         {% if panel_help %}
  242.                             <div class="form-panel-help">{{ panel_help|trans|raw }}</div>
  243.                         {% endif %}
  244.                     </div>
  245.                 </div>
  246.             {% endif %}
  247.             <div {% if panel_name %}id="{{ panel_name }}"{% endif %} class="form-panel-body {{ collapsible ? 'collapse' }} {{ not collapsed ? 'show'}}">
  248.                 <dl class="datalist">
  249. {% endmacro %}
  250. {% macro close_form_field_panel() %}
  251.             </dl>
  252.         </div>
  253.     </div>
  254. </div>
  255. {% endmacro %}
  256. {% macro render_field(entity, field) %}
  257.     <div class="data-row {{ field.cssClass }}">
  258.         <dt>
  259.             {{ field.label|trans|raw }}
  260.             {% if field.help is not empty %}
  261.                 <a tabindex="0" class="data-help" data-bs-toggle="popover" data-bs-custom-class="ea-content-help-popover" data-bs-animation="true" data-bs-html="true" data-bs-placement="right" data-bs-trigger="focus" data-bs-content="{{ field.help|trans|e('html_attr') }}">
  262.                     <i class="far fa-question-circle"></i>
  263.                 </a>
  264.             {% endif %}
  265.         </dt>
  266.         <dd>
  267.             {{ include(field.templatePath, { field: field, entity: entity }, with_context = false) }}
  268.         </dd>
  269.     </div>
  270.     
  271. {% endmacro %}
  272. {% block body_javascript  %}
  273.     {{parent()}}
  274.     <script src="https://cdnjs.cloudflare.com/ajax/libs/print-js/1.6.0/print.js" integrity="sha512-/fgTphwXa3lqAhN+I8gG8AvuaTErm1YxpUjbdCvwfTMyv8UZnFyId7ft5736xQ6CyQN4Nzr21lBuWWA9RTCXCw==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
  275.     
  276. {% endblock  %}