Skip to content

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

Wrap lines using CSS

Artur Smęt218752655c47
diff --git a/saleor/static/scss/dashboard.scss b/saleor/static/scss/dashboard.scss
index 94efd0d3cc..87ce2e3abe 100644
--- a/saleor/static/scss/dashboard.scss
+++ b/saleor/static/scss/dashboard.scss
@@ -149,7 +149,7 @@ $roboto-font-path: "~materialize-css/fonts/roboto/";
.data-table-container {
overflow: auto;
- table {
+ table {
.row {
.col {
float: none;
@@ -284,6 +284,10 @@ $roboto-font-path: "~materialize-css/fonts/roboto/";
font-feature-settings: 'liga';
}
+.formatted-address {
+ white-space: pre-wrap;
+}
+
@import "widget/breadcrumbs";
@import "widget/card";
@import "widget/data-table";
diff --git a/saleor/userprofile/templatetags/i18n_address_tags.py b/saleor/userprofile/templatetags/i18n_address_tags.py
index 279a25c9d7..a3d8d305a4 100644
--- a/saleor/userprofile/templatetags/i18n_address_tags.py
+++ b/saleor/userprofile/templatetags/i18n_address_tags.py
@@ -14,5 +14,4 @@ def format_address(address, latin=False):
address_data['street_address'] = ('%(street_address_1)s\n'
'%(street_address_2)s' % address_data)
formatted_address = i18naddress.format_address(address_data, latin)
- formatted_address = formatted_address.replace('\n', '<br>')
return mark_safe(formatted_address)
diff --git a/templates/dashboard/includes/_address.html b/templates/dashboard/includes/_address.html
index 4da82cfd0a..7808689498 100644
--- a/templates/dashboard/includes/_address.html
+++ b/templates/dashboard/includes/_address.html
@@ -1,7 +1,6 @@
{% load format_address from i18n_address_tags %}
<div class="address">
- {% format_address address latin=True %}
-
+ <div class="formatted-address">{% format_address address latin=True %}</div>
{% if address.phone %}
<div><i class="material-icons">contact_phone</i> <a href="tel:{{ address.phone }}">{{ address.phone }}</a></div>
{% endif %}