Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Move shorthand version of the adddress to a snippet
Patryk Zawadzkief650faf9aa8
diff --git a/saleor/checkout/templates/checkout/summary.html b/saleor/checkout/templates/checkout/summary.htmlindex f19f67ff06..fa429d1203 100644--- a/saleor/checkout/templates/checkout/summary.html+++ b/saleor/checkout/templates/checkout/summary.html@@ -37,14 +37,7 @@<p>{{ group.email }}</p>{% elif group.address %}<p>- <a class="address-details" href="#"- data-content="{% if group.address.company_name %}{{ group.address.company_name }}<br>{% endif %}- {{ group.address.street_address_1 }}<br>- {% if group.address.street_address_2 %}{{ group.address.street_address_2 }}<br>{% endif %}- {{ group.address.postal_code }} {{ group.address.city }}<br>- {% if group.address.country_area %}{{ group.address.country_area }}, {% endif %}{{ group.address.get_country_display }}<br>- {{ group.address.phone }}"- data-html="true" title="{{ group.address.first_name }} {{ group.address.last_name }}">{{ group.address }}</a>+ {% include "userprofile/snippets/address-short.html" with address=group.address %}</p>{% endif %}</td>diff --git a/saleor/order/templates/order/details.html b/saleor/order/templates/order/details.htmlindex 83b455861a..ed71ec6209 100644--- a/saleor/order/templates/order/details.html+++ b/saleor/order/templates/order/details.html@@ -57,16 +57,9 @@{% if order.user == user %}{% if group.email %}<p>{{ group.email }}</p>- {% elif group.address %}+ {% elif group.address %}<p>- <a class="address-details" href="#"- data-content="{% if group.address.company_name %}{{ group.address.company_name }}<br>{% endif %}- {{ group.address.street_address_1 }}<br>- {% if group.address.street_address_2 %}{{ group.address.street_address_2 }}<br>{% endif %}- {{ group.address.postal_code }} {{ group.address.city }}<br>- {% if group.address.country_area %}{{ group.address.country_area }}, {% endif %}{{ group.address.get_country_display }}<br>- {{ group.address.phone }}"- data-html="true" title="{{ group.address.first_name }} {{ group.address.last_name }}">{{ group.address }}</a>+ {% include "userprofile/snippets/address-short.html" with address=group.address %}</p>{% endif %}<p>{% trans "Status" %}: <span class="label label-default">{{ group.get_status_display }}</span></p>diff --git a/saleor/userprofile/templates/userprofile/snippets/address-details.html b/saleor/userprofile/templates/userprofile/snippets/address-details.htmlindex 5ad72ee701..3de6c6f574 100644--- a/saleor/userprofile/templates/userprofile/snippets/address-details.html+++ b/saleor/userprofile/templates/userprofile/snippets/address-details.html@@ -1,10 +1,10 @@<address>- <strong>{{ address.first_name }} {{ address.last_name }}</strong>- <br>{{ address.street_address_1 }}+ <strong>{{ address.first_name }} {{ address.last_name }}</strong><br>+ {{ address.street_address_1 }}<br>{% if address.street_address_2 %}- <br>{{ address.street_address_2 }}+ {{ address.street_address_2 }}<br>{% endif %}- <br>{{ address.postal_code }} {{ address.city }}- <br>{% if address.country_area %}{{ address.country_area }}, {% endif %}{{ address.get_country_display }}- <br>{{ address.phone }}+ {{ address.postal_code }} {{ address.city }}<br>+ {% if address.country_area %}{{ address.country_area }}, {% endif %}{{ address.get_country_display }}<br>+ {{ address.phone }}</address>diff --git a/saleor/userprofile/templates/userprofile/snippets/address-short.html b/saleor/userprofile/templates/userprofile/snippets/address-short.htmlnew file mode 100644index 0000000000..398b3e2d38--- /dev/null+++ b/saleor/userprofile/templates/userprofile/snippets/address-short.html@@ -0,0 +1,10 @@+<a class="address-details" href="#"+ 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>+ {% 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 }}</a>