Skip to content

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

Use bootstrap cards for addresses grid

weronka8788e76ec6e2
diff --git a/saleor/static/scss/storefront/components/_userprofile.scss b/saleor/static/scss/storefront/components/_userprofile.scss
index 38a0cd5ffd..6b79ceceea 100644
--- a/saleor/static/scss/storefront/components/_userprofile.scss
+++ b/saleor/static/scss/storefront/components/_userprofile.scss
@@ -36,14 +36,21 @@
&__address-empty {
margin: $global-margin 0 $global-margin * 2;
}
- &__address-row {
- &__item {
- border: 1px solid $light-gray;
- padding: $global-padding;
- img {
- position: absolute;
- top: 1rem;
- right: 2rem;
+ &__addresses {
+ display: table;
+ min-width: 100%;
+ border-spacing: $global-margin;
+ margin: 0;
+ .card-deck {
+ display: table-row;
+ .card {
+ width: 30%;
+ border-radius: 0;
+ img {
+ position: absolute;
+ top: 1rem;
+ right: 1rem;
+ }
}
}
}
diff --git a/templates/userprofile/details.html b/templates/userprofile/details.html
index d8c5853b17..8c8db56414 100644
--- a/templates/userprofile/details.html
+++ b/templates/userprofile/details.html
@@ -67,22 +67,21 @@
</div>
<div class="tab-pane" id="addresses" role="tabpanel">
- {% for address in addresses %}
- <div class="row userprofile__address-row">
- <div class="col-md-4">
- <div class="userprofile__address-row__item">
+ <div class="card-deck-wrapper userprofile__addresses">
+ <div class="card-deck">
+ {% for address in addresses %}
+ <div class="card card-block">
{% include "userprofile/snippets/address-short.html" %}
<a data-toggle="modal" data-target=".modal-address-delete"><img src="{% static 'img/icon_delete.svg' %}"></a>
- </div>
- </div>
- </div>
- {% include "userprofile/address-delete.html" with pk=address.pk %}
- {% endfor %}
- {% if addresses|length == 0 %}
- <div class="userprofile__address-empty">
- <p></p>
+ {% include "userprofile/address-delete.html" with pk=address.pk %}
+ </div>
+ {% if forloop.counter|divisibleby:3 %}
+ </div>
+ <div class="card-deck">
+ {% endif %}
+ {% endfor %}
</div>
- {% endif %}
+ </div>
</div>
</div>
</div>