Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Improve product page
dominik-zeglena3b0c9528e91
diff --git a/saleor/static/images/chevron-down.svg b/saleor/static/images/chevron-down.svgindex a8d3567c53..3ae8b304e3 100644--- a/saleor/static/images/chevron-down.svg+++ b/saleor/static/images/chevron-down.svg@@ -1,8 +1,3 @@-<?xml version="1.0" encoding="utf-8"?>-<!-- Generator: Adobe Illustrator 20.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->-<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"- viewBox="0 0 30 30" style="enable-background:new 0 0 30 30;" xml:space="preserve">-<path d="M29.2,10.6L15.8,24c-0.2,0.2-0.5,0.3-0.8,0.3s-0.6-0.1-0.8-0.3L0.8,10.6c-0.2-0.2-0.3-0.5-0.3-0.8S0.6,9.2,0.8,9l3-3- c0.2-0.2,0.5-0.3,0.8-0.3c0.3,0,0.6,0.1,0.8,0.3l9.6,9.6L24.6,6c0.2-0.2,0.5-0.3,0.8-0.3s0.6,0.1,0.8,0.3l3,3- c0.2,0.2,0.3,0.5,0.3,0.8S29.4,10.4,29.2,10.6z"/>+<svg width="8" height="6" viewBox="0 0 8 6" fill="none" xmlns="http://www.w3.org/2000/svg">+<path d="M4 6L0.535899 -6.52533e-07L7.4641 -4.68497e-08L4 6Z" fill="#333333"/></svg>diff --git a/saleor/static/images/chevron-up.svg b/saleor/static/images/chevron-up.svgindex 0afa31e2cd..ff63bd5a77 100644--- a/saleor/static/images/chevron-up.svg+++ b/saleor/static/images/chevron-up.svg@@ -1,8 +1,3 @@-<?xml version="1.0" encoding="utf-8"?>-<!-- Generator: Adobe Illustrator 20.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->-<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"- viewBox="0 0 30 30" style="enable-background:new 0 0 30 30;" xml:space="preserve">-<path d="M29.2,21l-3,3c-0.2,0.2-0.5,0.3-0.8,0.3s-0.6-0.1-0.8-0.3L15,14.4L5.4,24c-0.2,0.2-0.5,0.3-0.8,0.3c-0.3,0-0.6-0.1-0.8-0.3- l-3-3c-0.2-0.2-0.3-0.5-0.3-0.8c0-0.3,0.1-0.6,0.3-0.8L14.2,6c0.2-0.2,0.5-0.3,0.8-0.3s0.6,0.1,0.8,0.3l13.3,13.3- c0.2,0.2,0.3,0.5,0.3,0.8C29.5,20.5,29.4,20.8,29.2,21z"/>+<svg width="8" height="6" viewBox="0 0 8 6" fill="none" xmlns="http://www.w3.org/2000/svg">+<path d="M4 0L7.4641 6H0.535898L4 0Z" fill="#333333"/></svg>diff --git a/saleor/static/scss/components/_breadcrumbs.scss b/saleor/static/scss/components/_breadcrumbs.scssindex 81e33550de..a9b0c05fcb 100644--- a/saleor/static/scss/components/_breadcrumbs.scss+++ b/saleor/static/scss/components/_breadcrumbs.scss@@ -1,17 +1,22 @@.breadcrumbs {margin: $global-margin 0 $global-margin * 1.5;+ text-transform: uppercase;li {display: inline;&:not(:first-of-type) {+ a {+ color: $skull-gray;+ font-weight: 600;+ }margin-left: $global-margin / 3;}&:not(:last-of-type):after {- content: '/';+ content: "\\";display: inline-block;margin-left: $global-margin / 3;}a {- color: $body-color;+ color: $gray;}}}diff --git a/saleor/static/scss/components/_filters.scss b/saleor/static/scss/components/_filters.scssindex 540866ed48..c8a0992a61 100644--- a/saleor/static/scss/components/_filters.scss+++ b/saleor/static/scss/components/_filters.scss@@ -1,5 +1,8 @@.product-filters {padding-bottom: $global-padding * 2;+ .btn {+ padding: $global-padding;+ }.hide {display: none;}@@ -12,19 +15,20 @@}}&__content {- max-height: $global-padding * .5;+ max-height: $global-padding * 0.5;}}}&__header {+ border-bottom: 1px solid $gray;+ cursor: pointer;display: grid;grid-template-columns: calc(100% - 20px) 20px;- background: $light-gray;- padding: $global-padding;- cursor: pointer;+ margin-bottom: 0.5rem;+ padding-bottom: 0.5rem;h3 {font-weight: bold;- padding-right: $global-padding * .5;+ padding-right: $global-padding * 0.5;margin: 0;text-overflow: ellipsis;overflow: hidden;@@ -53,8 +57,8 @@justify-content: center;transition: $transition-base;img {- width: 20px;- height: 20px;+ width: 8px;+ height: 8px;}}}@@ -63,8 +67,9 @@list-style: none;margin-bottom: 0;li {- padding-left: $global-padding;input {+ position: relative;+ top: -2px;margin-right: $global-margin;}}@@ -82,19 +87,6 @@}}}- &__title {- @include media-breakpoint-down(sm) {- padding: $global-padding *2 0;- }- @media (max-width: 370px) {- padding-top: 5rem;- }- h2 {- font-size: 1.8rem;- color: $body-color;- padding-bottom: 0;- }- }&__categories {padding: $global-padding 0 0;@include media-breakpoint-down(sm) {@@ -169,12 +161,13 @@cursor: pointer;}.sort-by {- text-align: right;+ text-align: left;position: relative;- margin: 1rem 0 1rem 5rem;.btn-link {+ font-size: 14px;padding-right: $global-padding;color: $body-color;+ text-transform: uppercase;outline: 0;svg {vertical-align: baseline;@@ -190,7 +183,6 @@box-shadow: 3px 3px 3px 0px rgba($gray, 0.75);position: absolute;top: 2.5rem;- right: 0;z-index: 999;padding: $global-padding $global-padding * 2;li {@@ -254,6 +246,10 @@img {height: 10px;}+ svg {+ width: 8px;+ height: 8px;+ }}}diff --git a/saleor/static/scss/components/_forms.scss b/saleor/static/scss/components/_forms.scssindex f575753b62..2d8e95e0e5 100644--- a/saleor/static/scss/components/_forms.scss+++ b/saleor/static/scss/components/_forms.scss@@ -2,7 +2,7 @@select,input {color: $body-color;- border-radius: 2px;+ border-radius: 8px;border: 1px solid $gray;&:focus {color: $body-color;@@ -15,6 +15,18 @@ input {font-family: $font-family-sans-serif;font-weight: 300;}+ &[type="checkbox"] {+ -webkit-appearance: none;+ border-color: $turquoise;+ border-radius: 2px;+ cursor: pointer;+ height: 8px;+ transition-duration: 300ms;+ width: 8px;+ &:checked {+ background-color: $turquoise;+ }+ }}.form-group {diff --git a/saleor/static/scss/layouts/_product-list.scss b/saleor/static/scss/layouts/_product-list.scssindex adc652f63e..76562e2f15 100644--- a/saleor/static/scss/layouts/_product-list.scss+++ b/saleor/static/scss/layouts/_product-list.scss@@ -51,4 +51,18 @@font-weight: 500;}}+ &__header {+ @include media-breakpoint-down(sm) {+ padding: $global-padding * 2 0;+ }+ @media (max-width: 370px) {+ padding-top: 5rem;+ }+ h1 {+ font-size: 2.5rem;+ color: $body-color;+ padding-bottom: 0;+ text-align: left;+ }+ }}diff --git a/templates/base.html b/templates/base.htmlindex 86faac75fb..52e24ba2fb 100644--- a/templates/base.html+++ b/templates/base.html@@ -293,7 +293,7 @@<svg data-src="{% static "images/logo-document.svg" %}" height="38px" width="176px"/></a></div>- <div class="col-8 footer__copy-text">COPYRIGHT © 2009–2018 MIRUMEE SOFTWARE</div>+ <div class="col-8 footer__copy-text">COPYRIGHT © 2009–2019 MIRUMEE SOFTWARE</div></div></div></div>diff --git a/templates/product/_filters.html b/templates/product/_filters.htmlindex 90c874ab25..e1ff5f059f 100644--- a/templates/product/_filters.html+++ b/templates/product/_filters.html@@ -1,17 +1,8 @@{% load i18n %}{% load static %}-<div class="product-filters">- <div class="product-filters__title">- <h2>- <strong>{{ object.translated }}</strong>- </h2>- {% block title_tree %}{% endblock title_tree %}- </div>-</div><div class="filters-menu__body d-none d-md-block"><h2>- {% trans 'Filters' context 'Filter heading title' %}{% if filter_set.is_bound_unsorted %}<a href="./"><span class="clear-filters float-right">{% trans 'Clear filters' context 'Product list page filters' %}</span>@@ -67,7 +58,7 @@</div>{% endif %}{% endfor %}- <button class="btn primary" type="submit">{% trans 'Update' context 'Apply filters button' %}</button>+ <button class="btn btn-primary" type="submit">{% trans 'Update results' context 'Apply filters button' %}</button></form></div></div>diff --git a/templates/product/product_list_base.html b/templates/product/product_list_base.htmlindex 540192f5c4..308d8ca8e9 100644--- a/templates/product/product_list_base.html+++ b/templates/product/product_list_base.html@@ -52,64 +52,6 @@{% block breadcrumb_part %}{% endblock %}</ul></div>- <div class="col-md-5">- <h3 class="d-md-none float-left filters-toggle">- {% trans 'Filters' context 'Filter heading title' %}- </h3>- <div class="sort-by">- <div class="click-area d-none"></div>- <button class="btn btn-link">- <div>- <span>- {% if now_sorted_by == 'name' %}- {% blocktrans trimmed %}- Sort by: <b>name</b>- {% endblocktrans %}- {% elif now_sorted_by == 'price' %}- {% blocktrans trimmed %}- Sort by: <b>price</b>- {% endblocktrans %}- {% endif %}- </span>- <div class="sort-order-icon">- {% if is_descending %}- <svg data-src="{% static "images/arrow-down.svg" %}" />- {% else %}- <svg data-src="{% static "images/arrow-up.svg" %}" />- {% endif %}- </div>- </div>- </button>- <ul class="sort-list d-none">- {% for choice, label in sort_by_choices.items %}- <li>- <div class="row">- <div class="col-6">- {% trans 'Sort by' context 'Product list filters' %}:- <strong>{{ label }}</strong>- </div>- <div class="col-6">- <div>- <a href="{% get_sort_by_url choice %}">- <span>{% trans 'ascending' context 'sort by option' %}</span>- <div class="sort-order-icon float-right">- <img class="lazyload lazypreload" data-src="{% static "images/arrow-up.svg" %}">- </div>- </a>- <a href="{% get_sort_by_url choice descending=True %}">- <span>{% trans 'descending' context 'sort by option' %}</span>- <div class="sort-order-icon float-right">- <img class="lazyload lazypreload" data-src="{% static "images/arrow-down.svg" %}">- </div>- </a>- </div>- </div>- </div>- </li>- {% endfor %}- </ul>- </div>- </div></div>{% endblock %}@@ -121,39 +63,104 @@{% endblock topcontent %}{% block content %}-{% block collection_published_warning %}{% endblock %}-<div id="product-list-page"><div class="row"><div class="col-md-4 col-lg-3">{% block filters %}{% endblock filters %}</div><div class="col-md-8 col-lg-9 product-list">+ <div class="product-list__header">+ <div class="product-list__header__title">+ <h1>+ <strong>{{ object.translated }}</strong>+ </h1>+ {% block title_tree %}{% endblock title_tree %}+ </div>+ <hr /><div>+ <h3 class="d-md-none filters-toggle">+ {% trans 'Filters' context 'Filter heading title' %}+ </h3>+ <div class="sort-by">+ <div class="click-area d-none"></div>+ <button class="btn btn-link">+ <div>+ <span>+ {% if now_sorted_by == 'name' %}+ {% blocktrans trimmed %}+ Sort by: <b>name</b>+ {% endblocktrans %}+ {% elif now_sorted_by == 'price' %}+ {% blocktrans trimmed %}+ Sort by: <b>price</b>+ {% endblocktrans %}+ {% endif %}+ </span>+ <div class="sort-order-icon">+ {% if is_descending %}+ <svg data-src="{% static "images/chevron-down.svg" %}" />+ {% else %}+ <svg data-src="{% static "images/chevron-up.svg" %}" />+ {% endif %}+ </div>+ </div>+ </button>+ <ul class="sort-list d-none">+ {% for choice, label in sort_by_choices.items %}+ <li>+ <div class="row">+ <div class="col-6">+ {% trans 'Sort by' context 'Product list filters' %}:+ <strong>{{ label }}</strong>+ </div>+ <div class="col-6">+ <div>+ <a href="{% get_sort_by_url choice %}">+ <span>{% trans 'ascending' context 'sort by option' %}</span>+ <div class="sort-order-icon float-right">+ <img class="lazyload lazypreload" data-src="{% static "images/arrow-up.svg" %}">+ </div>+ </a>+ <a href="{% get_sort_by_url choice descending=True %}">+ <span>{% trans 'descending' context 'sort by option' %}</span>+ <div class="sort-order-icon float-right">+ <img class="lazyload lazypreload" data-src="{% static "images/arrow-down.svg" %}">+ </div>+ </a>+ </div>+ </div>+ </div>+ </li>+ {% endfor %}+ </ul>+ </div>+ </div><div>- {% if products %}- <div class="row">- {% include "product/_items.html" with products=products %}- </div>- <div class="row">- <div class="m-auto">- {% if products_paginated.has_other_pages %}- {% bootstrap_pagination products_paginated extra=request.GET.urlencode %}- {% endif %}+ <div>+ {% if products %}+ <div class="row">+ {% include "product/_items.html" with products=products %}</div>- </div>- {% else %}- <div class="row no-results">- <div class="col-12">- <svg data-src="{% static "images/no-results-bg.svg" %}"- width="360"- height="360" />- <p>{% trans "Sorry, no matches found for your request." context "Search without results text" %}</p>- <p>{% trans "Try again or shop new arrivals." context "Search without results text" %}</p>+ <div class="row">+ <div class="m-auto">+ {% if products_paginated.has_other_pages %}+ {% bootstrap_pagination products_paginated extra=request.GET.urlencode %}+ {% endif %}+ </div></div>- </div>- {% endif %}+ {% else %}+ <div class="row no-results">+ <div class="col-12">+ <svg data-src="{% static "images/no-results-bg.svg" %}"+ width="360"+ height="360" />+ <p>{% trans "Sorry, no matches found for your request." context "Search without results text" %}</p>+ <p>{% trans "Try again or shop new arrivals." context "Search without results text" %}</p>+ </div>+ </div>+ {% endif %}+ </div></div></div></div>