Skip to content

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

Improve attributes list and form

Paweł Kowalewski230ed3ac4b37
diff --git a/saleor/dashboard/templates/dashboard/product/attributes/form.html b/saleor/dashboard/templates/dashboard/product/attributes/form.html
index 0c2c07c641..2536b08e3f 100644
--- a/saleor/dashboard/templates/dashboard/product/attributes/form.html
+++ b/saleor/dashboard/templates/dashboard/product/attributes/form.html
@@ -42,7 +42,8 @@
<div class="col l8">
<div class="row">
{% csrf_token %}
- {{ form|materializecss }}
+ {{ form.display|materializecss }}
+ {{ form.name|materializecss }}
</div>
<h5>{% trans "Attribute values" %}</h5>
@@ -68,7 +69,7 @@
{% endfor %}
{% endif %}
{{ field.errors.as_ul }}
- {{ field }}
+ {{ field|materializecss }}
</td>
{% endfor %}
</tr>
diff --git a/saleor/dashboard/templates/dashboard/product/attributes/list.html b/saleor/dashboard/templates/dashboard/product/attributes/list.html
index 42c7c69921..35befd3543 100644
--- a/saleor/dashboard/templates/dashboard/product/attributes/list.html
+++ b/saleor/dashboard/templates/dashboard/product/attributes/list.html
@@ -26,13 +26,17 @@
{% block content %}
<div class="row">
<div class="col s12">
- <ul class="collection list list--attributes">
- {% for attribute in attributes %}
- <li class="collection-item list-item list--attributes-item">
- <a href="{% url 'dashboard:product-attribute-update' pk=attribute.pk %}">{{ attribute.display }}</a>
- </li>
- {% endfor %}
- </ul>
+ {% if attributes %}
+ <ul class="collection list list--attributes">
+ {% for attribute in attributes %}
+ <li class="collection-item list-item list--attributes-item">
+ <a href="{% url 'dashboard:product-attribute-update' pk=attribute.pk %}">{{ attribute.display }}</a>
+ </li>
+ {% endfor %}
+ </ul>
+ {% else %}
+ <p>{% trans "No attributes found." %}</p>
+ {% endif %}
</div>
</div>
{% endblock %}
diff --git a/saleor/static/scss/widget/_form.scss b/saleor/static/scss/widget/_form.scss
index 53522ef9d8..4159f55dfa 100644
--- a/saleor/static/scss/widget/_form.scss
+++ b/saleor/static/scss/widget/_form.scss
@@ -66,9 +66,26 @@
}
&#form-attributes {
- [type=checkbox]:not(:checked), [type=checkbox]:checked {
- position: initial;
- visibility: visible;
+ #id_display {
+ @extend %input-lg;
+ }
+
+ table {
+ .input-field, p {
+ margin: 0;
+ padding: 0;
+ }
+
+ label {
+ font-size: 0;
+ vertical-align: bottom;
+ }
+ }
+ }
+
+ &#form-category {
+ #id_name {
+ @extend %input-lg;
}
}