Add kit binding display in ConfigurableKitProduct templates
Updated UI to show ProductKit associations for attribute values: - configurablekit_detail.html: * Added 'Комплект' column to attributes table * Shows linked ProductKit as clickable badge * Shows '—' for unbound attributes - configurablekit_list.html: * Added 'Атрибутов' column showing attribute count * Updated colspan for empty state message (6->7) Now users can see which ProductKit each attribute value is bound to in: 1. Detail view: Click product -> view attributes with kit bindings 2. List view: See total attribute count for each product 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -139,6 +139,7 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<th>Название атрибута</th>
|
<th>Название атрибута</th>
|
||||||
<th>Значение опции</th>
|
<th>Значение опции</th>
|
||||||
|
<th>Комплект</th>
|
||||||
<th>Порядок</th>
|
<th>Порядок</th>
|
||||||
<th>Видимый</th>
|
<th>Видимый</th>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -148,6 +149,15 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td><strong>{{ attr.name }}</strong></td>
|
<td><strong>{{ attr.name }}</strong></td>
|
||||||
<td>{{ attr.option }}</td>
|
<td>{{ attr.option }}</td>
|
||||||
|
<td>
|
||||||
|
{% if attr.kit %}
|
||||||
|
<a href="{% url 'products:productkit-detail' attr.kit.pk %}" class="text-decoration-none badge bg-info text-dark">
|
||||||
|
{{ attr.kit.name }}
|
||||||
|
</a>
|
||||||
|
{% else %}
|
||||||
|
<span class="badge bg-secondary">—</span>
|
||||||
|
{% endif %}
|
||||||
|
</td>
|
||||||
<td><span class="badge bg-secondary">{{ attr.position }}</span></td>
|
<td><span class="badge bg-secondary">{{ attr.position }}</span></td>
|
||||||
<td>
|
<td>
|
||||||
{% if attr.visible %}
|
{% if attr.visible %}
|
||||||
|
|||||||
@@ -59,6 +59,7 @@
|
|||||||
<th>Артикул</th>
|
<th>Артикул</th>
|
||||||
<th style="width: 120px;">Статус</th>
|
<th style="width: 120px;">Статус</th>
|
||||||
<th style="width: 100px;">Вариантов</th>
|
<th style="width: 100px;">Вариантов</th>
|
||||||
|
<th style="width: 120px;">Атрибутов</th>
|
||||||
<th style="width: 150px;">Дата создания</th>
|
<th style="width: 150px;">Дата создания</th>
|
||||||
<th style="width: 180px;">Действия</th>
|
<th style="width: 180px;">Действия</th>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -86,6 +87,9 @@
|
|||||||
<td class="text-center">
|
<td class="text-center">
|
||||||
<span class="badge bg-info">{{ item.options.count }}</span>
|
<span class="badge bg-info">{{ item.options.count }}</span>
|
||||||
</td>
|
</td>
|
||||||
|
<td class="text-center">
|
||||||
|
<span class="badge bg-secondary">{{ item.parent_attributes.count }}</span>
|
||||||
|
</td>
|
||||||
<td><small class="text-muted">{{ item.created_at|date:"d.m.Y H:i" }}</small></td>
|
<td><small class="text-muted">{{ item.created_at|date:"d.m.Y H:i" }}</small></td>
|
||||||
<td>
|
<td>
|
||||||
<a href="{% url 'products:configurablekit-detail' item.pk %}"
|
<a href="{% url 'products:configurablekit-detail' item.pk %}"
|
||||||
@@ -104,7 +108,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
{% empty %}
|
{% empty %}
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="6" class="text-center text-muted py-4">
|
<td colspan="7" class="text-center text-muted py-4">
|
||||||
Нет вариативных товаров. <a href="{% url 'products:configurablekit-create' %}">Создать первый</a>
|
Нет вариативных товаров. <a href="{% url 'products:configurablekit-create' %}">Создать первый</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
Reference in New Issue
Block a user