Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Add tables and cards to styleguide
weronkaaa7770b5cea9
diff --git a/saleor/static/scss/storefront/components/_breadcrumbs.scss b/saleor/static/scss/storefront/components/_breadcrumbs.scssindex c1ae3da394..5351abcd19 100644--- a/saleor/static/scss/storefront/components/_breadcrumbs.scss+++ b/saleor/static/scss/storefront/components/_breadcrumbs.scss@@ -1,5 +1,5 @@.breadcrumbs {- margin-bottom: 0;+ margin-bottom: $global-margin * 1.5;li {display: inline;&:not(:first-of-type) {diff --git a/saleor/static/scss/storefront/components/_cards.scss b/saleor/static/scss/storefront/components/_cards.scssnew file mode 100644index 0000000000..b916c5cc58--- /dev/null+++ b/saleor/static/scss/storefront/components/_cards.scss@@ -0,0 +1,55 @@+.card-deck {+ .card {+ width: 100%;+ border-radius: 3px;+ margin-bottom: $global-margin * 2;+ @include transition(background, 0.3s)+ &:hover {+ background: $light-gray;+ }+ @include media-breakpoint-down(sm) {+ width: 100%;+ display: inline-block;+ &:first-of-type {+ margin-bottom: $global-margin;+ }+ }+ p {+ margin-bottom: 0;+ }+ ul.icons {+ padding-left: 0;+ padding-top: $global-padding;+ list-style: none;+ margin-bottom: 0;+ li {+ width: 49%;+ display: inline-block;+ a {+ line-height: 18px;+ img {+ max-width: 18px;+ cursor: pointer;+ }+ }+ }+ }+ .none {+ display: none;+ }+ .address-delete {+ .cancel {+ line-height: 2rem;+ padding-right: $global-padding;+ cursor: pointer;+ color: $blue;+ &:hover {+ color: $blue;+ }+ }+ button {+ text-transform: uppercase;+ }+ }+ }+}\ No newline at end of filediff --git a/saleor/static/scss/storefront/components/_table.scss b/saleor/static/scss/storefront/components/_table.scssindex e69de29bb2..171adb3124 100644--- a/saleor/static/scss/storefront/components/_table.scss+++ b/saleor/static/scss/storefront/components/_table.scss@@ -0,0 +1,14 @@+.table {+ &__header {+ border-bottom: 1px solid $gray;+ padding-bottom: $global-padding / 2;+ small {+ color: $skull-gray;+ text-transform: uppercase;+ }+ }+ &__row {+ border-bottom: 1px solid $gray;+ padding: $global-padding 0;+ }+}diff --git a/saleor/static/scss/storefront/layouts/_cart.scss b/saleor/static/scss/storefront/layouts/_cart.scssindex 0ce07aac36..f733a98f51 100644--- a/saleor/static/scss/storefront/layouts/_cart.scss+++ b/saleor/static/scss/storefront/layouts/_cart.scss@@ -1,15 +1,8 @@.cart {h3 {- text-transform: uppercase;color: $skull-gray;}- &__table-header {- border-bottom: 1px solid $gray;- padding-bottom: $global-padding / 2;- }&__line {- padding: $global-padding / 2 0;- border-bottom: 1px solid $gray;&.last {border-bottom-color: $skull-gray;}@@ -17,9 +10,7 @@margin-top: $global-margin / 2;@include media-breakpoint-down(sm) {text-align: right;- p {margin-top: $global-margin * 2;- }}}&__product {diff --git a/saleor/static/scss/storefront/layouts/_category-page.scss b/saleor/static/scss/storefront/layouts/_category-page.scssindex ba20ba60a8..341a807311 100644--- a/saleor/static/scss/storefront/layouts/_category-page.scss+++ b/saleor/static/scss/storefront/layouts/_category-page.scss@@ -1,7 +1,10 @@#category-page {h2 {font-weight: bold;- padding-bottom: $global-padding/2;+ padding-bottom: $global-padding / 2;+ }+ .breadcrumbs {+ margin-bottom: 0;}.category-list {margin-top: $global-margin;@@ -19,4 +22,4 @@padding-top: $global-padding;}}-}\ No newline at end of file+}diff --git a/saleor/static/scss/storefront/layouts/_login.scss b/saleor/static/scss/storefront/layouts/_login.scssindex 1927987da7..b4a0333f76 100644--- a/saleor/static/scss/storefront/layouts/_login.scss+++ b/saleor/static/scss/storefront/layouts/_login.scss@@ -9,7 +9,6 @@text-align: center;}h3 {- text-transform: uppercase;margin-bottom: $global-margin * 2;}.btn {diff --git a/saleor/static/scss/storefront/layouts/_userprofile.scss b/saleor/static/scss/storefront/layouts/_userprofile.scssindex bdc09bf6c0..76c4f11769 100644--- a/saleor/static/scss/storefront/layouts/_userprofile.scss+++ b/saleor/static/scss/storefront/layouts/_userprofile.scss@@ -21,24 +21,6 @@&-empty {margin-top: $global-margin * 2;}- small {- text-decoration: underline;- color: $body-color;- }- &__row {- border-bottom: 1px solid $gray;- padding: $global-padding 0;- font-size: 0.9rem;- }- &-header {- border-bottom: 1px solid $gray;- padding-bottom: $global-padding/2;- h3 {- color: $skull-gray;- font-size: 0.8rem;- text-transform: uppercase;- }- }}&__password {margin-top: $global-margin * 2;@@ -52,61 +34,6 @@min-width: 100%;border-spacing: $global-margin;margin: 0;- .card-deck {- .card {- width: 100%;- border-radius: 3px;- margin-bottom: $global-margin * 2;- @include transition(background, 0.3s)- &:hover {- background: $light-gray;- }- @include media-breakpoint-down(sm) {- width: 100%;- display: inline-block;- &:first-of-type {- margin-bottom: $global-margin;- }- }- p {- margin-bottom: 0;- }- ul.icons {- padding-left: 0;- padding-top: $global-padding;- list-style: none;- margin-bottom: 0;- li {- width: 49%;- display: inline-block;- a {- line-height: 18px;- img {- max-width: 18px;- cursor: pointer;- }- }- }- }- .none {- display: none;- }- .address-delete {- .cancel {- line-height: 2rem;- padding-right: $global-padding;- cursor: pointer;- color: $blue;- &:hover {- color: $blue;- }- }- button {- text-transform: uppercase;- }- }- }- }}&__address-edit {h1 {diff --git a/saleor/static/scss/storefront/storefront.scss b/saleor/static/scss/storefront/storefront.scssindex 6dd2ea3401..183bf84f02 100644--- a/saleor/static/scss/storefront/storefront.scss+++ b/saleor/static/scss/storefront/storefront.scss@@ -25,3 +25,5 @@@import "components/variant-picker";@import "components/filters";@import "components/tabs";+@import "components/table";+@import "components/cards";diff --git a/templates/cart/index.html b/templates/cart/index.htmlindex fb10c34b77..c5a3e69ae9 100644--- a/templates/cart/index.html+++ b/templates/cart/index.html@@ -21,21 +21,21 @@</div><div class="cart">{% if cart_lines %}- <div class="cart__table-header hidden-sm-down">+ <div class="table__header hidden-sm-down"><div class="row"><div class="col-md-7">- <h3>{% trans "Product" context "Cart table header" %}</h3>+ <small>{% trans "Product" context "Cart table header" %}</small></div><div class="col-md-3">- <h3>{% trans "Quantity" context "Cart table header" %}</h3>+ <small>{% trans "Quantity" context "Cart table header" %}</small></div>- <div class="col-md-2">- <h3 class="text-right">{% trans "Price" context "Cart table header" %}</h3>+ <div class="col-md-2 text-right">+ <small>{% trans "Price" context "Cart table header" %}</small></div></div></div>{% for line in cart_lines %}- <div class="cart__line{% if forloop.last %} last{% endif %}">+ <div class="cart__line{% if forloop.last %} last{% endif %} table__row"><div class="row"><div class="col-7 cart__line__product"><a href="{{ line.variant.get_absolute_url }}">@@ -59,7 +59,7 @@<small class="cart__line__quantity-error text-danger"></small></div><div class="cart-item-subtotal col-md-5 col-12" data-product-id="{{ line.variant.pk }}">- <h3 class="text-right">{% gross line.get_total html=True %}</h3>+ <p class="text-right">{% gross line.get_total html=True %}</p></div></div></div>@@ -90,7 +90,7 @@</div></div></div>- <div class="cart__checkout row">+ <div class="row"><div class="col-md-12"><a href="{% url "checkout:login" %}" class="btn primary float-md-right">{% trans "Checkout" context "Cart primary action" %}diff --git a/templates/styleguide.html b/templates/styleguide.htmlindex f264b6960e..2a703ed0a0 100644--- a/templates/styleguide.html+++ b/templates/styleguide.html@@ -386,6 +386,100 @@</li></ul></div>+ <div id="table" class="styleguide__content__block">+ <h3 class="styleguide__content__block__title">{% trans "Tables" context "Tables title in style guide" %}</h3>+ <div class="table__header">+ <div class="row">+ <div class="col-md-2 col-3"><small>+ {% trans "Order" context "Recent orders column title" %}+ </small></div>+ <div class="col-md-4 hidden-sm-down"><small>+ {% trans "Date" context "Recent orders column title" %}+ </small></div>+ <div class="col-md-2 col-6 text-right"><small>+ {% trans "Summary" context "Recent orders column title" %}+ </small></div>+ <div class="col-md-3 hidden-sm-down"><small>+ {% trans "Status" context "Recent orders column title" %}+ </small></div>+ <div class="col-md-1 col-3"></div>+ </div>+ </div>+ <div class="table__row">+ <div class="row">+ <div class="col-md-2 col-3">+ #1+ </div>+ <div class="col-md-4 hidden-sm-down">+ {% now "F j, Y, H:i a" %}+ </div>+ <div class="col-md-2 col-6">+ <span class="float-md-right">$129.35</span>+ </div>+ <div class="col-md-3 hidden-sm-down">+ <span class="label label-default">Payment pending</span>+ </div>+ <div class="col-md-1 col-3">+ <a href="#" class="float-right link--styled">+ {% trans "Details" context "Recent orders link text" %}+ </a>+ </div>+ </div>+ </div>+ <div class="table__row">+ <div class="row">+ <div class="col-md-2 col-3">+ #2+ </div>+ <div class="col-md-4 hidden-sm-down">+ {% now "F j, Y, H:i a" %}+ </div>+ <div class="col-md-2 col-6">+ <span class="float-md-right">$129.35</span>+ </div>+ <div class="col-md-3 hidden-sm-down">+ <span class="label label-success">Fully paid</span>+ </div>+ <div class="col-md-1 col-3">+ <a href="#" class="float-right link--styled">+ {% trans "Details" context "Recent orders link text" %}+ </a>+ </div>+ </div>+ </div>+ </div>+ <div id="cards" class="styleguide__content__block">+ <h3 class="styleguide__content__block__title">{% trans "Cards" context "Cards title in style guide" %}</h3>+ <div class="row">+ <div class="card-deck col-md-6">+ <div class="card card-block">+ <div class="address-details">+ <p>Mr. Walter C. Brown<br>+ 49 Featherstone Street<br>+ London, EC1Y 8SY+ <br>+ United Kingdom<br>+ </p>+ </div>+ <ul class="icons">+ <li><a href="/profile/address/96/edit/">Edit</a></li>+ <li><a class="delete-icon"><img class="float-right" src="/static/images/icon_delete.svg"></a></li>+ </ul>+ <div class="address-delete none">+ <form method="post" novalidate="" action="/profile/address/96/delete/">+ <input type="hidden" name="csrfmiddlewaretoken" value="B8vX4dFwoOGcjdmRFS9zETaWJSJ2cy1ONwArWb5cDJT8aBVWFmcnjVDZpaeLD3bO">+ <button type="submit" class="btn danger narrow float-right">+ Delete Address+ </button>+ <a class="btn btn-link cancel float-right">+ Cancel+ </a>+ </form>+ </div>+ </div>+ </div>+ </div>+</div></div></div>diff --git a/templates/userprofile/details.html b/templates/userprofile/details.htmlindex f09b940317..07d03c1288 100644--- a/templates/userprofile/details.html+++ b/templates/userprofile/details.html@@ -43,26 +43,25 @@<div class="tab-pane active" id="orders" role="tabpanel"><div id="accordion" role="tablist" aria-multiselectable="true">{% if orders|length %}- <div class="userprofile__orders-header">+ <div class="table__header"><div class="row">- <div class="col-md-2 col-3"><h3>+ <div class="col-md-2 col-3"><small>{% trans "Order" context "Recent orders column title" %}- </h3></div>- <div class="col-md-3 hidden-sm-down"><h3>+ </small></div>+ <div class="col-md-3 hidden-sm-down"><small>{% trans "Date" context "Recent orders column title" %}- </h3></div>- <div class="col-md-2 col-6"><h3 class="float-md-right">+ </small></div>+ <div class="col-md-2 col-6 text-right"><small>{% trans "Summary" context "Recent orders column title" %}- </h3></div>- <div class="col-md-4 hidden-sm-down"><h3>+ </small></div>+ <div class="col-md-4 hidden-sm-down"><small>{% trans "Status" context "Recent orders column title" %}- </h3></div>+ </small></div><div class="col-md-1 col-3"></div></div></div>{% for order in orders %}- <div class="userprofile__orders">- <div class="userprofile__orders__row">+ <div class="table__row"><div class="row"><div class="col-md-2 col-3">{{ order }}@@ -83,7 +82,6 @@</div></div></div>- </div>{% endfor %}{% else %}<h3 class="text-sm-center userprofile__orders-empty">