Skip to content

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

Use dash instead of underscore in template names

Anna Siwik6aafd651f0c8
diff --git a/saleor/cart/views.py b/saleor/cart/views.py
index 5dbc2fbe45..578d949607 100644
--- a/saleor/cart/views.py
+++ b/saleor/cart/views.py
@@ -140,4 +140,4 @@ def summary(request, cart):
'total': currencyfmt(cart_total.gross, cart_total.currency),
'lines': [prepare_line_data(line) for line in cart.lines.all()]}
- return render(request, 'cart-dropdown.html', data)
+ return render(request, 'cart_dropdown.html', data)
diff --git a/saleor/userprofile/views.py b/saleor/userprofile/views.py
index 06870cdd57..8a5b809ec0 100755
--- a/saleor/userprofile/views.py
+++ b/saleor/userprofile/views.py
@@ -47,7 +47,7 @@ def address_edit(request, pk):
messages.success(request, message)
return HttpResponseRedirect(reverse('profile:details') + '#addresses')
return TemplateResponse(
- request, 'userprofile/address-edit.html',
+ request, 'userprofile/address_edit.html',
{'address_form': address_form})
@@ -61,4 +61,4 @@ def address_delete(request, pk):
pgettext('Storefront message', 'Address successfully removed'))
return HttpResponseRedirect(reverse('profile:details') + '#addresses')
return TemplateResponse(
- request, 'userprofile/address-delete.html', {'address': address})
+ request, 'userprofile/address_delete.html', {'address': address})
diff --git a/saleor/userprofile/widgets.py b/saleor/userprofile/widgets.py
index 643c524447..76ac62dcf4 100644
--- a/saleor/userprofile/widgets.py
+++ b/saleor/userprofile/widgets.py
@@ -17,7 +17,7 @@ class PhonePrefixWidget(PhoneNumberPrefixWidget):
https://github.com/stefanfoulis/django-phonenumber-field/issues/82
"""
- template_name = 'userprofile/snippets/phone-prefix-widget.html'
+ template_name = 'userprofile/snippets/phone_prefix_widget.html'
def __init__(self, attrs=None):
widgets = (Select(attrs=attrs, choices=phone_prefixes), TextInput())
diff --git a/templates/base.html b/templates/base.html
index 5aad6a56b8..23f0ce813d 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -133,7 +133,7 @@
</span>
</a>
<div class="cart-dropdown d-none">
- {% include 'cart-dropdown.html' %}
+ {% include 'cart_dropdown.html' %}
</div>
</div>
</div>
diff --git a/templates/cart-dropdown.html b/templates/cart_dropdown.html
similarity index 100%
rename from templates/cart-dropdown.html
rename to templates/cart_dropdown.html
diff --git a/templates/checkout/shipping_address.html b/templates/checkout/shipping_address.html
index 4c7b0adc91..3658fb3689 100644
--- a/templates/checkout/shipping_address.html
+++ b/templates/checkout/shipping_address.html
@@ -10,7 +10,7 @@
{% include "checkout/snippets/addresses_form.html" with addresses_form=user_form addresses=additional_addresses address_form=address_form only %}
{% else %}
{% bootstrap_form user_form %}
- {% include "userprofile/snippets/address-form.html" with address_form=address_form only %}
+ {% include "userprofile/snippets/address_form.html" with address_form=address_form only %}
{% endif %}
<p class="text-md-right">
diff --git a/templates/checkout/shipping_method.html b/templates/checkout/shipping_method.html
index cd1f8ed77b..3583a5b0ea 100644
--- a/templates/checkout/shipping_method.html
+++ b/templates/checkout/shipping_method.html
@@ -5,7 +5,7 @@
{% block forms %}
<h3>{% trans "Shipping address" context "Checkout shipping address title" %}</h3>
- {% include "userprofile/snippets/address-short.html" with address=checkout.shipping_address only %}
+ {% include "userprofile/snippets/address_short.html" with address=checkout.shipping_address only %}
<p><a href="{% url 'checkout:shipping-address' %}">{% trans "Select other address" %}</a></p>
<hr>
<form method="post" novalidate>
diff --git a/templates/checkout/snippets/addresses_form_panel.html b/templates/checkout/snippets/addresses_form_panel.html
index 8e06fd38d2..ef3bbb42a9 100644
--- a/templates/checkout/snippets/addresses_form_panel.html
+++ b/templates/checkout/snippets/addresses_form_panel.html
@@ -6,7 +6,7 @@
id="address_{{ radio_value }}"
{% if radio_value == value %}checked{% endif %}>
{% if address %}
- {% include "userprofile/snippets/address-short.html" with address=address only %}
+ {% include "userprofile/snippets/address_short.html" with address=address only %}
{% else %}
{{ label }}
{% endif %}
@@ -15,7 +15,7 @@
<div>
{% if address_form %}
<div class="checkout__new-address">
- {% include "userprofile/snippets/address-form.html" with address_form=address_form only %}
+ {% include "userprofile/snippets/address_form.html" with address_form=address_form only %}
</div>
{% endif %}
</div>
diff --git a/templates/checkout/summary_without_shipping.html b/templates/checkout/summary_without_shipping.html
index 2b3d9c05df..9acfaa4ac5 100644
--- a/templates/checkout/summary_without_shipping.html
+++ b/templates/checkout/summary_without_shipping.html
@@ -10,7 +10,7 @@
{% include "checkout/snippets/addresses_form.html" with addresses_form=addresses_form addresses=additional_addresses address_form=address_form only %}
{% else %}
{% bootstrap_form user_form %}
- {% include "userprofile/snippets/address-form.html" with address_form=address_form only %}
+ {% include "userprofile/snippets/address_form.html" with address_form=address_form only %}
{% endif %}
<p class="text-md-right">
<button type="submit" class="btn primary">
diff --git a/templates/dashboard/category/detail.html b/templates/dashboard/category/detail.html
index 58eddc59cb..60371e73c0 100644
--- a/templates/dashboard/category/detail.html
+++ b/templates/dashboard/category/detail.html
@@ -19,7 +19,7 @@
{% else %}
{% url 'dashboard:category-list' as url %}
{% endif %}
- {% include "dashboard/includes/_back-link.html" with url=url %}
+ {% include "dashboard/includes/_back_link.html" with url=url %}
{% else %}
{{ block.super }}
{% endif %}
diff --git a/templates/dashboard/customer/detail.html b/templates/dashboard/customer/detail.html
index 36102184e4..9db0a089ab 100644
--- a/templates/dashboard/customer/detail.html
+++ b/templates/dashboard/customer/detail.html
@@ -15,7 +15,7 @@
{% block header_menu %}
{% url "dashboard:customers" as url %}
- {% include "dashboard/includes/_back-link.html" with url=url %}
+ {% include "dashboard/includes/_back_link.html" with url=url %}
{% endblock %}
{% block breadcrumbs %}
diff --git a/templates/dashboard/discount/sale/form.html b/templates/dashboard/discount/sale/form.html
index 9072f59d3e..97deb9781c 100644
--- a/templates/dashboard/discount/sale/form.html
+++ b/templates/dashboard/discount/sale/form.html
@@ -18,7 +18,7 @@
{% block header_menu %}
{% url "dashboard:sale-list" as url %}
- {% include "dashboard/includes/_back-link.html" with url=url %}
+ {% include "dashboard/includes/_back_link.html" with url=url %}
{% endblock %}
{% block header_extra %}
diff --git a/templates/dashboard/discount/voucher/form.html b/templates/dashboard/discount/voucher/form.html
index e958bbfd32..6a6db2b25a 100644
--- a/templates/dashboard/discount/voucher/form.html
+++ b/templates/dashboard/discount/voucher/form.html
@@ -18,7 +18,7 @@
{% block header_menu %}
{% url "dashboard:voucher-list" as url %}
- {% include "dashboard/includes/_back-link.html" with url=url %}
+ {% include "dashboard/includes/_back_link.html" with url=url %}
{% endblock %}
{% block header_extra %}
diff --git a/templates/dashboard/group/detail.html b/templates/dashboard/group/detail.html
index 574aef56ef..f3dca3217d 100644
--- a/templates/dashboard/group/detail.html
+++ b/templates/dashboard/group/detail.html
@@ -18,7 +18,7 @@
{% block header_menu %}
{% url "dashboard:groups-list" as url %}
- {% include "dashboard/includes/_back-link.html" with url=url %}
+ {% include "dashboard/includes/_back_link.html" with url=url %}
{% endblock %}
{% block breadcrumbs %}
diff --git a/templates/dashboard/includes/_back-link.html b/templates/dashboard/includes/_back_link.html
similarity index 100%
rename from templates/dashboard/includes/_back-link.html
rename to templates/dashboard/includes/_back_link.html
diff --git a/templates/dashboard/order/address_form.html b/templates/dashboard/order/address_form.html
index 96be12a14d..b7013b5f9e 100644
--- a/templates/dashboard/order/address_form.html
+++ b/templates/dashboard/order/address_form.html
@@ -13,7 +13,7 @@
{% block header_menu %}
{% url "dashboard:orders" as url %}
- {% include "dashboard/includes/_back-link.html" with url=url %}
+ {% include "dashboard/includes/_back_link.html" with url=url %}
{% endblock %}
{% block breadcrumbs %}
diff --git a/templates/dashboard/order/detail.html b/templates/dashboard/order/detail.html
index 5d5ef82c14..f384af21ac 100644
--- a/templates/dashboard/order/detail.html
+++ b/templates/dashboard/order/detail.html
@@ -17,7 +17,7 @@
{% block header_menu %}
{% url "dashboard:orders" as url %}
- {% include "dashboard/includes/_back-link.html" with url=url %}
+ {% include "dashboard/includes/_back_link.html" with url=url %}
{% endblock %}
{% block header_extra %}
diff --git a/templates/dashboard/product/form.html b/templates/dashboard/product/form.html
index 66fdc2fcdc..79ed4592d5 100644
--- a/templates/dashboard/product/form.html
+++ b/templates/dashboard/product/form.html
@@ -19,7 +19,7 @@
{% block header_menu %}
{% url "dashboard:product-list" as url %}
- {% include "dashboard/includes/_back-link.html" with url=url %}
+ {% include "dashboard/includes/_back_link.html" with url=url %}
{% endblock %}
{% block breadcrumbs %}
diff --git a/templates/dashboard/product/product_attribute/form.html b/templates/dashboard/product/product_attribute/form.html
index e8b0e6d964..a14113f00c 100644
--- a/templates/dashboard/product/product_attribute/form.html
+++ b/templates/dashboard/product/product_attribute/form.html
@@ -18,7 +18,7 @@
{% block header_menu %}
{% url "dashboard:product-attributes" as url %}
- {% include "dashboard/includes/_back-link.html" with url=url %}
+ {% include "dashboard/includes/_back_link.html" with url=url %}
{% endblock %}
diff --git a/templates/dashboard/product/product_attribute/values/form.html b/templates/dashboard/product/product_attribute/values/form.html
index b1b023de5f..a5ad430ca3 100644
--- a/templates/dashboard/product/product_attribute/values/form.html
+++ b/templates/dashboard/product/product_attribute/values/form.html
@@ -18,7 +18,7 @@
{% block header_menu %}
{% url "dashboard:product-attributes" as url %}
- {% include "dashboard/includes/_back-link.html" with url=url %}
+ {% include "dashboard/includes/_back_link.html" with url=url %}
{% endblock %}
diff --git a/templates/dashboard/product/product_class/form.html b/templates/dashboard/product/product_class/form.html
index 32a3779c6d..773bdf732b 100644
--- a/templates/dashboard/product/product_class/form.html
+++ b/templates/dashboard/product/product_class/form.html
@@ -19,7 +19,7 @@
{% block header_menu %}
{% url "dashboard:product-class-list" as url %}
- {% include "dashboard/includes/_back-link.html" with url=url %}
+ {% include "dashboard/includes/_back_link.html" with url=url %}
{% endblock %}
{% block breadcrumbs %}
diff --git a/templates/dashboard/product/product_image/form.html b/templates/dashboard/product/product_image/form.html
index 8fbe312f16..9f09f03cb7 100644
--- a/templates/dashboard/product/product_image/form.html
+++ b/templates/dashboard/product/product_image/form.html
@@ -17,7 +17,7 @@
{% block header_menu %}
{% url "dashboard:product-detail" pk=product.pk as url %}
- {% include "dashboard/includes/_back-link.html" with url=url %}
+ {% include "dashboard/includes/_back_link.html" with url=url %}
{% endblock %}
{% block breadcrumbs %}
diff --git a/templates/dashboard/product/product_variant/form.html b/templates/dashboard/product/product_variant/form.html
index 1ae9492e81..934445a546 100644
--- a/templates/dashboard/product/product_variant/form.html
+++ b/templates/dashboard/product/product_variant/form.html
@@ -16,7 +16,7 @@
{% block header_menu %}
{% url "dashboard:variant-details" product_pk=product.pk variant_pk=variant.pk as url %}
- {% include "dashboard/includes/_back-link.html" with url=url %}
+ {% include "dashboard/includes/_back_link.html" with url=url %}
{% endblock %}
{% block breadcrumbs %}
diff --git a/templates/dashboard/product/stock/form.html b/templates/dashboard/product/stock/form.html
index 50d5837946..1c8eb3005c 100644
--- a/templates/dashboard/product/stock/form.html
+++ b/templates/dashboard/product/stock/form.html
@@ -20,7 +20,7 @@
{% block header_menu %}
{% url "dashboard:variant-details" product_pk=product.pk variant_pk=variant.pk as url %}
- {% include "dashboard/includes/_back-link.html" with url=url %}
+ {% include "dashboard/includes/_back_link.html" with url=url %}
{% endblock %}
{% block breadcrumbs %}
diff --git a/templates/dashboard/shipping/country/form.html b/templates/dashboard/shipping/country/form.html
index a61a4feda2..a3602ab223 100644
--- a/templates/dashboard/shipping/country/form.html
+++ b/templates/dashboard/shipping/country/form.html
@@ -20,7 +20,7 @@
{% block header_menu %}
{% url "dashboard:shipping-method-list" as url %}
- {% include "dashboard/includes/_back-link.html" with url=url %}
+ {% include "dashboard/includes/_back_link.html" with url=url %}
{% endblock %}
diff --git a/templates/dashboard/sites/authorization_keys/form.html b/templates/dashboard/sites/authorization_keys/form.html
index dbd112c691..593e4ce971 100644
--- a/templates/dashboard/sites/authorization_keys/form.html
+++ b/templates/dashboard/sites/authorization_keys/form.html
@@ -18,7 +18,7 @@
{% block header_menu %}
{% url "dashboard:site-index" as url %}
- {% include "dashboard/includes/_back-link.html" with url=url %}
+ {% include "dashboard/includes/_back_link.html" with url=url %}
{% endblock %}
diff --git a/templates/dashboard/staff/detail.html b/templates/dashboard/staff/detail.html
index 798888fb49..53a133b8de 100644
--- a/templates/dashboard/staff/detail.html
+++ b/templates/dashboard/staff/detail.html
@@ -18,7 +18,7 @@
{% block header_menu %}
{% url "dashboard:staff" as url %}
- {% include "dashboard/includes/_back-link.html" with url=url %}
+ {% include "dashboard/includes/_back_link.html" with url=url %}
{% endblock %}
{% block breadcrumbs %}
diff --git a/templates/order/_ordered_items_table.html b/templates/order/_ordered_items_table.html
index 67c71bd29e..66f67c7842 100644
--- a/templates/order/_ordered_items_table.html
+++ b/templates/order/_ordered_items_table.html
@@ -13,14 +13,14 @@
<h3>
{% trans "Shipping address" context "Order details address title" %}
</h3>
- <address>{% include "userprofile/snippets/address-short.html" with address=order.shipping_address %}</address>
+ <address>{% include "userprofile/snippets/address_short.html" with address=order.shipping_address %}</address>
</div>
{% endif %}
<div class="col-6">
<h3>
{% trans "Billing address" context "Order details address title" %}
</h3>
- <address>{% include "userprofile/snippets/address-short.html" with address=order.billing_address %}</address>
+ <address>{% include "userprofile/snippets/address_short.html" with address=order.billing_address %}</address>
</div>
</div>
</div>
diff --git a/templates/order/payment/paypal-card.html b/templates/order/payment/paypal_card.html
similarity index 100%
rename from templates/order/payment/paypal-card.html
rename to templates/order/payment/paypal_card.html
diff --git a/templates/userprofile/address-delete.html b/templates/userprofile/address_delete.html
similarity index 100%
rename from templates/userprofile/address-delete.html
rename to templates/userprofile/address_delete.html
diff --git a/templates/userprofile/address-edit.html b/templates/userprofile/address_edit.html
similarity index 96%
rename from templates/userprofile/address-edit.html
rename to templates/userprofile/address_edit.html
index 4943a3b4e2..deef0fbe29 100644
--- a/templates/userprofile/address-edit.html
+++ b/templates/userprofile/address_edit.html
@@ -42,7 +42,7 @@
{% endif %}
</h2>
<div class="userprofile__address-edit__form">
- {% include "userprofile/snippets/address-form.html" %}
+ {% include "userprofile/snippets/address_form.html" %}
</div>
<p class="text-right">
<button type="submit" class="btn primary narrow">
diff --git a/templates/userprofile/details.html b/templates/userprofile/details.html
index b6cfd4a0ec..5c2f789893 100644
--- a/templates/userprofile/details.html
+++ b/templates/userprofile/details.html
@@ -118,14 +118,14 @@
{% for address in addresses %}
<div class="col-md-6">
<div class="card card-block">
- {% include "userprofile/snippets/address-short.html" %}
+ {% include "userprofile/snippets/address_short.html" %}
<ul class="icons">
<li><a href="{% url "profile:address-edit" pk=address.pk %}">
{% trans "Edit" context "User address action" %}
</a></li>
<li><a class="delete-icon"><svg data-src="{% static "images/delete.svg" %}" height="20px" width="20px" /></a></li>
</ul>
- {% include "userprofile/address-delete.html" with pk=address.pk %}
+ {% include "userprofile/address_delete.html" with pk=address.pk %}
</div>
</div>
{% endfor %}
diff --git a/templates/userprofile/snippets/address-details.html b/templates/userprofile/snippets/address-details.html
deleted file mode 100644
index d5b5e6a5d8..0000000000
--- a/templates/userprofile/snippets/address-details.html
+++ /dev/null
@@ -1,3 +0,0 @@
-{% load format_address from i18n_address_tags %}
-
-{% format_address address %}
diff --git a/templates/userprofile/snippets/address-form.html b/templates/userprofile/snippets/address_form.html
similarity index 100%
rename from templates/userprofile/snippets/address-form.html
rename to templates/userprofile/snippets/address_form.html
diff --git a/templates/userprofile/snippets/address-short.html b/templates/userprofile/snippets/address_short.html
similarity index 100%
rename from templates/userprofile/snippets/address-short.html
rename to templates/userprofile/snippets/address_short.html
diff --git a/templates/userprofile/snippets/phone-prefix-widget.html b/templates/userprofile/snippets/phone_prefix_widget.html
similarity index 100%
rename from templates/userprofile/snippets/phone-prefix-widget.html
rename to templates/userprofile/snippets/phone_prefix_widget.html