Skip to content

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

Improve checkbox

Paweł Kowalewski15bf7e6cb0ea
diff --git a/saleor/core/templates/materializecssform/field.html b/saleor/core/templates/materializecssform/field.html
index 70e38a2f52..ff046b090a 100644
--- a/saleor/core/templates/materializecssform/field.html
+++ b/saleor/core/templates/materializecssform/field.html
@@ -4,10 +4,11 @@
{% if field|is_checkbox %}
<div class="col {{ classes.label }}">
<div class="{{ classes.single_value }}">
- <div class="checkbox">
+ <p>
{% if field.auto_id %}
- <label {% if field.field.required and form.required_css_class %}class="{{ form.required_css_class }}"{% endif %}>
- {{ field }} <span>{{ field.label }}</span>
+ {{ field }}
+ <label for="{{ field.auto_id }}" {% if field.field.required and form.required_css_class %}class="{{ form.required_css_class }}"{% endif %}>
+ {{ field.label }}
</label>
{% endif %}
{% for error in field.errors %}
@@ -19,7 +20,7 @@
{{ field.help_text|safe }}
</p>
{% endif %}
- </div>
+ </p>
</div>
</div>
{% elif field|is_radio %}
diff --git a/saleor/dashboard/templates/dashboard/category/detail.html b/saleor/dashboard/templates/dashboard/category/detail.html
index 62e6fc616a..39485d8c47 100644
--- a/saleor/dashboard/templates/dashboard/category/detail.html
+++ b/saleor/dashboard/templates/dashboard/category/detail.html
@@ -5,15 +5,6 @@
{% block title %}{% if category.pk %}{{ category }}{% else %}{% trans 'Add new category' %}{% endif %} - {% trans 'Categories' %} - {{ block.super }}{% endblock %}
-{% block custom_css %}
-<style type="text/css">
-[type=checkbox]:not(:checked), [type=checkbox]:checked {
- position: static;
- visibility: visible;
-}
-</style>
-{% endblock %}
-
{% block body_class %}body-categories{% endblock %}
{% block page_title %}{% if category.pk %}{{ category }}{% else %}{% trans 'Add new category' %}{% endif %}{% endblock %}
diff --git a/saleor/dashboard/templates/dashboard/product/list.html b/saleor/dashboard/templates/dashboard/product/list.html
index 050db1e11e..f1887cf3b1 100644
--- a/saleor/dashboard/templates/dashboard/product/list.html
+++ b/saleor/dashboard/templates/dashboard/product/list.html
@@ -42,18 +42,18 @@
{% block content %}
<div class="row">
<div class="col s12">
- <ul class="collection product-list">
+ <ul class="collection list">
{% for product in products %}
- <li class="collection-item avatar product-list-item">
+ <li class="collection-item avatar list-item">
{% if product.images.exists %}
<img src="{{ product.images.first.image.crop.50x50 }}" alt="" class="circle teal">
{% else %}
<img src="{% static 'placeholders/product-image-placeholder.png' %}" alt="" class="circle teal">
{% endif %}
<a class="title" href="{% url 'dashboard:product-update' pk=product.pk %}">
- <span class="product-list-name">{{ product.name }}</span>
+ <span class="list-item-name">{{ product.name }}</span>
</a>
- <p class="product-list-price">{% gross product.price %}</p>
+ <p class="list-item-price">{% gross product.price %}</p>
</li>
{% endfor %}
</ul>
diff --git a/saleor/dashboard/templates/dashboard/product/product_form.html b/saleor/dashboard/templates/dashboard/product/product_form.html
index 3bf6eaf949..c86fd4b7ac 100644
--- a/saleor/dashboard/templates/dashboard/product/product_form.html
+++ b/saleor/dashboard/templates/dashboard/product/product_form.html
@@ -398,7 +398,7 @@
{% endif %}
<p>
- {% blocktrans %}If you remove <b>{{ product }}</b> you will lose all data related to this product.{% endblocktrans %}
+ {% blocktrans %}If you remove <strong>{{ product }}</strong> you will lose all data related to this product.{% endblocktrans %}
</p>
</div>
diff --git a/saleor/static/scss/_app.scss b/saleor/static/scss/_app.scss
index b372c5d4bc..725c24940c 100644
--- a/saleor/static/scss/_app.scss
+++ b/saleor/static/scss/_app.scss
@@ -286,12 +286,11 @@ table {
@import "widget/attribute-list";
@import "widget/breadcrumbs";
@import "widget/card";
-@import "widget/category-list";
@import "widget/data-table";
@import "widget/dropzone";
@import "widget/form";
+@import "widget/list";
@import "widget/product-gallery";
-@import "widget/product-list";
@import "widget/ppoi";
@import "widget/select2";
@import "widget/tabs";
diff --git a/saleor/static/scss/widget/_list.scss b/saleor/static/scss/widget/_list.scss
index 73f95524f5..b14cf82334 100644
--- a/saleor/static/scss/widget/_list.scss
+++ b/saleor/static/scss/widget/_list.scss
@@ -1,4 +1,4 @@
-@mixin product-list {
+@mixin list {
border: none;
overflow: visible;
@@ -36,19 +36,55 @@
}
}
- &-name {
- display: block;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
+ & &-item--two-lines {
+ border: none;
+ padding: 0;
}
- &-price {
- border-bottom: 1px solid $collection-border-color;
- padding-bottom: 12px;
+ &-item {
+ &-name {
+ display: block;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ }
+
+ &-price, &-desc {
+ border-bottom: 1px solid $collection-border-color;
+ padding-bottom: 12px;
+ }
+
+ &-desc {
+ color: map_get($grey, base);
+ margin: 0 0 12px;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ }
+
+ &-prefix {
+ color: initial;
+ }
}
+
+ .category-list-actions {
+ font-size: $font-size-action-icon;
+
+ @media (min-width: $medium-screen-up) {
+ display: none;
+ }
+ }
+
+ &:hover {
+ .category-list-item-actions {
+ @media (min-width: $medium-screen-up) {
+ display: block;
+ }
+ }
+ }
+
}
-.product-list {
- @include product-list;
+.list {
+ @include list;
}