src/Eccube/Resource/template/admin/Product/product.twig line 1

Open in your IDE?
  1. {#
  2. This file is part of EC-CUBE
  3. Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved.
  4. http://www.ec-cube.co.jp/
  5. For the full copyright and license information, please view the LICENSE
  6. file that was distributed with this source code.
  7. #}
  8. {% extends '@admin/default_frame.twig' %}
  9. {% set menus = ['product', 'product_edit'] %}
  10. {% block title %}{{ 'admin.product.product_registration'|trans }}{% endblock %}
  11. {% block sub_title %}{{ 'admin.product.product_management'|trans }}{% endblock %}
  12. {% form_theme form '@admin/Form/bootstrap_4_horizontal_layout.html.twig' %}
  13. {% block javascript %}
  14.     <script>
  15.         $(document).on('drop dragover', function(e) {
  16.             e.preventDefault();
  17.         });
  18.         $(function() {
  19.             {% if has_class == false %}
  20.             if ($("#{{ form.class.stock_unlimited.vars.id }}").prop("checked")) {
  21.                 $("#{{ form.class.stock.vars.id }}").attr("disabled", "disabled").val('');
  22.             } else {
  23.                 $("#{{ form.class.stock.vars.id }}").removeAttr("disabled");
  24.             }
  25.             $("#{{ form.class.stock_unlimited.vars.id }}").on("click change", function() {
  26.                 if ($(this).prop("checked")) {
  27.                     $("#{{ form.class.stock.vars.id }}").attr("disabled", "disabled").val('');
  28.                 } else {
  29.                     $("#{{ form.class.stock.vars.id }}").removeAttr("disabled");
  30.                 }
  31.             });
  32.             {% endif %}
  33.             // ファイルアップロード
  34.             // see https://pqina.nl/filepond/
  35.             var inputFileElement = document.querySelector('input[type=file]');
  36.             {% if eccube_config.locale == 'ja' or eccube_config.locale == 'en' %}
  37.             FilePond.setOptions(FilePondLocale_{{ eccube_config.locale }});
  38.             {% endif %}
  39.             FilePond.setOptions({
  40.                 server: {
  41.                     process: {
  42.                         url: '{{ path('admin_product_image_process') }}',
  43.                         headers: {
  44.                             'ECCUBE-CSRF-TOKEN': $('meta[name="eccube-csrf-token"]').attr('content'),
  45.                             'X-Requested-With': 'XMLHttpRequest'
  46.                         }
  47.                     },
  48.                     load: {
  49.                         url: '{{ path('admin_product_image_load') }}?source=',
  50.                         headers: {
  51.                             'X-Requested-With': 'XMLHttpRequest'
  52.                         }
  53.                     },
  54.                     revert: {
  55.                         url: '{{ path('admin_product_image_revert') }}',
  56.                         headers: {
  57.                             'ECCUBE-CSRF-TOKEN': $('meta[name="eccube-csrf-token"]').attr('content'),
  58.                             'X-Requested-With': 'XMLHttpRequest'
  59.                         }
  60.                     }
  61.                 }
  62.             });
  63.             var pond = FilePond.create(inputFileElement, {
  64.                 allowFileTypeValidation: true,
  65.                 acceptedFileTypes: [
  66.                     'image/gif',
  67.                     'image/png',
  68.                     'image/jpeg'
  69.                 ],
  70.                 allowFileSizeValidation: true,
  71.                 maxFileSize: 10000000,
  72.                 maxFiles: 10,
  73.                 allowBrowse: true,
  74.                 allowDrop: true,
  75.                 allowReorder: true,
  76.                 labelIdle: '<i class="fa fa-cloud-upload fa-3x text-ec-lightGray mx-3 align-middle" aria-hidden="true" style="font-size: 40px"></i>{{ 'admin.common.drag_and_drop_image_description'|trans }}<span class="filepond--label-action">{{ 'admin.common.file_select'|trans }}</span>',
  77.                 styleItemPanelAspectRatio: 0.5625,
  78.                 // 保存されている画像のロード
  79.                 files: [
  80.                     {% for image in form.images %}
  81.                     {
  82.                         source: '{{ image.vars.value }}',
  83.                         options: {
  84.                             type: 'local'
  85.                         }
  86.                     },
  87.                     {% endfor %}
  88.                     // 追加してすぐの画像のロード. バリデーションエラーの場合など.
  89.                     {% for add_image in form.add_images %}
  90.                     {
  91.                         source: '{{ add_image.vars.value }}',
  92.                         options: {
  93.                             type: 'local'
  94.                         }
  95.                     },
  96.                     {% endfor %}
  97.                 ]
  98.             });
  99.             // 画像が追加されたら add_images にファイル名を追加する
  100.             var proto_add = '{{ form_widget(form.add_images.vars.prototype) }}';
  101.             pond.on('processfile', function(error, file) {
  102.                 if (error) {
  103.                     console.log(error);
  104.                 } else {
  105.                     $('#upload-zone').append(
  106.                         $(proto_add.replace(/__name__/g, file.id))
  107.                             .val(file.serverId)
  108.                             .addClass('add_images')
  109.                     );
  110.                 }
  111.             });
  112.             // 画像が削除されたら delete_images にファイル名を追加する
  113.             var proto_del = '{{ form_widget(form.delete_images.vars.prototype) }}';
  114.             pond.on('removefile', function(error, file) {
  115.                 if (error) {
  116.                     console.log(error);
  117.                 } else {
  118.                     // file.serverId にはアップロードしたファイル名が格納される.
  119.                     if (file.serverId) {
  120.                         $('#upload-zone').append(
  121.                             $(proto_del.replace(/__name__/g, file.id))
  122.                                 .val(file.serverId)
  123.                                 .addClass('del_images')
  124.                         );
  125.                     }
  126.                     // 追加してすぐ削除した画像があれば削除する
  127.                     $('#upload-zone').find('#admin_product_add_images_' + file.id).remove(); // 追加してすぐ削除した画像
  128.                     $('#upload-zone').find('.add_images[value="' + file.filename + '"]').remove(); // 追加後, バリデーションエラーが発生した後に削除した画像
  129.                 }
  130.             });
  131.             pond.on('initfile', function() {
  132.                 $('#product_image_error').hide();
  133.             });
  134.             pond.on('error', function(error, file) {
  135.                 var message = '{{ 'admin.common.upload_error'|trans }}';
  136.                 if (error.main !== undefined) {
  137.                     message = `${error.main}: ${error.sub}`;
  138.                 }
  139.                 $('#product_image_error')
  140.                     .show()
  141.                     .find('.form-error-message').text(message);
  142.                 // エラーメッセージが表示されてからプレビューエリアのエラーメッセージを非表示にする
  143.                 setTimeout(function() {
  144.                     $('.filepond--file-status').hide();
  145.                 }, 300);
  146.             });
  147.             // バリデーションエラーが出た場合に画像を保持するための hidden を追加しておく
  148.             var proto_image = '{{ form_widget(form.images.vars.prototype) }}';
  149.             {% for image in form.images %}
  150.                 $('#upload-zone').append(
  151.                     $(proto_image.replace(/__name__/g, '{{ loop.index0 }}'))
  152.                         .val('{{ image.vars.value }}')
  153.                         .addClass('images')
  154.                 );
  155.             {% endfor %}
  156.             {% for add_image in form.add_images %}
  157.                 $('#upload-zone').append(
  158.                     $('{{ form_widget(add_image) }}')
  159.                         .val('{{ add_image.vars.value }}')
  160.                         .addClass('add_images')
  161.                 );
  162.             {% endfor %}
  163.             {% for delete_image in form.delete_images %}
  164.                 $('#upload-zone').append(
  165.                     $('{{ form_widget(delete_image) }}').addClass('del_images')
  166.                 );
  167.             {% endfor %}
  168.             // タグ管理
  169.             var mainTags = $('#allTags');
  170.             var adminProductTag = $('#admin_product_Tag');
  171.             $('input', adminProductTag).each(function() {
  172.                 if ($(this).is(':checked')) {
  173.                     $('button[data-tag-id="' + $(this).val() + '"]').removeClass('btn-outline-secondary').addClass('btn-outline-primary');
  174.                 }
  175.             });
  176.             mainTags.on('click', 'button.btn', function() {
  177.                 var btnTag = $(this);
  178.                 var tagId = btnTag.data('tag-id');
  179.                 if (btnTag.hasClass('btn-outline-primary')) {
  180.                     btnTag.removeClass('btn-outline-primary').addClass('btn-outline-secondary');
  181.                     $('input[value="' + tagId + '"]', mainTags).prop('checked', false);
  182.                 } else {
  183.                     btnTag.removeClass('btn-outline-secondary').addClass('btn-outline-primary');
  184.                     $('input[value="' + tagId + '"]', mainTags).prop('checked', true);
  185.                 }
  186.             });
  187.             var confirmFormChange = function(form, target, modal) {
  188.                 var returnLink = form.find('input[type="hidden"][name*="return_link"]'),
  189.                     saveBtn = modal.find('a[data-action="save"]'),
  190.                     cancelBtn = modal.find('a[data-action="cancel"]');
  191.                 modal.on('hidden.bs.modal', function() {
  192.                     returnLink.val('');
  193.                 });
  194.                 saveBtn.on('click', function() {
  195.                     returnLink.val($(this).data('return-link'));
  196.                     $(this).addClass('disabled');
  197.                     form.submit();
  198.                 });
  199.                 target.on('click', function() {
  200.                     modal.find('.modal-body .screen-name').text($(this).attr('title'));
  201.                     modal.modal('show');
  202.                     saveBtn.data('return-link', $(this).attr('href'));
  203.                     cancelBtn.attr('href', $(this).attr('href'));
  204.                     return false;
  205.                 });
  206.             };
  207.             confirmFormChange($('#form1'), $('a[data-action="confirm"]'), $('#confirmFormChangeModal'))
  208.         });
  209.         // searchWordの実行
  210.         $('#search-category').on('input', function () {
  211.             searchWord($(this).val(), $('.category-li'));
  212.         });
  213.     </script>
  214. {% endblock javascript %}
  215. {% block main %}
  216.     <!-- 移動確認モーダル-->
  217.     <div class="modal fade" id="confirmFormChangeModal" tabindex="-1" role="dialog"
  218.          aria-labelledby="confirmFormChangeModal" aria-hidden="true">
  219.         <div class="modal-dialog" role="document">
  220.             <div class="modal-content">
  221.                 <div class="modal-header">
  222.                     <h5 class="modal-title">{{ 'admin.common.move_to_confirm_title'|trans }}</h5>
  223.                     <button class="btn-close" type="button" data-bs-dismiss="modal" aria-label="Close">
  224.                     </button>
  225.                 </div>
  226.                 <div class="modal-body">
  227.                     <p class="screen-name"></p>
  228.                 </div>
  229.                 <div class="modal-footer">
  230.                     <a class="btn btn-ec-conversion" data-action="save" href="javascript:void(0)">
  231.                         {{ 'admin.common.move_to_confirm_save_and_move'|trans }}
  232.                     </a>
  233.                     <a class="btn btn-ec-sub" data-action="cancel" href="javascript:void(0)">
  234.                         {{ 'admin.common.move_to_confirm_move_only'|trans }}
  235.                     </a>
  236.                 </div>
  237.             </div>
  238.         </div>
  239.     </div>
  240.     <form role="form" name="form1" id="form1" method="post" action="" novalidate enctype="multipart/form-data">
  241.         {{ form_widget(form._token) }}
  242.         {{ form_widget(form.return_link) }}
  243.         <div class="c-contentsArea__cols">
  244.             <div class="c-contentsArea__primaryCol">
  245.                 <div class="c-primaryCol">
  246.                     <div class="card rounded border-0 mb-4">
  247.                         <div class="card-header">
  248.                             <div class="row">
  249.                                 <div class="col-8">
  250.                                     <div class="d-inline-block">
  251.                                     <span class="card-title">
  252.                                         {{ 'admin.product.product__card_title'|trans }}
  253.                                     </span>
  254.                                     </div>
  255.                                 </div>
  256.                                 <div class="col-4 text-end">
  257.                                     <a data-bs-toggle="collapse" href="#basicConfig" aria-expanded="false"
  258.                                        aria-controls="basicConfig">
  259.                                         <i class="fa fa-angle-up fa-lg"></i>
  260.                                     </a>
  261.                                 </div>
  262.                             </div>
  263.                         </div>
  264.                         <div class="collapse show ec-cardCollapse" id="basicConfig">
  265.                             <div class="card-body">
  266.                                 {% if Product.id %}
  267.                                     <div class="row">
  268.                                         <div class="col-3">
  269.                                             <div class="d-inline-block" data-bs-toggle="tooltip" data-bs-placement="top" title="{{ 'tooltip.product.product_id'|trans }}">
  270.                                                 <span>{{ 'admin.product.product_id'|trans }}</span>
  271.                                                 <i class="fa fa-question-circle fa-lg ms-1"></i>
  272.                                             </div>
  273.                                         </div>
  274.                                         <div class="col">
  275.                                             <p>{{ Product.id }}</p>
  276.                                         </div>
  277.                                     </div>
  278.                                 {% endif %}
  279.                                 <div class="row">
  280.                                     <div class="col-3">
  281.                                         <div class="d-inline-block">
  282.                                             <span>{{ 'admin.product.name'|trans }}</span>
  283.                                             <span class="badge bg-primary ms-1">
  284.                                                 {{ 'admin.common.required'|trans }}
  285.                                             </span>
  286.                                         </div>
  287.                                     </div>
  288.                                     <div class="col mb-2">
  289.                                         {{ form_widget(form.name) }}
  290.                                         {{ form_errors(form.name) }}
  291.                                     </div>
  292.                                 </div>
  293.                                 {% if has_class == false %}
  294.                                     <div class="row">
  295.                                         <div class="col-3">
  296.                                             <div class="d-inline-block" data-bs-toggle="tooltip" data-bs-placement="top" title="{{ 'tooltip.product.sale_type'|trans }}">
  297.                                                 <span>{{ 'admin.product.sale_type'|trans }}</span>
  298.                                                 <i class="fa fa-question-circle fa-lg ms-1"></i>
  299.                                                 <span class="badge bg-primary ms-1">
  300.                                                     {{ 'admin.common.required'|trans }}
  301.                                                 </span>
  302.                                             </div>
  303.                                         </div>
  304.                                         <div class="col mb-2">
  305.                                             {{ form_widget(form.class.sale_type) }}
  306.                                             {{ form_errors(form.class.sale_type) }}
  307.                                         </div>
  308.                                     </div>
  309.                                 {% endif %}
  310.                                 <div class="row">
  311.                                     <div class="col-3">
  312.                                         <div class="d-inline-block" data-bs-toggle="tooltip" data-bs-placement="top" title="{{ 'tooltip.product.image'|trans }}">
  313.                                             <span>{{ 'admin.product.image'|trans }}</span>
  314.                                             <i class="fa fa-question-circle fa-lg ms-1"></i>
  315.                                             <br>{{ 'admin.product.image_size'|trans }}
  316.                                         </div>
  317.                                     </div>
  318.                                     <div class="col mb-2">
  319.                                         <p id="message"></p>
  320.                                         <div id="upload-zone" class="rounded">
  321.                                             {{ form_widget(form.product_image, { attr : { style : 'display:none;' } }) }}
  322.                                             {{ form_errors(form.product_image) }}
  323.                                         </div><!-- /#upload-zone -->
  324.                                         <span class="invalid-feedback" id="product_image_error" style="display: none">
  325.                                             <span class="d-block">
  326.                                                 <span class="form-error-icon badge bg-danger text-uppercase">{{ 'Error'|trans({}, 'validators') }}</span>
  327.                                                 <span class="form-error-message"></span>
  328.                                             </span>
  329.                                         </span>
  330.                                     </div>
  331.                                 </div>
  332.                                 <div class="row">
  333.                                     <div class="col-3">
  334.                                         <div class="d-inline-block" data-bs-toggle="tooltip" data-bs-placement="top"
  335.                                              title="{{ 'tooltip.product.description_detail'|trans }}">
  336.                                             <span>{{ 'admin.product.description_detail'|trans }}</span>
  337.                                             <i class="fa fa-question-circle fa-lg ms-1"></i>
  338.                                         </div>
  339.                                     </div>
  340.                                     <div class="col">
  341.                                         {{ form_widget(form.description_detail, { attr : { rows : "8"} }) }}
  342.                                         {{ form_errors(form.description_detail) }}
  343.                                         <div class="d-inline-block mb-2" data-bs-toggle="collapse" href="#addComment"
  344.                                              role="button" aria-expanded="false" aria-controls="addComment">
  345.                                             <a>
  346.                                                 <i class="fa fa-plus-square-o fw-bold me-1"></i>
  347.                                                 <span class="fw-bold text-ec-black">
  348.                                                     {{ 'admin.product.description_list__add'|trans }}
  349.                                                 </span>
  350.                                             </a>
  351.                                         </div>
  352.                                     </div>
  353.                                 </div>
  354.                                 <div class="collapse ec-collapse" id="addComment">
  355.                                     <div class="row bg-ec-formGray pt-3 mb-2">
  356.                                         <div class="col-3">
  357.                                             <div class="d-inline-block" data-bs-toggle="tooltip" data-bs-placement="top"
  358.                                                  title="{{ 'tooltip.product.description_list'|trans }}">
  359.                                                 <span>{{ 'admin.product.description_list'|trans }}</span>
  360.                                                 <i class="fa fa-question-circle fa-lg ms-1"></i>
  361.                                             </div>
  362.                                         </div>
  363.                                         <div class="col mb-4">
  364.                                             <div>
  365.                                                 {{ form_widget(form.description_list, { attr : { rows : "4"} }) }}
  366.                                                 {{ form_errors(form.description_list) }}
  367.                                             </div>
  368.                                         </div>
  369.                                     </div>
  370.                                 </div>
  371.                                 {% if has_class == false %}
  372.                                     <div class="row">
  373.                                         <div class="col-3">
  374.                                             <div class="d-inline-block">
  375.                                                 <span>{{ 'admin.product.sale_price'|trans }}</span>
  376.                                                 <span class="badge bg-primary ms-1">
  377.                                                     {{ 'admin.common.required'|trans }}
  378.                                                 </span>
  379.                                             </div>
  380.                                         </div>
  381.                                         <div class="col mb-2">
  382.                                             <div>
  383.                                                 {{ form_widget(form.class.price02) }}
  384.                                                 {{ form_errors(form.class.price02) }}
  385.                                             </div>
  386.                                         </div>
  387.                                     </div>
  388.                                     <div class="row">
  389.                                         <div class="col-3">
  390.                                             <div class="d-inline-block" data-bs-toggle="tooltip" data-bs-placement="top"
  391.                                                  title="{{ 'tooltip.product.normal_price'|trans }}">
  392.                                                 <span>{{ 'admin.product.normal_price'|trans }}</span>
  393.                                                 <i class="fa fa-question-circle fa-lg ms-1"></i>
  394.                                             </div>
  395.                                         </div>
  396.                                         <div class="col mb-2">
  397.                                             <div>
  398.                                                 {{ form_widget(form.class.price01) }}
  399.                                                 {{ form_errors(form.class.price01) }}
  400.                                             </div>
  401.                                         </div>
  402.                                     </div>
  403.                                     <div class="row">
  404.                                         <div class="col-3">
  405.                                             <div class="d-inline-block">
  406.                                                 <span>{{ 'admin.product.stock'|trans }}</span>
  407.                                                 <span class="badge bg-primary ms-1">
  408.                                                     {{ 'admin.common.required'|trans }}
  409.                                                 </span>
  410.                                             </div>
  411.                                         </div>
  412.                                         <div class="col">
  413.                                             <div>
  414.                                                 {{ form_widget(form.class.stock) }}
  415.                                                 {{ form_errors(form.class.stock) }}
  416.                                                 {# TODO: form_layoutの調整 #}
  417.                                                 {#<div class="form-check mb-2">#}
  418.                                                 {#<input class="form-check-input"#}
  419.                                                 {#id="{{ form.class.stock_unlimited.vars.id }}"#}
  420.                                                 {#name="{{ form.class.stock_unlimited.vars.full_name }}"#}
  421.                                                 {#type="checkbox"#}
  422.                                                 {#value="{{ form.class.stock_unlimited.vars.value }}">#}
  423.                                                 {#<label class="form-check-label"#}
  424.                                                 {#for="{{ form.class.stock_unlimited.vars.id }}">#}
  425.                                                 {#{{ 'admin.product.product.stock_unlimited'|trans }}#}
  426.                                                 {#</label>#}
  427.                                                 {#</div>#}
  428.                                                 {{ form_widget(form.class.stock_unlimited) }}
  429.                                                 {{ form_errors(form.class.stock_unlimited) }}
  430.                                             </div>
  431.                                         </div>
  432.                                     </div>
  433.                                 {% endif %}
  434.                                 <div class="row">
  435.                                     <div class="col-3">
  436.                                         <div class="d-inline-block" data-bs-toggle="tooltip" data-bs-placement="top"
  437.                                              title="{{ 'tooltip.product.search_word'|trans }}">
  438.                                             <span>{{ 'admin.product.search_word'|trans }}</span>
  439.                                             <i class="fa fa-question-circle fa-lg ms-1"></i>
  440.                                         </div>
  441.                                     </div>
  442.                                     <div class="col mb-2">
  443.                                         <div>
  444.                                             {{ form_widget(form.search_word) }}
  445.                                             {{ form_errors(form.search_word) }}
  446.                                         </div>
  447.                                     </div>
  448.                                 </div>
  449.                                 {% if has_class == false %}
  450.                                     <div class="row">
  451.                                         <div class="col-3">
  452.                                             <div class="d-inline-block" data-bs-toggle="tooltip" data-bs-placement="top"
  453.                                                  title="{{ 'tooltip.product.product_code'|trans }}">
  454.                                                 <span>{{ 'admin.product.product_code'|trans }}</span>
  455.                                                 <i class="fa fa-question-circle fa-lg ms-1"></i>
  456.                                             </div>
  457.                                         </div>
  458.                                         <div class="col mb-2">
  459.                                             <div>
  460.                                                 {{ form_widget(form.class.code) }}
  461.                                                 {{ form_errors(form.class.code) }}
  462.                                             </div>
  463.                                         </div>
  464.                                     </div>
  465.                                     <div class="row">
  466.                                         <div class="col-3">
  467.                                             <div class="d-inline-block" data-bs-toggle="tooltip" data-bs-placement="top"
  468.                                                  title="{{ 'tooltip.product.sale_limit'|trans }}">
  469.                                                 <span>{{ 'admin.product.sale_limit'|trans }}</span>
  470.                                                 <i class="fa fa-question-circle fa-lg ms-1"></i>
  471.                                             </div>
  472.                                         </div>
  473.                                         <div class="col mb-2">
  474.                                             <div>
  475.                                                 {{ form_widget(form.class.sale_limit) }}
  476.                                                 {{ form_errors(form.class.sale_limit) }}
  477.                                             </div>
  478.                                         </div>
  479.                                     </div>
  480.                                     <div class="row">
  481.                                         <div class="col-3">
  482.                                             <div class="d-inline-block" data-bs-toggle="tooltip" data-bs-placement="top"
  483.                                                  title="{{ 'tooltip.product.delivery_duration'|trans }}">
  484.                                                 <span>{{ 'admin.product.delivery_duration'|trans }}</span>
  485.                                                 <i class="fa fa-question-circle fa-lg ms-1"></i>
  486.                                             </div>
  487.                                         </div>
  488.                                         <div class="col mb-2">
  489.                                             <div>
  490.                                                 {{ form_widget(form.class.delivery_duration) }}
  491.                                                 {{ form_errors(form.class.delivery_duration) }}
  492.                                             </div>
  493.                                         </div>
  494.                                     </div>
  495.                                     {% if BaseInfo.option_product_delivery_fee %}
  496.                                         <div class="row">
  497.                                             <div class="col-3">
  498.                                                 <div class="d-inline-block">
  499.                                                     <span>{{ 'admin.product.delivery_fee'|trans }}</span>
  500.                                                 </div>
  501.                                             </div>
  502.                                             <div class="col mb-2">
  503.                                                 <div>
  504.                                                     {{ form_widget(form.class.delivery_fee) }}
  505.                                                     {{ form_errors(form.class.delivery_fee) }}
  506.                                                 </div>
  507.                                             </div>
  508.                                         </div>
  509.                                     {% endif %}
  510.                                     {% if BaseInfo.option_product_tax_rule %}
  511.                                         <div class="row">
  512.                                             <div class="col-3">
  513.                                                 <div class="d-inline-block">
  514.                                                     <span>{{ 'admin.product.tax_rate'|trans }}</span>
  515.                                                 </div>
  516.                                             </div>
  517.                                             <div class="col mb-2">
  518.                                                 <div>
  519.                                                     {{ form_widget(form.class.tax_rate) }}
  520.                                                     {{ form_errors(form.class.tax_rate) }}
  521.                                                 </div>
  522.                                             </div>
  523.                                         </div>
  524.                                     {% endif %}
  525.                                 {% endif %}
  526.                                 {# エンティティ拡張の自動出力 #}
  527.                                 {% for f in form|filter(f => f.vars.eccube_form_options.auto_render) %}
  528.                                     {% if f.vars.eccube_form_options.form_theme %}
  529.                                         {% form_theme f f.vars.eccube_form_options.form_theme %}
  530.                                         {{ form_row(f) }}
  531.                                     {% else %}
  532.                                         <div class="row">
  533.                                             <div class="col-3">
  534.                                                 <span>{{ f.vars.label|trans }}</span>
  535.                                             </div>
  536.                                             <div class="col mb-2">
  537.                                                 <div>
  538.                                                     {{ form_widget(f) }}
  539.                                                     {{ form_errors(f) }}
  540.                                                 </div>
  541.                                             </div>
  542.                                         </div>
  543.                                     {% endif %}
  544.                                 {% endfor %}
  545.                                 {% if has_class == false %}
  546.                                     {% for f in form.class|filter(f => f.vars.eccube_form_options.auto_render) %}
  547.                                         {% if f.vars.eccube_form_options.form_theme %}
  548.                                             {% form_theme f f.vars.eccube_form_options.form_theme %}
  549.                                             {{ form_row(f) }}
  550.                                         {% else %}
  551.                                             <div class="row">
  552.                                                 <div class="col-3">
  553.                                                     <span>{{ f.vars.label|trans }}</span>
  554.                                                 </div>
  555.                                                 <div class="col mb-2">
  556.                                                     <div>
  557.                                                         {{ form_widget(f) }}
  558.                                                         {{ form_errors(f) }}
  559.                                                     </div>
  560.                                                 </div>
  561.                                             </div>
  562.                                         {% endif %}
  563.                                     {% endfor %}
  564.                                 {% endif %}
  565.                             </div>
  566.                         </div>
  567.                     </div>
  568.                     {% if id is not null %}
  569.                         <div class="card rounded border-0 mb-4">
  570.                             <div class="card-header">
  571.                                 <div class="row">
  572.                                     <div class="col-8">
  573.                                         <div class="d-inline-block" data-bs-toggle="tooltip" data-bs-placement="top"
  574.                                              title="{{ 'tooltip.product.product_class'|trans }}">
  575.                                         <span class="card-title">
  576.                                             {{ 'admin.product.product_class__card_title'|trans }}
  577.                                             <i class="fa fa-question-circle fa-lg ms-1"></i>
  578.                                         </span>
  579.                                         </div>
  580.                                     </div>
  581.                                     <div class="col-4 text-end">
  582.                                         <a data-bs-toggle="collapse" href="#standardConfig" aria-expanded="false"
  583.                                            aria-controls="standardConfig">
  584.                                             <i class="fa fa-angle-up fa-lg"></i>
  585.                                         </a>
  586.                                     </div>
  587.                                 </div>
  588.                             </div>
  589.                             <div class="collapse show ec-cardCollapse" id="standardConfig">
  590.                                 <div class="card-body">
  591.                                     {% if has_class == true %}
  592.                                         <table class="table table-striped">
  593.                                             <thead class="table-active">
  594.                                             <th class="ps-3 pt-2 pb-2">{{ 'admin.product.class_category1__short'|trans }}</th>
  595.                                             <th class="pt-2 pb-2">{{ 'admin.product.class_category2__short'|trans }}</th>
  596.                                             <th class="pt-2 pb-2">{{ 'admin.product.product_code__short'|trans }}</th>
  597.                                             <th class="pt-2 pb-2">{{ 'admin.product.stock'|trans }}</th>
  598.                                             <th class="pe-3 pt-2 pb-2">{{ 'admin.product.price'|trans }}</th>
  599.                                             </thead>
  600.                                             <tbody>
  601.                                             {% for Class in Product.ProductClasses %}
  602.                                                 {% if Class.visible == 1 %}
  603.                                                     <tr>
  604.                                                         <td class="ps-3">{% if Class.hasClassCategory1 %}{{ Class.ClassCategory1.name }}{% endif %}</td>
  605.                                                         <td>{% if Class.hasClassCategory2 %}{{ Class.ClassCategory2.name }}{% endif %}</td>
  606.                                                         <td>{{ Class.code }}</td>
  607.                                                         <td>{% if Class.stock_unlimited %}{{ 'admin.product.stock_unlimited__short'|trans }}{% else %}{{ Class.stock }}{% endif %}</td>
  608.                                                         <td class="pe-3">{{ Class.price02|price }}</td>
  609.                                                     </tr>
  610.                                                 {% endif %}
  611.                                             {% endfor %}
  612.                                             </tbody>
  613.                                         </table>
  614.                                     {% endif %}
  615.                                     <div class="d-block text-center text-center">
  616.                                         <a href="{{ path('admin_product_product_class', { 'id' : id }) }}" class="btn btn-ec-regular" data-action="confirm"
  617.                                            title="{{ 'admin.common.move_to_confirm_message'|trans({
  618.                                                '%name%' : 'admin.product.product_class_registration'|trans
  619.                                            }) }}">{{ 'admin.product.product_class__confirm_of_product'|trans }}</a>
  620.                                     </div>
  621.                                 </div>
  622.                             </div>
  623.                         </div>
  624.                     {% endif %}
  625.                     <div class="card rounded border-0 mb-4">
  626.                         <div class="card-header">
  627.                             <div class="row">
  628.                                 <div class="col-8">
  629.                                     <div class="d-inline-block" data-bs-toggle="tooltip" data-bs-placement="top"
  630.                                          title="{{ 'tooltip.product.free_area'|trans }}">
  631.                                         <span class="card-title">{{ 'admin.product.free_area__card_title'|trans }}</span>
  632.                                         <i class="fa fa-question-circle fa-lg ms-1"></i>
  633.                                     </div>
  634.                                 </div>
  635.                                 <div class="col-4 text-end">
  636.                                     <a data-bs-toggle="collapse" href="#freeArea" aria-expanded="false"
  637.                                        aria-controls="freeArea">
  638.                                         <i class="fa fa-angle-up fa-lg"></i>
  639.                                     </a>
  640.                                 </div>
  641.                             </div>
  642.                         </div>
  643.                         <div class="collapse show ec-cardCollapse" id="freeArea">
  644.                             <div class="card-body">
  645.                                 <div class="row">
  646.                                     <div class="col-3">
  647.                                         <span>{{ 'admin.product.free_area'|trans }}</span>
  648.                                     </div>
  649.                                     <div class="col-9">
  650.                                         <div>
  651.                                             {{ form_widget(form.free_area, {id: 'wysiwyg-area', attr : { rows : "8"} }) }}
  652.                                             {{ form_errors(form.free_area) }}
  653.                                         </div>
  654.                                     </div>
  655.                                 </div>
  656.                             </div>
  657.                         </div>
  658.                     </div>
  659.                 </div>
  660.             </div>
  661.             <div class="c-contentsArea__secondaryCol">
  662.                 <div class="c-secondaryCol">
  663.                     {% if id is not null %}
  664.                         <div class="card rounded border-0 mb-4">
  665.                             <div class="collapse show ec-cardCollapse" id="preview">
  666.                                 <div class="card-body">
  667.                                     <div class="d-block text-center">
  668.                                         <a class="btn w-100 btn-ec-regular"
  669.                                            target="_blank"
  670.                                            href="{{ url('product_detail', {id:id}) }}"
  671.                                            title="{{ 'admin.product.preview'|trans }}">{{ 'admin.product.preview'|trans }}</a>
  672.                                     </div>
  673.                                 </div>
  674.                             </div>
  675.                         </div>
  676.                     {% endif %}
  677.                     <div class="card rounded border-0 mb-4">
  678.                         <div class="card-header">
  679.                             <div class="row">
  680.                                 <div class="col-8">
  681.                                     <div class="d-inline-block">
  682.                                         <span class="card-title">{{ 'admin.product.category__product_card_title'|trans }}</span>
  683.                                     </div>
  684.                                 </div>
  685.                                 <div class="col-4 text-end">
  686.                                     <a data-bs-toggle="collapse" href="#category" aria-expanded="false"
  687.                                        aria-controls="category">
  688.                                         <i class="fa fa-angle-up fa-lg"></i>
  689.                                     </a>
  690.                                 </div>
  691.                             </div>
  692.                         </div>
  693.                         <div class="collapse show ec-cardCollapse" id="category">
  694.                             <div class="card-body">
  695.                                 <div class="mb-3">
  696.                                     <div class="row">
  697.                                         <div class="col">
  698.                                             <div class="input-group">
  699.                                                 <div class="input-group-text">
  700.                                                     <span id="basic-addon1">
  701.                                                             <i class="fa fa-search"></i>
  702.                                                     </span>
  703.                                                 </div>
  704.                                                 <input id="search-category" class="form-control" type="search"
  705.                                                        placeholder="{{ 'admin.product.search_category'|trans }}"
  706.                                                        aria-label="Search">
  707.                                             </div>
  708.                                         </div>
  709.                                     </div>
  710.                                 </div>
  711.                                 {% macro tree(ChoicedIds, Category, form) %}
  712.                                     {% import _self as selfMacro %}
  713.                                     <li class="c-directoryTree--registerItem category-li">
  714.                                         <input type="checkbox" id="admin_product_category_{{ Category.id }}" name="admin_product[Category][]" value="{{ Category.id }}" {% if Category.id in ChoicedIds %}checked{% endif %}>
  715.                                         <label for="admin_product_category_{{ Category.id }}">{{ Category.name }}</label>
  716.                                         <ul class="list-unstyled">
  717.                                             {% for child,ChildCategory in Category.children %}
  718.                                                 {{ selfMacro.tree(ChoicedIds, ChildCategory, form) }}
  719.                                             {% endfor %}
  720.                                         </ul>
  721.                                     </li>
  722.                                 {% endmacro %}
  723.                                 <div class="c-directoryTree--register rounded border mb-3 p-3">
  724.                                     {% import _self as renderMacro %}
  725.                                     {% for TopCategory in TopCategories %}
  726.                                         <ul class="list-unstyled">
  727.                                             {{ renderMacro.tree(ChoicedCategoryIds, TopCategory, form.Category) }}
  728.                                         </ul>
  729.                                     {% endfor %}
  730.                                     {{ form_errors(form.Category) }}
  731.                                 </div>
  732.                                 <div class="d-block text-center">
  733.                                     <a class="btn w-100 btn-ec-regular"
  734.                                        data-action="confirm"
  735.                                        href="{{ path('admin_product_category') }}"
  736.                                        title="{{ 'admin.common.move_to_confirm_message'|trans({
  737.                                            '%name%' : 'admin.product.category_management'|trans}) }}">{{ 'admin.product.move_to_category'|trans }}</a>
  738.                                 </div>
  739.                             </div>
  740.                         </div>
  741.                     </div>
  742.                     <div class="card rounded border-0 mb-4">
  743.                         <div class="card-header">
  744.                             <div class="row">
  745.                                 <div class="col-8">
  746.                                     <div class="d-inline-block">
  747.                                         <span class="card-title">
  748.                                             {{ 'admin.product.tag__product_card_title'|trans }}
  749.                                         </span>
  750.                                     </div>
  751.                                 </div>
  752.                                 <div class="col-4 text-end">
  753.                                     <a data-bs-toggle="collapse" href="#tag" aria-expanded="false" aria-controls="tag">
  754.                                         <i class="fa fa-angle-up fa-lg"></i>
  755.                                     </a>
  756.                                 </div>
  757.                             </div>
  758.                         </div>
  759.                         <div class="collapse show ec-cardCollapse" id="tag">
  760.                             <div class="card-body">
  761.                                 {% if(Tags|length > 0) %}
  762.                                     {% for Tag in Tags %}
  763.                                         <div class="d-inline-block mb-2 me-2">
  764.                                             <button class="btn btn-outline-primary" type="button">{{ Tag.name }}</button>
  765.                                         </div>
  766.                                     {% endfor %}
  767.                                 {% endif %}
  768.                                 <div class="d-block mb-3" data-bs-toggle="collapse" href="#allTags" role="button"
  769.                                      aria-expanded="false" aria-controls="allTags">
  770.                                     <a>
  771.                                         <i class="fa fa-plus-square-o fw-bold me-1"></i>
  772.                                         <span class="fw-bold">{{ 'admin.product.save_tag'|trans }}</span>
  773.                                     </a>
  774.                                 </div>
  775.                                 <div class="collapse p-3 bg-ec-lightGray mb-3 ec-collapse" id="allTags">
  776.                                     <div class="d-none">
  777.                                         {{ form_widget(form.Tag) }}
  778.                                     </div>
  779.                                     {% if(TagsList|length > 0) %}
  780.                                         {% for Tag in TagsList %}
  781.                                             <div class="d-inline-block mb-2 me-2">
  782.                                                 <button class="btn btn-outline-secondary" type="button"
  783.                                                         data-tag-id="{{ Tag.id }}">{{ Tag.name }}</button>
  784.                                             </div>
  785.                                         {% endfor %}
  786.                                     {% endif %}
  787.                                     <div class="d-block mb-3" data-bs-toggle="collapse" href="#allTags" role="button"
  788.                                          aria-expanded="false" aria-controls="allTags"></div>
  789.                                 </div>
  790.                                 <div class="d-block text-center">
  791.                                     <a href="{{ path('admin_product_tag') }}"
  792.                                        class="btn w-100 btn-ec-regular"
  793.                                        data-action="confirm"
  794.                                        title="{{ 'admin.common.move_to_confirm_message'|trans({
  795.                                            '%name%' : 'admin.product.tag_management'|trans }) }}">{{ 'admin.product.move_to_tag'|trans }}</a>
  796.                                 </div>
  797.                             </div>
  798.                         </div>
  799.                     </div>
  800.                     <div class="card rounded border-0 mb-4">
  801.                         <div class="card-header">
  802.                             <div class="row">
  803.                                 <div class="col-8">
  804.                                     <span class="card-title">{{ 'admin.product.create_date__card_title'|trans }}</span>
  805.                                 </div>
  806.                                 <div class="col-4 text-end">
  807.                                     <a data-bs-toggle="collapse" href="#update" aria-expanded="false"
  808.                                        aria-controls="update">
  809.                                         <i class="fa fa-angle-up fa-lg"></i>
  810.                                     </a>
  811.                                 </div>
  812.                             </div>
  813.                         </div>
  814.                         <div class="collapse show ec-cardCollapse" id="update">
  815.                             <div class="card-body">
  816.                                 <div class="row mb-2">
  817.                                     <div class="col">
  818.                                         <i class="fa fa-flag me-1"></i>
  819.                                         <span>{{ 'admin.common.create_date'|trans }}</span>
  820.                                     </div>
  821.                                     <div class="col">
  822.                                         <span>:{{ Product.create_date|date_min }}</span>
  823.                                     </div>
  824.                                 </div>
  825.                                 <div class="row mb-2">
  826.                                     <div class="col">
  827.                                         <i class="fa fa-refresh me-1"></i>
  828.                                         <span>{{ 'admin.common.update_date'|trans }}</span>
  829.                                     </div>
  830.                                     <div class="col">
  831.                                         <span>:{{ Product.update_date|date_min }}</span>
  832.                                     </div>
  833.                                 </div>
  834.                                 <div class="row mb-2">
  835.                                     <div class="col">
  836.                                         <i class="fa fa-user me-1"></i>
  837.                                         <span>{{ 'admin.common.last_updater'|trans }}</span>
  838.                                     </div>
  839.                                     <div class="col">
  840.                                         <span>:{{ Product.Creator ? Product.Creator.name }}</span>
  841.                                     </div>
  842.                                 </div>
  843.                             </div>
  844.                         </div>
  845.                     </div>
  846.                     <div class="card rounded border-0 mb-4">
  847.                         <div class="card-header">
  848.                             <div class="row">
  849.                                 <div class="col-8">
  850.                                     <div class="d-inline-block" data-bs-toggle="tooltip" data-bs-placement="top"
  851.                                          title="{{ 'tooltip.product.shop_memo'|trans }}">
  852.                                         <span class="card-title">
  853.                                             {{ 'admin.common.shop_memo'|trans }}
  854.                                             <i class="fa fa-question-circle fa-lg ms-1"></i>
  855.                                         </span>
  856.                                     </div>
  857.                                 </div>
  858.                                 <div class="col-4 text-end">
  859.                                     <a data-bs-toggle="collapse" href="#shopMemo" aria-expanded="false"
  860.                                        aria-controls="shopMemo">
  861.                                         <i class="fa fa-angle-up fa-lg"></i>
  862.                                     </a>
  863.                                 </div>
  864.                             </div>
  865.                         </div>
  866.                         <div class="collapse show ec-cardCollapse" id="shopMemo">
  867.                             <div class="card-body">
  868.                                 {{ form_widget(form.note, { attr : { rows : "8"} }) }}
  869.                                 {{ form_errors(form.note) }}
  870.                             </div>
  871.                         </div>
  872.                     </div>
  873.                 </div>
  874.             </div>
  875.         </div>
  876.         <div class="c-conversionArea">
  877.             <div class="c-conversionArea__container">
  878.                 <div class="row justify-content-between align-items-center">
  879.                     <div class="col-6">
  880.                         <div class="c-conversionArea__leftBlockItem">
  881.                             <a class="c-baseLink" href="{{ path('admin_product_page', { page_no : app.session.get('eccube.admin.product.search.page_no')|default('1') } ) }}"
  882.                                data-action="confirm" title="{{ 'admin.common.move_to_confirm_message'|trans({'%name%' : 'admin.product.product_list'|trans }) }}">
  883.                                 <i class="fa fa-backward" aria-hidden="true"></i><span>{{ 'admin.product.product_list'|trans }}</span>
  884.                             </a>
  885.                         </div>
  886.                     </div>
  887.                     <div class="col-6">
  888.                         <div id="ex-conversion-action" class="row align-items-center justify-content-end">
  889.                             <div class="col-auto">
  890.                                 {{ form_widget(form.Status) }}
  891.                                 {{ form_errors(form.Status) }}
  892.                             </div>
  893.                             <div class="col-auto">
  894.                                 <button class="btn btn-ec-conversion px-5" type="submit">{{ 'admin.common.registration'|trans }}</button>
  895.                             </div>
  896.                         </div>
  897.                     </div>
  898.                 </div>
  899.             </div>
  900.         </div>
  901.     </form>
  902. {% endblock %}