app/Plugin/ProductPlus42/Resource/template/admin/Product/ext_edit.twig line 1

Open in your IDE?
  1. {% set loop_index = 1 %}
  2. {% for ProductItem in ProductItems %}
  3.     {% set id = ProductItem.id %}
  4.     {% set name = 'productplus_' ~ id %}
  5.     {% if ProductItem.input_type == constant('Plugin\\ProductPlus42\\Entity\\ProductItem::IMAGE_TYPE') %}
  6.         <div class="row">
  7.             <div class="col-3">
  8.                 <div class="d-inline-block" data-tooltip="true" data-placement="top"
  9.                      title="{{ 'tooltip.product.image'|trans }}">
  10.                     <span>{{ form[name].vars.label }}</span>
  11.                     {% if form[name].vars.required %}
  12.                         <span class="badge bg-primary ms-1">
  13.                     {{ 'admin.common.required'|trans }}
  14.                 </span>
  15.                     {% endif %}
  16.                 </div>
  17.             </div>
  18.             <div class="col mb-2">
  19.                 <p id="message-{{ id }}"></p>
  20.                 <div id="upload-zone-{{ id }}" class="media rounded">
  21.                     <div class="media-body">
  22.                         {{ form_widget(form[name], { attr : { style : 'display:none;' } }) }}
  23.                         {{ form_errors(form[name]) }}
  24.                     </div><!-- /.media-body -->
  25.                 </div><!-- /.media -->
  26.             </div>
  27.         </div>
  28.     {% else %}
  29.         {% if ProductItem.input_type != "2" %}
  30.             {% set n = (loop_index % 2) %}
  31.             {% if n == 1 %}
  32.                 <div class="row" id="detail_box__productplus_{{ id }}">
  33.             {% endif %}
  34.             <div class="col-3">
  35.                 <div class="d-inline-block">
  36.                     <span>{{ form[name].vars.label }}</span>
  37.                     {% if form[name].vars.required %}
  38.                         <span class="badge bg-primary ms-1">
  39.                       {{ 'admin.common.required'|trans }}
  40.                   </span>
  41.                     {% endif %}
  42.                 </div>
  43.             </div>
  44.             <div class="col-3 mb-2">
  45.                 <div>
  46.                     {{ form_widget(form[name]) }}
  47.                     {{ form_errors(form[name]) }}
  48.                     {% if id == "6" and
  49.                         form[name].vars.value is defined and
  50.                         htCustomer[form[name].vars.value] is defined %}
  51.                         <p class="owner_name">
  52.                             <a href="{{ url('admin_customer_edit', { id: form[name].vars.value }) }}">
  53.                                 {{ htCustomer[form[name].vars.value] }}</a>
  54.                         </p>
  55.                     {% endif %}
  56.                 </div>
  57.             </div>
  58.             {% if n == 0 %}
  59.                 </div>
  60.             {% endif %}
  61.             {% set loop_index = loop_index + 1 %}
  62.         {% else %}
  63.             {% if (loop_index % 2) == 0 %}
  64.                 <div class="col-3 mb-2"></div>
  65.                 <div class="col-3 mb-2"></div>
  66.                 </div>
  67.                 {% set loop_index = loop_index + 1 %}
  68.             {% endif %}
  69.             <div class="row" id="detail_box__productplus_{{ ProductItem.id }}">
  70.                 <div class="col-3">
  71.                     <div class="d-inline-block">
  72.                         <span>{{ form[name].vars.label }}</span>
  73.                         {% if form[name].vars.required %}
  74.                             <span class="badge bg-primary ms-1">
  75.                       {{ 'admin.common.required'|trans }}
  76.                   </span>
  77.                         {% endif %}
  78.                     </div>
  79.                 </div>
  80.                 <div class="col mb-2">
  81.                     <div>
  82.                         {{ form_widget(form[name]) }}
  83.                         {{ form_errors(form[name]) }}
  84.                     </div>
  85.                 </div>
  86.             </div>
  87.         {% endif %}
  88.     {% endif %}
  89. {% endfor %}
  90. {% if (loop_index % 2) == 0 %}
  91.     <div class="col-3 mb-2"></div>
  92.     <div class="col-3 mb-2"></div>
  93.     </div>
  94. {% endif %}