Skip to content

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

Add product gallery example to style guide

weronkabf0ca8e75d62
diff --git a/saleor/static/images/sample-product2.jpg b/saleor/static/images/sample-product2.jpg
new file mode 100644
index 0000000000..aedf9d12b2
Binary files /dev/null and b/saleor/static/images/sample-product2.jpg differ
diff --git a/saleor/static/scss/storefront/components/_buttons.scss b/saleor/static/scss/storefront/components/_buttons.scss
index 4e86bdcf55..0ec1265d03 100644
--- a/saleor/static/scss/storefront/components/_buttons.scss
+++ b/saleor/static/scss/storefront/components/_buttons.scss
@@ -69,3 +69,7 @@ a.btn {
text-transform: none;
}
}
+
+button:focus {
+ outline: none;
+}
diff --git a/saleor/static/scss/storefront/components/_forms.scss b/saleor/static/scss/storefront/components/_forms.scss
index fd9d4e04ce..aa21cf5de3 100644
--- a/saleor/static/scss/storefront/components/_forms.scss
+++ b/saleor/static/scss/storefront/components/_forms.scss
@@ -136,6 +136,9 @@ input#id_quantity {
}
label {
margin-right: $global-margin;
+ span {
+ display: inline;
+ }
}
}
diff --git a/saleor/static/scss/storefront/layouts/_product-page.scss b/saleor/static/scss/storefront/layouts/_product-page.scss
index 7fc6227c15..e8fa98a0d0 100644
--- a/saleor/static/scss/storefront/layouts/_product-page.scss
+++ b/saleor/static/scss/storefront/layouts/_product-page.scss
@@ -59,6 +59,7 @@
}
}
.carousel-indicators {
+ position: relative;
top: 100%;
width: auto;
left: 0;
@@ -68,7 +69,9 @@
display: inline;
text-indent: 0;
margin: 0;
- min-width: 60px;
+ img {
+ width: 60px;
+ }
&.active {
img {
opacity: 0.5;
diff --git a/saleor/static/scss/storefront/layouts/_styleguide.scss b/saleor/static/scss/storefront/layouts/_styleguide.scss
index e5a047ba63..85052943aa 100644
--- a/saleor/static/scss/storefront/layouts/_styleguide.scss
+++ b/saleor/static/scss/storefront/layouts/_styleguide.scss
@@ -17,11 +17,14 @@
[contenteditable='true'] {
&:focus {
outline: none;
+ opacity: 0.9;
}
}
&__block {
padding-bottom: $global-padding * 3;
- border-bottom: 1px solid $skull-gray;
+ &:not(:last-of-type) {
+ border-bottom: 1px solid $skull-gray;
+ }
&__title {
padding-top: $global-padding;
margin-bottom: $global-margin * 2;
@@ -76,6 +79,7 @@
}
&--beige {
background-color: $beige;
+ border: 1px solid $gray;
}
}
&__grid {
diff --git a/templates/product/details.html b/templates/product/details.html
index cecf894640..73e1741c26 100644
--- a/templates/product/details.html
+++ b/templates/product/details.html
@@ -41,17 +41,6 @@
{% with images=product_images %}
{% if images %}
<div id="carousel-example-generic" class="carousel slide">
- <ol class="carousel-indicators hidden-sm-down">
- {% for image in images %}
- {% if images|length > 1 %}
- <li data-target="#carousel-example-generic" data-slide-to="{{ forloop.counter0 }}">
- <img src="{% get_thumbnail image.image method="crop" size="60x60" %}"
- srcset="{% get_thumbnail image.image method="crop" size="60x60" %} 1x, {% get_thumbnail image.image method="crop" size="120x1200" %} 2x"
- alt="">
- </li>
- {% endif %}
- {% endfor %}
- </ol>
<div class="carousel-inner" role="listbox">
{% for image in images %}
<div class="carousel-item{% if forloop.first %} active{% endif %}">
@@ -69,6 +58,15 @@
<img class="icon-next" src="{% static "images/gallery-arrow.svg" %}">
</a>
{% endif %}
+ <ol class="carousel-indicators hidden-sm-down">
+ {% for image in images %}
+ {% if images|length > 1 %}
+ <li data-target="#carousel-example-generic" data-slide-to="{{ forloop.counter0 }}">
+ <img src="{% get_thumbnail image.image method="crop" size="60x60" %}" alt="">
+ </li>
+ {% endif %}
+ {% endfor %}
+ </ol>
</div>
{% else %}
<img src="{% static 'images/placeholder540x540.png' %}"
diff --git a/templates/styleguide.html b/templates/styleguide.html
index 607c5e25f7..231b29a453 100644
--- a/templates/styleguide.html
+++ b/templates/styleguide.html
@@ -318,7 +318,7 @@
<li class="item"><label><input type="checkbox" name="box-size"><span contenteditable="true">100g</span></label></li>
<li class="item"><label><input type="checkbox" name="box-size"><span contenteditable="true">250g</span></label></li>
<li class="item"><label><input type="checkbox" name="box-size"><span contenteditable="true">500g</span></label></li>
- <li class="item"><label><input type="checkbox" name="box-size"><span contenteditable="true">feel free to place here as long option as you want</span></label></li>
+ <li class="item"><label><input type="checkbox" name="box-size"><span contenteditable="true">Feel free to place here as long option as you want</span></label></li>
</ul>
</div>
</div>
@@ -462,15 +462,15 @@
<div id="notifications" class="styleguide__content__block">
<h3 class="styleguide__content__block__title">Notifications <img src="{% static "images/text-cursor.svg" %}"></h3>
<div class="alert alert-success">
- <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
+ <button type="button" class="close" aria-hidden="true">&times;</button>
<span contenteditable="true">This is Success alert.</span>
</div>
<div class="alert alert-danger">
- <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
+ <button type="button" class="close" aria-hidden="true">&times;</button>
<span contenteditable="true">This is Danger alert.</span>
</div>
<div class="alert alert-warning">
- <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
+ <button type="button" class="close" aria-hidden="true">&times;</button>
<span contenteditable="true">This is Warning alert. Notifications content is not limited with container width. Place here as many information as you want or need to.</span>
</div>
</div>
@@ -636,7 +636,7 @@
<div class="col-6 col-lg-3 product-list">
<div class="text-center">
<div>
- <img class="img-responsive" src="{% static "images/sample-product.jpg" %}" alt="">
+ <img class="img-responsive" src="{% static "images/sample-product2.jpg" %}" alt="">
<span class="product-list-item-name" contenteditable="true">Johnson-Brown</span>
</div>
<div class="panel-footer">
@@ -649,6 +649,35 @@
</div>
</div>
</div>
+ <div id="product-gallery" class="styleguide__content__block">
+ <h3 class="styleguide__content__block__title">Product Gallery</h3>
+ <div class="col-md-6 col-12 product__gallery">
+ <div id="carousel-example-generic" class="carousel slide">
+ <div class="carousel-inner" role="listbox">
+ <div class="carousel-item active">
+ <img class="d-block img-fluid" src="{% static "images/sample-product.jpg" %}" alt="">
+ </div>
+ <div class="carousel-item">
+ <img class="d-block img-fluid" src="{% static "images/sample-product2.jpg" %}" alt="">
+ </div>
+ </div>
+ <a class="carousel-control-prev" href="#carousel-example-generic" role="button" data-slide="prev">
+ <img class="icon-next" src="{% static "images/gallery-arrow.svg" %}">
+ </a>
+ <a class="carousel-control-next" href="#carousel-example-generic" role="button" data-slide="next">
+ <img class="icon-next" src="{% static "images/gallery-arrow.svg" %}">
+ </a>
+ <ol class="carousel-indicators hidden-sm-down">
+ <li data-target="#carousel-example-generic" data-slide-to="0" class="active">
+ <img src="{% static "images/sample-product.jpg" %}" alt="">
+ </li>
+ <li data-target="#carousel-example-generic" data-slide-to="1" class="">
+ <img src="{% static "images/sample-product2.jpg" %}" alt="">
+ </li>
+ </ol>
+ </div>
+ </div>
+ </div>
</div>
</div>
{% endblock %}