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>
+2 -2
View File
@@ -23,9 +23,9 @@
class="rounded-lg border border-gray-200 bg-white p-4 shadow-sm dark:border-gray-700 dark:bg-gray-800 md:p-6">
<div class="space-y-4 md:flex md:items-center md:justify-between md:gap-6 md:space-y-0">
<a href="#" 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>
+1 -1
View File
@@ -16,7 +16,7 @@
<sl-carousel-item>
<img
alt="{{ product.name }}"
src="{{ image.file.url }}"
src="{{ image.xl.url }}"
/>
</sl-carousel-item>
{% endfor %}