Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Improve grid

dominik-zeglen822a5143256e
diff --git a/saleor/static/dashboard/scss/components/_product-gallery.scss b/saleor/static/dashboard/scss/components/_product-gallery.scss
index ce523f489a..87081ecca8 100644
--- a/saleor/static/dashboard/scss/components/_product-gallery.scss
+++ b/saleor/static/dashboard/scss/components/_product-gallery.scss
@@ -1,23 +1,7 @@
@mixin product-gallery {
margin: 0;
&-item {
- margin-left: $gutter-width * .66 !important;
- padding: 0;
- display: block;
position: relative;
- width: calc(100% - #{$gutter-width*3/2}) !important;
-
- @media (min-width: $small-screen-up) {
- width: calc(50% - #{$gutter-width * 0.9}) !important;
- }
-
- @media (min-width: $medium-screen-up) {
- width: calc(33.3% - #{$gutter-width * 0.9}) !important;
- }
-
- @media (min-width: $large-screen-up) {
- width: calc(25% - #{$gutter-width * 0.8}) !important;
- }
&-reorder {
position: absolute;
@@ -39,7 +23,7 @@
white-space: nowrap;
&--noclip {
- padding: 104px 0 103px;
+ padding: 104px 3rem 103px;
text-align: center;
white-space: normal;
}
diff --git a/templates/dashboard/product/product_image/list.html b/templates/dashboard/product/product_image/list.html
index 5925fae90d..1de15f58d1 100644
--- a/templates/dashboard/product/product_image/list.html
+++ b/templates/dashboard/product/product_image/list.html
@@ -55,35 +55,38 @@
<ul class="product-gallery" id="product-gallery" data-post-url="{% url 'dashboard:product-images-reorder' product_pk=product.pk %}">
{% if images %}
{% for image in images %}
- <li class="col s12 m3 product-gallery-item" data-id="{{ image.pk }}">
- <div class="row">
- <div class="card">
- <div class="card-image product-gallery-item-image">
- <img class="responsive-img"
- src="{{ image.image.crop.255x255 }}"
- srcset="{{ image.image.crop.255x255 }} 1x, {{ image.image.crop.510x510 }} 2x"
- alt="">
- </div>
- <div class="card-content">
- <span class="product-gallery-item-title card-title black-text" title="{{ image.alt }}">
- {% if image.alt %}
- {{ image.alt }}
- {% else %}
- <span class="grey-text">
- {% trans "No description" context "Image card text" %}
- </span>
- {% endif %}
- </span>
- </div>
- <div class="sortable__drag-area"></div>
- <div class="card-action">
- <a class="btn-flat waves-effect" href="{% url 'dashboard:product-image-update' product_pk=product.pk img_pk=image.pk %}">
- {% trans "Edit" context "Dashboard edit action" %}
- </a>
- <a href="#base-modal" class="btn-flat waves-effect modal-trigger-custom" data-href="{% url 'dashboard:product-image-delete' product_pk=product.pk img_pk=image.pk %}">
- {% trans "Remove" context "Dashboard remove action" %}
- </a>
- </div>
+ <li class="col s12 m6 l4 product-gallery-item"
+ data-id="{{ image.pk }}">
+ <div class="card">
+ <div class="card-image product-gallery-item-image">
+ <img class="responsive-img"
+ src="{{ image.image.crop.255x255 }}"
+ srcset="{{ image.image.crop.255x255 }} 1x, {{ image.image.crop.510x510 }} 2x"
+ alt="">
+ </div>
+ <div class="card-content">
+ <span class="product-gallery-item-title card-title black-text"
+ title="{{ image.alt }}">
+ {% if image.alt %}
+ {{ image.alt }}
+ {% else %}
+ <span class="grey-text">
+ {% trans "No description" context "Image card text" %}
+ </span>
+ {% endif %}
+ </span>
+ </div>
+ <div class="sortable__drag-area"></div>
+ <div class="card-action">
+ <a class="btn-flat waves-effect"
+ href="{% url 'dashboard:product-image-update' product_pk=product.pk img_pk=image.pk %}">
+ {% trans "Edit" context "Dashboard edit action" %}
+ </a>
+ <a href="#base-modal"
+ class="btn-flat waves-effect modal-trigger-custom"
+ data-href="{% url 'dashboard:product-image-delete' product_pk=product.pk img_pk=image.pk %}">
+ {% trans "Remove" context "Dashboard remove action" %}
+ </a>
</div>
</div>
</li>
@@ -92,7 +95,7 @@
<div class="sortable__drag-area"></div>
{% endif %}
</ul>
- <div class="col s6 m3 product-gallery-item dropzone-message">
+ <div class="col s12 m6 l4 product-gallery-item dropzone-message">
<div class="row">
<span class="product-gallery-item-title product-gallery-item-title--noclip card-title black-text">
<span class="grey-text hide-on-med-and-down">