Skip to content

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

Remove duplicated 'Cancel' buttons on Dashboard templates

Pacu218f2ebb52c2d
diff --git a/templates/dashboard/discount/sale/form.html b/templates/dashboard/discount/sale/form.html
index c0ce785fe3..8451758270 100644
--- a/templates/dashboard/discount/sale/form.html
+++ b/templates/dashboard/discount/sale/form.html
@@ -98,17 +98,14 @@
</div>
<div class="card-action right-align">
+ <a href="{% url 'dashboard:sale-list' %}" class="btn-flat waves-effect">
+ {% trans "Cancel" context "Dashboard cancel action" %}
+ </a>
{% if sale.pk %}
- <a href="{% url 'dashboard:sale-list' %}" class="btn-flat waves-effect">
- {% trans "Cancel" context "Dashboard cancel action" %}
- </a>
<button type="submit" class="btn waves-effect">
{% trans "Update" context "Dashboard update action" %}
</button>
{% else %}
- <a href="{% url 'dashboard:sale-list' %}" class="btn-flat waves-effect">
- {% trans "Cancel" context "Dashboard cancel action" %}
- </a>
<button type="submit" class="btn waves-effect">
{% trans "Create" context "Dashboard create action" %}
</button>
diff --git a/templates/dashboard/discount/voucher/form.html b/templates/dashboard/discount/voucher/form.html
index 0fb8db0217..6ed2c6be15 100644
--- a/templates/dashboard/discount/voucher/form.html
+++ b/templates/dashboard/discount/voucher/form.html
@@ -121,17 +121,14 @@
</div>
</div>
<div class="card-action right-align">
+ <a href="{% url 'dashboard:voucher-list' %}" class="btn-flat waves-effect">
+ {% trans "Cancel" context "Dashboard cancel action" %}
+ </a>
{% if voucher.pk %}
- <a href="{% url 'dashboard:voucher-list' %}" class="btn-flat waves-effect">
- {% trans "Cancel" context "Dashboard cancel action" %}
- </a>
<button type="submit" class="btn waves-effect">
{% trans "Update" context "Dashboard update action" %}
</button>
{% else %}
- <a href="{% url 'dashboard:voucher-list' %}" class="btn-flat waves-effect">
- {% trans "Cancel" context "Dashboard cancel action" %}
- </a>
<button type="submit" class="btn waves-effect">
{% trans "Create" context "Dashboard create action" %}
</button>
diff --git a/templates/dashboard/product/product_attribute/values/form.html b/templates/dashboard/product/product_attribute/values/form.html
index 8944041a5d..0f92ab1fab 100644
--- a/templates/dashboard/product/product_attribute/values/form.html
+++ b/templates/dashboard/product/product_attribute/values/form.html
@@ -74,17 +74,14 @@
</div>
</div>
<div class="card-action right-align">
+ <a href="{% url 'dashboard:product-attribute-detail' pk=attribute.pk %}" class="btn-flat waves-effect">
+ {% trans "Cancel" context "Dashboard cancel action" %}
+ </a>
{% if value.pk %}
- <a href="{% url 'dashboard:product-attribute-detail' pk=attribute.pk %}" class="btn-flat waves-effect">
- {% trans "Cancel" context "Dashboard cancel action" %}
- </a>
<button type="submit" class="btn waves-effect">
{% trans "Save" context "Dashboard update action" %}
</button>
{% else %}
- <a href="{% url 'dashboard:product-attribute-detail' pk=attribute.pk%}" class="btn-flat waves-effect">
- {% trans "Cancel" context "Dashboard cancel action" %}
- </a>
<button type="submit" class="btn waves-effect">
{% trans "Create" context "Dashboard create action" %}
</button>
diff --git a/templates/dashboard/product/product_image/form.html b/templates/dashboard/product/product_image/form.html
index c3859446c1..5b5be7dfda 100644
--- a/templates/dashboard/product/product_image/form.html
+++ b/templates/dashboard/product/product_image/form.html
@@ -75,17 +75,14 @@
</div>
</div>
<div class="card-action right-align">
+ <a href="{% url "dashboard:product-image-list" product.pk %}" class="btn-flat waves-effect">
+ {% trans "Cancel" context "Dashboard cancel action" %}
+ </a>
{% if product_image.pk %}
- <a href="{% url "dashboard:product-image-list" product.pk %}" class="btn-flat waves-effect">
- {% trans "Cancel" context "Dashboard cancel action" %}
- </a>
<button type="submit" class="btn waves-effect">
{% trans "Save" context "Dashboard update action" %}
</button>
{% else %}
- <a href="{% url "dashboard:product-image-list" product.pk %}" class="btn-flat waves-effect">
- {% trans "Cancel" context "Dashboard cancel action" %}
- </a>
<button type="submit" class="btn waves-effect">
{% trans "Create" context "Dashboard create action" %}
</button>
diff --git a/templates/dashboard/product/product_type/form.html b/templates/dashboard/product/product_type/form.html
index 3bb5b075df..448649adaf 100644
--- a/templates/dashboard/product/product_type/form.html
+++ b/templates/dashboard/product/product_type/form.html
@@ -94,17 +94,14 @@
</div>
{% if perms.product.edit_properties %}
<div class="card-action right-align">
+ <a href="{% url 'dashboard:product-type-list' %}" class="btn-flat waves-effect">
+ {% trans "Cancel" context "Dashboard cancel action" %}
+ </a>
{% if product_type.pk %}
- <a href="{% url 'dashboard:product-type-list' %}" class="btn-flat waves-effect">
- {% trans "Cancel" context "Dashboard cancel action" %}
- </a>
<button type="submit" class="btn waves-effect">
{% trans "Update" context "Dashboard update action" %}
</button>
{% else %}
- <a href="{% url 'dashboard:product-type-list' %}" class="btn-flat waves-effect">
- {% trans "Cancel" context "Dashboard cancel action" %}
- </a>
<button type="submit" class="btn waves-effect">
{% trans "Create" context "Dashboard create action" %}
</button>
diff --git a/templates/dashboard/product/stock_location/form.html b/templates/dashboard/product/stock_location/form.html
index 2d70440eac..0d1735c1bd 100644
--- a/templates/dashboard/product/stock_location/form.html
+++ b/templates/dashboard/product/stock_location/form.html
@@ -69,17 +69,14 @@
</div>
</div>
<div class="card-action right-align">
+ <a href="{% url 'dashboard:product-stock-location-list' %}" class="btn-flat waves-effect">
+ {% trans "Cancel" context "Dashboard cancel action" %}
+ </a>
{% if location.pk %}
- <a href="{% url 'dashboard:product-stock-location-list' %}" class="btn-flat waves-effect">
- {% trans "Cancel" context "Dashboard cancel action" %}
- </a>
<button type="submit" class="btn waves-effect">
{% trans "Update" context "Dashboard update action" %}
</button>
{% else %}
- <a href="{% url 'dashboard:product-stock-location-list' %}" class="btn-flat waves-effect">
- {% trans "Cancel" context "Dashboard cancel action" %}
- </a>
<button type="submit" class="btn waves-effect">
{% trans "Create" context "Dashboard create action" %}
</button>
diff --git a/templates/dashboard/shipping/country/form.html b/templates/dashboard/shipping/country/form.html
index af39ee07da..108baca20a 100644
--- a/templates/dashboard/shipping/country/form.html
+++ b/templates/dashboard/shipping/country/form.html
@@ -76,17 +76,14 @@
</div>
</div>
<div class="card-action right-align">
+ <a href="{% url 'dashboard:shipping-method-detail' pk=shipping_method.pk %}" class="btn-flat waves-effect">
+ {% trans "Cancel" context "Dashboard cancel action" %}
+ </a>
{% if country.pk %}
- <a href="{% url 'dashboard:shipping-method-detail' pk=shipping_method.pk %}" class="btn-flat waves-effect">
- {% trans "Cancel" context "Dashboard cancel action" %}
- </a>
<button type="submit" class="btn waves-effect">
{% trans "Save" context "Dashboard update action" %}
</button>
{% else %}
- <a href="{% url 'dashboard:shipping-method-detail' pk=shipping_method.pk %}" class="btn-flat waves-effect">
- {% trans "Cancel" context "Dashboard cancel action" %}
- </a>
<button type="submit" class="btn waves-effect">
{% trans "Create" context "Dashboard create action" %}
</button>
diff --git a/templates/dashboard/sites/authorization_keys/form.html b/templates/dashboard/sites/authorization_keys/form.html
index 5a1eb784ea..fa0fb5b59b 100644
--- a/templates/dashboard/sites/authorization_keys/form.html
+++ b/templates/dashboard/sites/authorization_keys/form.html
@@ -67,17 +67,14 @@
</div>
</div>
<div class="card-action right-align">
+ <a href="{% url 'dashboard:site-detail' pk=site_settings_pk %}" class="btn-flat waves-effect">
+ {% trans "Cancel" context "Dashboard cancel action" %}
+ </a>
{% if value.pk %}
- <a href="{% url 'dashboard:site-detail' pk=site_settings_pk %}" class="btn-flat waves-effect">
- {% trans "Cancel" context "Dashboard cancel action" %}
- </a>
<button type="submit" class="btn waves-effect">
{% trans "Save" context "Dashboard update action" %}
</button>
{% else %}
- <a href="{% url 'dashboard:site-detail' pk=site_settings_pk %}" class="btn-flat waves-effect">
- {% trans "Cancel" context "Dashboard cancel action" %}
- </a>
<button type="submit" class="btn waves-effect">
{% trans "Create" context "Dashboard create action" %}
</button>