templates/product/index.html.twig line 1

Open in your IDE?
  1. {% extends 'base.html.twig' %}
  2. {% block title %}商品管理 商品一覧
  3. {% endblock %}
  4. {% block body %}
  5.     <h1>商品一覧 商品管理</h1>
  6.     <table class="table">
  7.         <thead>
  8.             <tr>
  9.                 <th>{{product_id}}</th>
  10.                 <th>{{product_image}}</th>
  11.                 <th>{{product_creator_id}}</th>
  12.                 {# 販売種別 #}
  13.                 {# <th>{{product_status_id}}</th> #}
  14.                 <th>{{product_name}}</th>
  15.                 <th>{{product_note}}</th>
  16.                 {# <th>Description_list</th> #}
  17.                 <th>{{product_search_word}}</th>
  18.                 <th>{{product_free_area}}</th>
  19.                 {# <th>{{category_name}}</th> #}
  20.                 {# <th>Free_area</th> #}
  21.                 <th>{{product_create_date}}</th>
  22.                 <th>{{product_update_date}}</th>
  23.                 {# <th>Discriminator_type</th> #}
  24.                 <th>{{product_supplier_code}}</th>
  25.                 {# <th>actions</th> #}
  26.             </tr>
  27.         </thead>
  28.         <tbody>
  29.             {% for product in products %}
  30.                 <tr>
  31.                     <td>{{ product.id }}</td>
  32.                     <td>
  33.                         {# 商品画像に編集リンクを追加 #}
  34.                         {% set images = product.getProductImages() %}
  35.                         {% if images is not empty %}
  36.                             <a href="{{ path('app_product_edit', {id: product.id}) }}">
  37.                                 <img src="{{ asset('uploads/eccube_images/' ~ images.first.getFileName()) }}" alt="{{ product.name }}" style="max-width: 50px;">
  38.                             </a>
  39.                         {% else %}
  40.                             <a href="{{ path('app_product_edit', {id: product.id}) }}">
  41.                                 {{product_no_Image}}
  42.                             </a>
  43.                         {% endif %}
  44.                     </td>
  45.                     {# dtb_product.creator_id = dtb_member.id #}
  46.                     <td>{{ product.Creator ? product.Creator.name : no_product_creator_name }}</td>
  47.                     {# <td>{{ product.saleType.name }}</td> #}
  48.                     <td>
  49.                         <a href="{{ path('app_product_edit', {id: product.id}) }}" style="text-decoration: none;">
  50.                             {{ product.name }}
  51.                         </a>
  52.                     </td>
  53.                     <td>{{ product.note }}</td>
  54.                     {# <td>{{ product.descriptionList }}</td> #}
  55.                     <td>{{ product.searchWord }}</td>
  56.                     <td>{{ product.freeArea }}</td>
  57.                     {# <td>
  58.                         {% for categoryName in product.getCategoryNames() %}
  59.                             {{ categoryName }}
  60.                             {% if not loop.last %},
  61.                             {% endif %}
  62.                         {% endfor %}
  63.                     </td> #}
  64.                     <td>{{ product.createDate ? product.createDate|date('Y/m/d H:i') : '' }}</td>
  65.                     <td>{{ product.updateDate ? product.updateDate|date('Y/m/d H:i') : '' }}</td>
  66.                     {# <td>{{ product.discriminatorType }}</td> #}
  67.                     {# <td>{{ product.supplierCode }}</td> #}
  68.                     {# <td> #}
  69.                         {# <a href="{{ path('app_product_show', {'id': product.id}) }}">{{show_button_label}}</a> #}
  70.                         {# <a href="{{ path('app_product_edit', {'id': product.id}) }}">edit</a> #}
  71.                         {# <a href="{{ path('app_product_edit', {'id': product.id}) }}">{{edit_button_label}}</a> #}
  72.                     {# </td> #}
  73.                 </tr>
  74.             {% else %}
  75.                 <tr>
  76.                     <td colspan="13">no records found</td>
  77.                 </tr>
  78.             {% endfor %}
  79.         </tbody>
  80.     </table>
  81.     <a href="{{ path('app_product_new') }}" class="btn">{{ button_label|default(new_product_button_label) }}</a>
  82. {% endblock %}