Skip to content

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

Add primary class to buttons

Krzysztof Białogłowicz37f55684d642
diff --git a/saleor/static/scss/dashboard/dashboard.scss b/saleor/static/scss/dashboard/dashboard.scss
index d73e0b6708..cc59008424 100644
--- a/saleor/static/scss/dashboard/dashboard.scss
+++ b/saleor/static/scss/dashboard/dashboard.scss
@@ -92,9 +92,13 @@ tr[data-action-go]>td:not(.ignore-link):hover {
}
.btn-flat {
- &:hover {
+ &.primary {
background: $button-flat-color;
color: #fff;
+ &:hover {
+ background: rgba(0,0,0,0.1);
+ color: $button-flat-color;
+ }
}
}
diff --git a/templates/dashboard/category/detail.html b/templates/dashboard/category/detail.html
index 0bcc04c449..cf1574d738 100644
--- a/templates/dashboard/category/detail.html
+++ b/templates/dashboard/category/detail.html
@@ -67,11 +67,11 @@
{% trans "Cancel" context "Category form secondary action" %}</a>
{% endif %}
{% if category.pk %}
- <button type="submit" class="btn btn-flat">
+ <button type="submit" class="btn btn-flat primary">
{% trans "Update" context "Category form primary action" %}
</button>
{% else %}
- <button type="submit" class="btn btn-flat">
+ <button type="submit" class="btn btn-flat primary">
{% trans "Create" context "Category form primary action" %}
</button>
{% endif %}
diff --git a/templates/dashboard/discount/sale_form.html b/templates/dashboard/discount/sale_form.html
index 326a7f304d..12cc8e6d81 100644
--- a/templates/dashboard/discount/sale_form.html
+++ b/templates/dashboard/discount/sale_form.html
@@ -77,13 +77,13 @@
{% if sale.pk %}
<a href="{% url 'dashboard:sale-list' %}" class="btn btn-flat">
{% trans "Cancel" context "Sale (discount) secondary action" %}</a>
- <button type="submit" class="btn btn-flat">
+ <button type="submit" class="btn btn-flat primary">
{% trans "Update" context "Sale (discount) primary action" %}
</button>
{% else %}
<a href="{% url 'dashboard:sale-list' %}" class="btn btn-flat">
{% trans "Cancel" context "Sake (discount) secondary action" %}</a>
- <button type="submit" class="btn btn-flat">
+ <button type="submit" class="btn btn-flat primary">
{% trans "Create" context "Sale (discount) primary action" %}
</button>
{% endif %}
diff --git a/templates/dashboard/discount/voucher_form.html b/templates/dashboard/discount/voucher_form.html
index c4c7583d47..21f709aa6b 100644
--- a/templates/dashboard/discount/voucher_form.html
+++ b/templates/dashboard/discount/voucher_form.html
@@ -108,11 +108,11 @@
{% if voucher.pk %}
<a href="{% url 'dashboard:voucher-list' %}" class="btn btn-flat">
{% trans "Cancel" context "Voucher form secondary action" %}</a>
- <button type="submit" class="btn btn-flat">{% trans "Update" context "Voucher form primary action" %}</button>
+ <button type="submit" class="btn btn-flat primary">{% trans "Update" context "Voucher form primary action" %}</button>
{% else %}
<a href="{% url 'dashboard:voucher-list' %}" class="btn btn-flat">
{% trans "Cancel" context "Voucher form secondary action" %}</a>
- <button type="submit" class="btn btn-flat">{% trans "Create" context "Voucher form primary action" %}</button>
+ <button type="submit" class="btn btn-flat primary">{% trans "Create" context "Voucher form primary action" %}</button>
{% endif %}
</div>
</form>
diff --git a/templates/dashboard/product/attributes/form.html b/templates/dashboard/product/attributes/form.html
index db5de8d4ec..8fac02b91f 100644
--- a/templates/dashboard/product/attributes/form.html
+++ b/templates/dashboard/product/attributes/form.html
@@ -95,11 +95,11 @@
{% if attribute.pk %}
<a href="{% url 'dashboard:product-attributes' %}" class="btn btn-flat">
{% trans "Cancel" context "Attribute secondary action" %}</a>
- <button type="submit" class="btn btn-flat">{% trans "Update" context "Attribute values formset action" %}</button>
+ <button type="submit" class="btn btn-flat primary">{% trans "Update" context "Attribute values formset action" %}</button>
{% else %}
<a href="{% url 'dashboard:product-attributes' %}" class="btn btn-flat">
{% trans "Cancel" context "Attribute secondary action" %}</a>
- <button type="submit" class="btn btn-flat">{% trans "Create" context "Attribute values formset action" %}</button>
+ <button type="submit" class="btn btn-flat primary">{% trans "Create" context "Attribute values formset action" %}</button>
{% endif %}
</div>
</form>
diff --git a/templates/dashboard/product/product_class_form.html b/templates/dashboard/product/product_class_form.html
index 3c9221d814..673b7b1a4e 100644
--- a/templates/dashboard/product/product_class_form.html
+++ b/templates/dashboard/product/product_class_form.html
@@ -79,13 +79,13 @@
{% if product_class.pk %}
<a href="{% url 'dashboard:product-class-list' %}" class="btn btn-flat">
{% trans "Cancel" context "Product class secondary action" %}</a>
- <button type="submit" class="btn btn-flat">
+ <button type="submit" class="btn btn-flat primary">
{% trans "Update" context "Product class primary action" %}
</button>
{% else %}
<a href="{% url 'dashboard:product-class-list' %}" class="btn btn-flat">
{% trans "Cancel" context "Product class secondary action" %}</a>
- <button type="submit" class="btn btn-flat">
+ <button type="submit" class="btn btn-flat primary">
{% trans "Create" context "Product class primary action" %}
</button>
{% endif %}
diff --git a/templates/dashboard/product/product_form.html b/templates/dashboard/product/product_form.html
index f80089fa58..25f5aa83c7 100644
--- a/templates/dashboard/product/product_form.html
+++ b/templates/dashboard/product/product_form.html
@@ -143,13 +143,13 @@
{% if product.pk %}
<a href="{% url 'dashboard:product-list' %}" class="btn btn-flat">
{% trans "Cancel" context "Product form secondary action" %}</a>
- <button type="submit" class="btn btn-flat">
+ <button type="submit" class="btn btn-flat primary">
{% trans "Update" context "Product form details tab action" %}
</button>
{% else %}
<a href="{% url 'dashboard:product-list' %}" class="btn btn-flat">
{% trans "Cancel" context "Product form secondary action" %}</a>
- <button type="submit" class="btn btn-flat">
+ <button type="submit" class="btn btn-flat primary">
{% trans "Create" context "Product form details tab action" %}
</button>
{% endif %}
diff --git a/templates/dashboard/product/product_image_form.html b/templates/dashboard/product/product_image_form.html
index 86fe6eddcb..d5ff40bb3c 100644
--- a/templates/dashboard/product/product_image_form.html
+++ b/templates/dashboard/product/product_image_form.html
@@ -78,11 +78,11 @@
{% if product_image.pk %}
<a href="{% url "dashboard:product-update" pk=product.pk %}#images" class="btn btn-flat">
{% trans "Cancel" context "Image form secondary action" %}</a>
- <button type="submit" class="btn btn-flat">{% trans "Update" context "Image form primary action" %}</button>
+ <button type="submit" class="btn btn-flat primary">{% trans "Update" context "Image form primary action" %}</button>
{% else %}
<a href="{% url "dashboard:product-update" pk=product.pk %}#images" class="btn btn-flat">
{% trans "Cancel" context "Image form secondary action" %}</a>
- <button type="submit" class="btn btn-flat">{% trans "Create" context "Image form secondary action" %}</button>
+ <button type="submit" class="btn btn-flat primary">{% trans "Create" context "Image form secondary action" %}</button>
{% endif %}
</div>
</form>
diff --git a/templates/dashboard/product/stock_form.html b/templates/dashboard/product/stock_form.html
index 0313e35324..224d58134b 100644
--- a/templates/dashboard/product/stock_form.html
+++ b/templates/dashboard/product/stock_form.html
@@ -84,13 +84,13 @@
{% if stock.pk %}
<a href="{% url "dashboard:product-update" pk=product.pk %}#stock" class="btn btn-flat">
{% trans "Cancel" context "Stock form secondary action" %}</a>
- <button type="submit" class="btn btn-flat">
+ <button type="submit" class="btn btn-flat primary">
{% trans "Update" context "Stock form action" %}
</button>
{% else %}
<a href="{% url "dashboard:product-update" pk=product.pk %}#stock" class="btn btn-flat">
{% trans "Cancel" context "Stock form secondary action" %}</a>
- <button type="submit" class="btn btn-flat">
+ <button type="submit" class="btn btn-flat primary">
{% trans "Create" context "Stock form action" %}
</button>
{% endif %}
diff --git a/templates/dashboard/product/stock_locations/form.html b/templates/dashboard/product/stock_locations/form.html
index b393531119..d1826c8d5a 100644
--- a/templates/dashboard/product/stock_locations/form.html
+++ b/templates/dashboard/product/stock_locations/form.html
@@ -57,13 +57,13 @@
{% if location.pk %}
<a href="{% url 'dashboard:product-stock-location-list' %}" class="btn btn-flat">
{% trans "Cancel" context "Product stock location secondary action" %}</a>
- <button type="submit" class="btn btn-flat">
+ <button type="submit" class="btn btn-flat primary">
{% trans "Update" context "Stock location detail action" %}
</button>
{% else %}
<a href="{% url 'dashboard:product-stock-location-list' %}" class="btn btn-flat">
{% trans "Cancel" context "Product stock location secondary action" %}</a>
- <button type="submit" class="btn btn-flat">
+ <button type="submit" class="btn btn-flat primary">
{% trans "Create" context "Stock location detail action" %}
</button>
{% endif %}
diff --git a/templates/dashboard/product/variant_form.html b/templates/dashboard/product/variant_form.html
index e41a91d82b..353893afa7 100644
--- a/templates/dashboard/product/variant_form.html
+++ b/templates/dashboard/product/variant_form.html
@@ -84,13 +84,13 @@
{% if variant.pk %}
<a href="{% url "dashboard:product-update" pk=product.pk %}#variants" class="btn btn-flat">
{% trans "Cancel" context "Variant form secondary action" %}</a>
- <button type="submit" class="btn btn-flat">
+ <button type="submit" class="btn btn-flat primary">
{% trans "Update" context "Variant form action" %}
</button>
{% else %}
<a href="{% url "dashboard:product-update" pk=product.pk %}#variants" class="btn btn-flat">
{% trans "Cancel" context "Variant form secondary action" %}</a>
- <button type="submit" class="btn btn-flat">
+ <button type="submit" class="btn btn-flat primary">
{% trans "Create" context "Variant form action" %}
</button>
{% endif %}
diff --git a/templates/dashboard/shipping/method_form.html b/templates/dashboard/shipping/method_form.html
index c47ae0fb8a..fb3570592f 100644
--- a/templates/dashboard/shipping/method_form.html
+++ b/templates/dashboard/shipping/method_form.html
@@ -106,10 +106,10 @@
<div class="card-action right-align">
{% if shipping_method.pk %}
<a href="{% url 'dashboard:shipping-methods' %}" class="btn btn-flat">{% trans "Cancel" context "Shipping method form action" %}</a>
- <button type="submit" class="btn btn-flat">{% trans "Update" context "Shipping method form action" %}</button>
+ <button type="submit" class="btn btn-flat primary">{% trans "Update" context "Shipping method form action" %}</button>
{% else %}
<a href="{% url 'dashboard:shipping-methods' %}" class="btn btn-flat">{% trans "Cancel" context "Shipping method form action" %}</a>
- <button type="submit" class="btn btn-flat">{% trans "Create" context "Shipping method form action" %}</button>
+ <button type="submit" class="btn btn-flat primary">{% trans "Create" context "Shipping method form action" %}</button>
{% endif %}
</div>
</form>
diff --git a/templates/dashboard/sites/detail.html b/templates/dashboard/sites/detail.html
index b7b32b5b0c..7d110de715 100644
--- a/templates/dashboard/sites/detail.html
+++ b/templates/dashboard/sites/detail.html
@@ -36,7 +36,8 @@
</div>
<div class="card-action right-align">
- <button type="submit" class="btn btn-flat">{% trans "Update" context "Site settings action" %}</button>
+ <a class="btn btn-flat" href="{% url "dashboard:index" %}" traget="_blank">{% trans "Cancel" %}</a>
+ <button type="submit" class="btn btn-flat primary">{% trans "Update" context "Site settings action" %}</button>
</div>
</form>
</div>