feat: created product image model

This commit is contained in:
2025-02-18 15:54:02 +01:00
parent cdaeec468a
commit fe4b783658
27 changed files with 644 additions and 563 deletions
+2 -2
View File
@@ -15,9 +15,9 @@
<div class="space-y-4 flex items-center justify-between gap-6 space-y-0">
<a href="{% url 'web:product_detail' pk=item.product.pk slug=item.product.slug %}"
class="shrink-0 md:order-1">
<img class="h-20 w-20 dark:hidden" src="{{ item.product.images.all|first }}"
<img class="h-20 w-20 dark:hidden" src="{{ item.product.images.all.0.s.url }}"
alt="{{ item.product.name }}"/>
<img class="hidden h-20 w-20 dark:block" src="{{ item.product.images.all|first }}"
<img class="hidden h-20 w-20 dark:block" src="{{ item.product.images.all.0.s_dark.url }}"
alt="{{ item.product.name }}"/>
</a>
+2 -2
View File
@@ -4,9 +4,9 @@
class="card">
<div class="h-56 w-full">
<a href="{% url 'web:product_detail' pk=product.pk slug=product.slug %}">
<img class="mx-auto h-full dark:hidden" src="{{ product.images.all|first }}"
<img class="mx-auto h-full dark:hidden" src="{{ product.images.all.0.m.url }}"
alt="{{ product.name }}"/>
<img class="mx-auto hidden h-full dark:block" src="{{ product.images.all|first }}"
<img class="mx-auto hidden h-full dark:block" src="{{ product.images.all.0.m_dark.url }}"
alt="{{ product.name }}"/>
</a>
</div>