src/Eccube/Resource/template/admin/Product/csv_category.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', 'category_csv_import'] %}
  10. {% block title %}{{ 'admin.product.category_csv_upload'|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.         $(function() {
  16.             var opts = {
  17.                 lines: 13,
  18.                 length: 30,
  19.                 width: 2,
  20.                 radius: 12,
  21.                 corners: 1,
  22.                 rotate: 0,
  23.                 direction: 1,
  24.                 color: '#BBB',
  25.                 speed: 1,
  26.                 trail: 67,
  27.                 shadow: true,
  28.                 hwaccel: false,
  29.                 className: 'spinner',
  30.                 zIndex: 2e9,
  31.                 top: top
  32.             };
  33.             ImageSpinner = new Spinner(opts).spin(document.getElementById('spinner'));
  34.             ImageSpinner.stop();
  35.             $('#upload-form').submit(function() {
  36.                 $('#upload-button').attr('disabled', 'disabled');
  37.                 $('#download-button').attr('disabled', 'disabled');
  38.                 ImageSpinner.spin(document.getElementById('spinner'));
  39.             });
  40.             $('#file-select').click(function() {
  41.                 $('#admin_csv_import_import_file').click();
  42.                 $('#admin_csv_import_import_file').on('change', function() {
  43.                     var files = $(this).prop('files');
  44.                     if (files.length) {
  45.                         $('#admin_csv_import_import_file_name').text(files[0].name);
  46.                     }
  47.                 });
  48.             });
  49.         });
  50.     </script>
  51. {% endblock javascript %}
  52. {% block main %}
  53.     <div class="c-contentsArea__cols">
  54.         <div class="c-contentsArea__primaryCol">
  55.             <div class="c-primaryCol">
  56.                 <div class="card rounded border-0 mb-4">
  57.                     <div class="card-header">
  58.                         <div class="d-inline-block" data-bs-toggle="tooltip" data-bs-placement="top" title="{{ 'tooltip.category.csv_upload'|trans }}"><span>{{ 'admin.common.csv_upload'|trans }}</span><i class="fa fa-question-circle fa-lg fa-lg ms-1"></i></div>
  59.                     </div>
  60.                     <div id="ex-csv_category-upload" class="card-body">
  61.                         <div class="row">
  62.                             <div class="col-2"><span>{{ 'admin.common.csv_select'|trans }}</span></div>
  63.                             <div class="col">
  64.                                 <form id="upload-form" method="post" action="{{ url('admin_product_category_csv_import') }}" enctype="multipart/form-data">
  65.                                     {{ form_widget(form._token) }}
  66.                                     <div class="mb-2">
  67.                                         <span id="file-select" class="btn btn-ec-regular me-2">{{ 'admin.common.file_select'|trans }}</span>
  68.                                         <span id="admin_csv_import_import_file_name">{{ 'admin.common.file_select_empty'|trans }}</span>
  69.                                         {{ form_widget(form.import_file, {'attr': {'accept': 'text/csv,text/tsv', 'class': 'd-none'}}) }}
  70.                                         {{ form_errors(form.import_file) }}
  71.                                     </div>
  72.                                     <button class="btn btn-ec-conversion" id="upload-button" type="submit">{{ 'admin.common.bulk_registration'|trans }}</button>
  73.                                     {% for error in errors %}
  74.                                         <div class="text-danger">{{ error }}</div>
  75.                                     {% endfor %}
  76.                                 </form>
  77.                             </div>
  78.                         </div>
  79.                         <div id="spinner"></div>
  80.                     </div>
  81.                 </div>
  82.                 <div class="card rounded border-0 mb-4">
  83.                     <div class="card-header">
  84.                         <div class="row justify-content-between">
  85.                             <div class="col-6">
  86.                                 <div class="d-inline-block" data-bs-toggle="tooltip" data-bs-placement="top" title="{{ 'tooltip.category.csv_format'|trans }}"><span class="align-middle">{{ 'admin.common.csv_format'|trans }}</span><i class="fa fa-question-circle fa-lg fa-lg ms-1"></i></div>
  87.                             </div>
  88.                             <div class="col-4 text-end">
  89.                                 <a href="{{ url('admin_product_csv_template', {'type': 'category'}) }}" class="btn btn-ec-regular" id="download-button">{{ 'admin.common.csv_skeleton_download'|trans }}</a>
  90.                             </div>
  91.                         </div>
  92.                     </div>
  93.                     <div id="ex-csv_category-format" class="card-body">
  94.                         <table class="table table-striped table-bordered">
  95.                             <tbody>
  96.                             {% for header, key in headers %}
  97.                                 <tr>
  98.                                     <th class="w-25 align-middle table-ec-lightGray" id="file_format_box__header--{{ loop.index }}">{{ header }}
  99.                                         {% if key.required %}
  100.                                             <span class="badge bg-primary ms-1">{{ 'admin.common.required'|trans }}</span>
  101.                                         {% endif %}
  102.                                     </th>
  103.                                     <td class="align-middle">
  104.                                         {% if key.description %}
  105.                                             {{ key.description|trans }}
  106.                                         {% endif %}
  107.                                     </td>
  108.                                 </tr>
  109.                             {% endfor %}
  110.                             </tbody>
  111.                         </table>
  112.                     </div>
  113.                 </div>
  114.             </div>
  115.         </div>
  116.     </div>
  117. {% endblock %}