Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Fix address styles
Krzysztof Białogłowiczb34ec10ad4f0
diff --git a/saleor/static/images/icon_delete.svg b/saleor/static/images/icon_delete.svgindex 424cce7660..5374276847 100644--- a/saleor/static/images/icon_delete.svg+++ b/saleor/static/images/icon_delete.svg@@ -1,24 +1,19 @@-<svg width="15" height="22" viewBox="0 0 15 22" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:figma="http://www.figma.com/figma/ns">-<title>icon_trash_01</title>-<desc>Created using Figma</desc>-<g id="Canvas" transform="translate(-3786 1358)" figma:type="canvas">-<g id="icon_trash_01" style="mix-blend-mode:normal;" figma:type="frame">-<g id="Vector" style="mix-blend-mode:normal;" figma:type="vector">-<use xlink:href="#path0_fill" transform="translate(3786.5 -1354.98)" fill="#828282" style="mix-blend-mode:normal;"/>-</g>-<g id="Group" style="mix-blend-mode:normal;" figma:type="frame">-<g id="Vector" style="mix-blend-mode:normal;" figma:type="vector">-<use xlink:href="#path1_fill" transform="translate(3790.15 -1357.28)" fill="#828282" style="mix-blend-mode:normal;"/>-</g>-</g>-<g id="Vector" style="mix-blend-mode:normal;" figma:type="vector">-<use xlink:href="#path2_fill" transform="translate(3787.04 -1352.31)" fill="#828282" style="mix-blend-mode:normal;"/>-</g>-</g>-</g>-<defs>-<path id="path0_fill" d="M 14 0L 0 0L 0 2.03664L 14 2.03664L 14 0Z"/>-<path id="path1_fill" d="M 6.70048 3.56383L 5.7447 3.56383L 5.7447 2.03664C 5.7447 1.10638 5.00897 1.02246 4.78336 1.01891L 1.91379 1.01891C 1.03914 1.01891 0.96134 1.80142 0.956894 2.04019L 0.956894 3.56383L -5.51143e-08 3.56383L -5.51143e-08 2.03664C -5.51143e-08 1.21868 0.50901 -1.91637e-08 1.91379 -1.91637e-08L 4.7867 -1.91637e-08C 5.55577 -1.91637e-08 6.70048 0.541371 6.70048 2.03664L 6.70048 3.56383Z"/>-<path id="path2_fill" d="M 2.62853e-07 -1.80364e-08L 2.62853e-07 14.8913C 2.62853e-07 14.8913 1.32486e-07 16.0366 1.07692 16.0366L 11.8462 16.0366C 11.8462 16.0366 12.9231 16.0366 12.9231 14.8913L 12.9231 -1.80364e-08L 2.62853e-07 -1.80364e-08ZM 3.51417 13.9362C 3.51417 14.253 3.24966 14.5083 2.92403 14.5083C 2.5984 14.5083 2.33389 14.2518 2.33389 13.9362L 2.33389 2.10047C 2.33389 1.78369 2.5984 1.52719 2.92403 1.52719C 3.24966 1.52719 3.51417 1.78369 3.51417 2.10047L 3.51417 13.9362ZM 7.05057 13.9362C 7.05057 14.253 6.78717 14.5083 6.46154 14.5083C 6.13591 14.5083 5.87251 14.2518 5.87251 13.9362L 5.87251 2.10047C 5.87251 1.78369 6.13591 1.52719 6.46154 1.52719C 6.78717 1.52719 7.05057 1.78369 7.05057 2.10047L 7.05057 13.9362ZM 10.5903 13.9362C 10.5903 14.253 10.3258 14.5083 10.0024 14.5083C 9.67564 14.5083 9.41224 14.2518 9.41224 13.9362L 9.41224 2.10047C 9.41224 1.78369 9.67564 1.52719 10.0024 1.52719C 10.3258 1.52719 10.5903 1.78369 10.5903 2.10047L 10.5903 13.9362Z"/>-</defs>-</svg>+<?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 13.2 14.4" style="enable-background:new 0 0 13.2 14.4;" xml:space="preserve">+<style type="text/css">+ .st0{fill:#828282;}+</style>+<path class="st0" d="M13.2,2.7v0.6c0,0.1,0,0.2-0.1,0.2c-0.1,0.1-0.1,0.1-0.2,0.1H12v8.9c0,0.5-0.1,1-0.4,1.3+ c-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c-0.1,0-0.2,0-0.2-0.1+ c-0.1-0.1-0.1-0.1-0.1-0.2V5.7c0-0.1,0-0.2,0.1-0.2c0.1-0.1,0.1-0.1,0.2-0.1h0.6c0.1,0,0.2,0,0.2,0.1C9.6,5.6,9.6,5.6,9.6,5.7z"/>+</svg>diff --git a/saleor/static/js/storefront.js b/saleor/static/js/storefront.jsindex f3f4f1e32e..707afdec8e 100644--- a/saleor/static/js/storefront.js+++ b/saleor/static/js/storefront.js@@ -240,6 +240,28 @@ if (variantPickerContainer) {}}+// Account delete address bar++let $deleteAdressIcons = $('.icons');+let $deleteAdressIcon = $('.delete-icon');+let $deleteAddress = $('.address-delete');++ $deleteAdressIcon.on('click', (e) => {+ if ($deleteAddress.hasClass('none')) {+ $deleteAddress.removeClass('none');+ $deleteAdressIcons.addClass('none');+ } else {+ $deleteAddress.addClass('none');+ }+ });++ $deleteAddress.find('.cancel').on('click', (e) => {+ $deleteAddress.addClass('none');+ $deleteAdressIcons.removeClass('none');+ });+++// Cart quantity formlet $cartLine = $('.cart__line');diff --git a/saleor/static/scss/storefront/components/_userprofile.scss b/saleor/static/scss/storefront/components/_userprofile.scssindex e86a670494..66d5ec89cb 100644--- a/saleor/static/scss/storefront/components/_userprofile.scss+++ b/saleor/static/scss/storefront/components/_userprofile.scss@@ -106,7 +106,11 @@display: table-row;.card {width: 50%;- border-radius: 0;+ border-radius: 3px;+ @include transition(background, 0.3s)+ &:hover {+ background: $light-gray;+ }@include media-breakpoint-down(sm) {width: 100%;display: inline-block;@@ -114,10 +118,44 @@margin-bottom: $global-margin;}}- img {- position: absolute;- top: 1rem;- right: 1rem;+ 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;+ text-decoration: none;+ &:hover {+ color: $blue;+ text-decoration: underline;+ }+ }+ button {+ text-transform: uppercase;+ }}}}diff --git a/templates/userprofile/address-delete.html b/templates/userprofile/address-delete.htmlindex 288c6a70ac..1a17134eb3 100644--- a/templates/userprofile/address-delete.html+++ b/templates/userprofile/address-delete.html@@ -1,21 +1,8 @@{% load i18n %}--<div class="modal fade modal-address-delete" tabindex="-1" role="dialog" aria-hidden="true">- <div class="modal-dialog">- <div class="modal-content">- <div class="modal-header">- <h3 class="text-xs-center">{% trans "Are you sure you want to delete the following address?" %}</h3>- </div>- <div class="modal-body text-xs-center">- <address>{% include "userprofile/snippets/address-short.html" with address=address %}</address>- </div>- <div class="modal-footer">- <form method="post" novalidate action="{% url 'profile:address-delete' pk=address.pk %}">- {% csrf_token %}- <a class="btn btn-link" data-dismiss="modal">{% trans "Cancel" %}</a>- <button type="submit" class="btn danger">{% trans "Delete" %}</button>- </form>- </div>- </div>- </div>+<div class="address-delete none">+ <form method="post" novalidate action="{% url 'profile:address-delete' pk=address.pk %}">+ {% csrf_token %}+ <button type="submit" class="btn btn-outline-danger float-right">{% trans "Delete Address" %}</button>+ <a class="btn btn-link cancel float-right">{% trans "Cancel" %}</a>+ </form></div>\ No newline at end of filediff --git a/templates/userprofile/details.html b/templates/userprofile/details.htmlindex 1fe428ec0d..81da889c71 100644--- a/templates/userprofile/details.html+++ b/templates/userprofile/details.html@@ -88,9 +88,11 @@{% 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 'images/icon_delete.svg' %}"></a>+ <ul class="icons">+ <li><a href="{% url "profile:address-edit" pk=address.pk %}">{% trans "Edit" %}</a></li>+ <li><a class="delete-icon"><img class="float-right" src="{% static 'images/icon_delete.svg' %}"></a></li>+ </ul>{% include "userprofile/address-delete.html" with pk=address.pk %}- <a href="{% url "profile:address-edit" pk=address.pk %}"><img src="{% static 'images/icon_edit.svg' %}"></a></div>{% if forloop.counter|divisibleby:2 %}</div>diff --git a/templates/userprofile/snippets/address-short.html b/templates/userprofile/snippets/address-short.htmlindex df0af89642..79132e6401 100644--- a/templates/userprofile/snippets/address-short.html+++ b/templates/userprofile/snippets/address-short.html@@ -1,23 +1,20 @@-<span class="address-details"- data-content="{% if address.company_name %}{{ address.company_name }}<br>{% endif %}+<div class="address-details" data-content="{% if address.company_name %}{{ address.company_name }}<br>{% endif %}{{ address.street_address_1 }}<br>{% if address.street_address_2 %}- {{ address.street_address_2 }}<br>+ {{ address.street_address_2 }}<br>{% endif %}{{ address.postal_code }} {{ address.city }}<br>{% if address.country_area %}{{ address.country_area }}, {% endif %}{{ address.get_country_display }}<br>{{ address.phone }}"data-html="true" title="{{ address.first_name }} {{ address.last_name }}">- {{ address.first_name }} {{ address.last_name }}<br>- {% if address.company_name %}{{ address.company_name }}<br>{% endif %}- {{ address.street_address_1 }}<br>- {% if address.street_address_2 %}- {{ address.street_address_2 }}<br>- {% endif %}- {{ address.postal_code }} {{ address.city }}<br>- {% if address.country_area %}+ <p>{{ address.first_name }} {{ address.last_name }}{% if address.company_name %}, {{ address.company_name }}{% endif %}</p>+ <p>{{ address.street_address_1 }} {% if address.street_address_2 %}+ {{ address.street_address_2 }}, {{ address.postal_code }} {{ address.city }}+ {% endif %}</p>+ <p>{% if address.country_area %}{{ address.country_area }},- {% endif %}- {{ address.get_country_display }}<br>- {{ address.phone }}-</span>+ {% endif %}</p>+ <p>{{ address.get_country_display }}</p>+ <p>{{ address.phone }}</p>+</div>+