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.   
  121. {{front.createImage(adherent)}}
  122.  
  123. <div class="container bootstrap snippets bootdey">
  124.     <div class="row margin-bottom-10">
  125.        <div class="col-md-8 col-sm-8" >
  126.              <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;" >
  127.         </div>
  128.        
  129.         <div class="col-md-4 col-sm-4" style=" width: 13% !important;">
  130.             <div class="servive-block servive-block-yellow">
  131.                 <i class="icon-2x color-light fa  fa-blind"></i>
  132.                 <h2 class="heading-md" style="font-size: 1rem !important;">Visites</h2>
  133.                 <h2 style="font-size: 1rem !important;"><b>{{ adherent.visits|length}}</b></h2>
  134.      </div>
  135.         </div>
  136.         <div class="col-md-4 col-sm-4" style=" width: 13% !important;">
  137.             <div class="servive-block servive-block-grey">
  138.                 <i class="icon-2x color-light fa  fa-file"></i>
  139.                 <h2 class="heading-md" style="font-size: 1rem !important;">Contrats</h2>
  140.                 <h2 style="font-size: 1rem !important;"><b>{{adherent.productSubscriptions|length}}</b></h2>
  141.      </div>
  142.         </div>
  143.         
  144.       </div>
  145.     {% set field_layout = ea_create_field_layout(entity.fields) %}
  146.     {% block detail_fields %}
  147.         {% if field_layout.hasTabs %}
  148.             {{ _self.render_detail_fields_with_tabs(entity, field_layout) }}
  149.         {% else %}
  150.             {{ _self.render_detail_fields(entity, field_layout.fields) }}
  151.         {% endif %}
  152.     {% endblock detail_fields %}
  153.     {% block delete_form %}
  154.         {{ include('@EasyAdmin/crud/includes/_delete_form.html.twig', { entity_id: entity.primaryKeyValue }, with_context = false) }}
  155.     {% endblock delete_form %}
  156. {% endblock %}
  157. {% macro render_detail_fields_with_tabs(entity, field_layout) %}
  158.     <div class="col-12">
  159.         <div class="nav-tabs-custom form-tabs">
  160.             <ul class="nav nav-tabs">
  161.                 {% for tab in field_layout.tabs %}
  162.                     <li class="nav-item">
  163.                         <a class="nav-link {% if loop.first %}active{% endif %}" href="#tab-pane-{{ tab.uniqueId }}" id="tab-{{ tab.uniqueId }}" data-bs-toggle="tab">
  164.                             {%- if tab.customOption('icon') -%}
  165.                                 <i class="fa-fw {{ tab.customOption('icon') }}"></i>
  166.                             {%- endif -%}
  167.                             {{ tab.label|trans(domain = ea.i18n.translationDomain)|trans(domain = 'EasyAdminBundle') }}
  168.                         </a>
  169.                     </li>
  170.                 {% endfor %}
  171.             </ul>
  172.             <div class="tab-content">
  173.                 {% for tab in field_layout.tabs %}
  174.                     <div id="tab-pane-{{ tab.uniqueId }}" class="tab-pane {% if loop.first %}active{% endif %} {{ tab.cssClass|default('') }}">
  175.                         {% if tab.help|default(false) %}
  176.                             <div class="content-header-help tab-help">
  177.                                 {{ tab.help|trans(domain = ea.i18n.translationDomain)|raw }}
  178.                             </div>
  179.                         {% endif %}
  180.                         <div class="row">
  181.                             {{ _self.render_detail_fields(entity, field_layout.fieldsInTab(tab.uniqueId)) }}
  182.                         </div>
  183.                     </div>
  184.                 {% endfor %}
  185.             </div>
  186.         </div>
  187.     </div>
  188. {% endmacro %}
  189. {% macro render_detail_fields(entity, fields) %}
  190.     {% set form_panel_is_already_open = false %}
  191.     {% for field in fields %}
  192.         {% set is_form_field_panel = 'field-form_panel' in field.cssClass %}
  193.         {% if is_form_field_panel or (loop.first and not is_form_field_panel) %}
  194.             {% if form_panel_is_already_open %}
  195.                 {{ _self.close_form_field_panel() }}
  196.                 {% set form_panel_is_already_open = false %}
  197.             {% endif %}
  198.             {{ _self.open_form_field_panel(is_form_field_panel ? field : null) }}
  199.             {% set form_panel_is_already_open = true %}
  200.         {% endif %}
  201.         {% block detail_field %}
  202.             {% if not is_form_field_panel %}
  203.                 {{ _self.render_field(entity, field) }}
  204.             {% endif %}
  205.             
  206.         {% endblock %}
  207.     {% endfor %}
  208.     {% if form_panel_is_already_open %}
  209.         {{ _self.close_form_field_panel() }}
  210.         {% set form_panel_is_already_open = false %}
  211.     {% endif %}
  212. {% endmacro %}
  213. {% macro open_form_field_panel(field = null) %}
  214.     {% set panel_name = field is null ? null : 'content-' ~ field.uniqueId %}
  215.     {% set collapsible = field is null ? false : field.customOption('collapsible') %}
  216.     {% set collapsed = field is null ? false : field.customOption('collapsed') %}
  217.     {% set panel_icon = field is null ? null : (field.customOptions.get('icon')|default(false)) %}
  218.     {% set panel_label = field is null ? null : field.label %}
  219.     {% set panel_help = field is null ? null : field.help|default(false)%}
  220.     {% set panel_has_header = collapsible or panel_icon or panel_label or panel_help %}
  221.     <div class="{{ field.cssClass ?? '' }}">
  222.         <div class="form-panel">
  223.             {% if panel_has_header %}
  224.                 <div class="form-panel-header {{ collapsible ? 'collapsible' }} {{ panel_help is not empty ? 'with-help' }}">
  225.                     <div class="form-panel-title">
  226.                         <a {% if not collapsible %}
  227.                             href="#" class="not-collapsible"
  228.                         {% else %}
  229.                             href="#{{ panel_name }}" data-bs-toggle="collapse"
  230.                             class="form-panel-collapse {{ collapsed ? 'collapsed' }}"
  231.                             aria-expanded="{{ collapsed ? 'false' : 'true' }}" aria-controls="{{ panel_name }}"
  232.                         {% endif %}
  233.                         >
  234.                             {% if collapsible %}
  235.                                 <i class="fas fw fa-chevron-right form-panel-collapse-marker"></i>
  236.                             {% endif %}
  237.                             {% if panel_icon %}
  238.                                 <i class="form-panel-icon {{ panel_icon }}"></i>
  239.                             {% endif %}
  240.                             {{ panel_label|trans|raw }}
  241.                         </a>
  242.                         {% if panel_help %}
  243.                             <div class="form-panel-help">{{ panel_help|trans|raw }}</div>
  244.                         {% endif %}
  245.                     </div>
  246.                 </div>
  247.             {% endif %}
  248.             <div {% if panel_name %}id="{{ panel_name }}"{% endif %} class="form-panel-body {{ collapsible ? 'collapse' }} {{ not collapsed ? 'show'}}">
  249.                 <dl class="datalist">
  250. {% endmacro %}
  251. {% macro close_form_field_panel() %}
  252.             </dl>
  253.         </div>
  254.     </div>
  255. </div>
  256. {% endmacro %}
  257. {% macro render_field(entity, field) %}
  258.     <div class="data-row {{ field.cssClass }}">
  259.         <dt>
  260.             {{ field.label|trans|raw }}
  261.             {% if field.help is not empty %}
  262.                 <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') }}">
  263.                     <i class="far fa-question-circle"></i>
  264.                 </a>
  265.             {% endif %}
  266.         </dt>
  267.         <dd>
  268.             {{ include(field.templatePath, { field: field, entity: entity }, with_context = false) }}
  269.         </dd>
  270.     </div>
  271.     
  272. {% endmacro %}
  273. {% block body_javascript  %}
  274.     {{parent()}}
  275.     <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>
  276.     
  277. {% endblock  %}