{% extends 'base.html.twig' %}
{% block title %}商品管理 商品一覧
{% endblock %}
{% block body %}
<h1>商品一覧 商品管理</h1>
<table class="table">
<thead>
<tr>
<th>{{product_id}}</th>
<th>{{product_image}}</th>
<th>{{product_creator_id}}</th>
{# 販売種別 #}
{# <th>{{product_status_id}}</th> #}
<th>{{product_name}}</th>
<th>{{product_note}}</th>
{# <th>Description_list</th> #}
<th>{{product_search_word}}</th>
<th>{{product_free_area}}</th>
{# <th>{{category_name}}</th> #}
{# <th>Free_area</th> #}
<th>{{product_create_date}}</th>
<th>{{product_update_date}}</th>
{# <th>Discriminator_type</th> #}
<th>{{product_supplier_code}}</th>
{# <th>actions</th> #}
</tr>
</thead>
<tbody>
{% for product in products %}
<tr>
<td>{{ product.id }}</td>
<td>
{# 商品画像に編集リンクを追加 #}
{% set images = product.getProductImages() %}
{% if images is not empty %}
<a href="{{ path('app_product_edit', {id: product.id}) }}">
<img src="{{ asset('uploads/eccube_images/' ~ images.first.getFileName()) }}" alt="{{ product.name }}" style="max-width: 50px;">
</a>
{% else %}
<a href="{{ path('app_product_edit', {id: product.id}) }}">
{{product_no_Image}}
</a>
{% endif %}
</td>
{# dtb_product.creator_id = dtb_member.id #}
<td>{{ product.Creator ? product.Creator.name : no_product_creator_name }}</td>
{# <td>{{ product.saleType.name }}</td> #}
<td>
<a href="{{ path('app_product_edit', {id: product.id}) }}" style="text-decoration: none;">
{{ product.name }}
</a>
</td>
<td>{{ product.note }}</td>
{# <td>{{ product.descriptionList }}</td> #}
<td>{{ product.searchWord }}</td>
<td>{{ product.freeArea }}</td>
{# <td>
{% for categoryName in product.getCategoryNames() %}
{{ categoryName }}
{% if not loop.last %},
{% endif %}
{% endfor %}
</td> #}
<td>{{ product.createDate ? product.createDate|date('Y/m/d H:i') : '' }}</td>
<td>{{ product.updateDate ? product.updateDate|date('Y/m/d H:i') : '' }}</td>
{# <td>{{ product.discriminatorType }}</td> #}
{# <td>{{ product.supplierCode }}</td> #}
{# <td> #}
{# <a href="{{ path('app_product_show', {'id': product.id}) }}">{{show_button_label}}</a> #}
{# <a href="{{ path('app_product_edit', {'id': product.id}) }}">edit</a> #}
{# <a href="{{ path('app_product_edit', {'id': product.id}) }}">{{edit_button_label}}</a> #}
{# </td> #}
</tr>
{% else %}
<tr>
<td colspan="13">no records found</td>
</tr>
{% endfor %}
</tbody>
</table>
<a href="{{ path('app_product_new') }}" class="btn">{{ button_label|default(new_product_button_label) }}</a>
{% endblock %}