Skip to content

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

Improve dashboard index page

Paweł Kowalewskibe4221a7f1a7
diff --git a/saleor/dashboard/templates/dashboard/index.html b/saleor/dashboard/templates/dashboard/index.html
index 286f7d95d9..59511426da 100644
--- a/saleor/dashboard/templates/dashboard/index.html
+++ b/saleor/dashboard/templates/dashboard/index.html
@@ -7,9 +7,9 @@
{% block content %}
<div class="row">
<div class="col s12">
- <div class="card blue-grey">
- <div class="card-content white-text">
- <span class="card-title">{% trans "Preauthorized payments" %}</span>
+ <div class="card">
+ <div class="card-content">
+ <span class="card-title black-text">{% trans "Preauthorized payments" %}</span>
{% if preauthorized_payments %}
<table class="table">
<thead>
@@ -36,9 +36,9 @@
{% endif %}
</div>
</div>
- <div class="card blue-grey">
- <div class="card-content white-text">
- <span class="card-title">{% trans "Orders ready for shipment" %}</span>
+ <div class="card">
+ <div class="card-content">
+ <span class="card-title black-text">{% trans "Orders ready for shipment" %}</span>
{% if orders_to_ship %}
{% include "dashboard/includes/_orders_table.html" with orders=orders_to_ship %}
{% else %}
@@ -46,24 +46,17 @@
{% endif %}
</div>
</div>
- <div class="card blue-grey">
- <div class="card-content white-text">
- <span class="card-title">{% trans "Low stock" %}</span>
+ <div class="card">
+ <div class="card-content">
+ <span class="card-title black-text">{% trans "Products with low stock" %}</span>
{% if low_stock %}
- <table class="table">
- <thead>
- <tr>
- <th>{% trans "Product" %}</th>
- </tr>
- </thead>
- <tbody>
- {% for product in low_stock %}
- <tr>
- <td><a href="{% url "dashboard:product-update" pk=product.pk %}">{{ product }}</a></td>
- </tr>
- {% endfor %}
- </tbody>
- </table>
+ <ul class="list">
+ {% for product in low_stock %}
+ <li class="list-item">
+ <a class="list-item-name list-item-name--single" href="{% url "dashboard:product-update" pk=product.pk %}">{{ product }}</a>
+ </li>
+ {% endfor %}
+ </ul>
{% else %}
<p>{% trans "No products are low in stock." %}</p>
{% endif %}
diff --git a/saleor/dashboard/templates/dashboard/product/product_form.html b/saleor/dashboard/templates/dashboard/product/product_form.html
index c86fd4b7ac..6c0d91dcd1 100644
--- a/saleor/dashboard/templates/dashboard/product/product_form.html
+++ b/saleor/dashboard/templates/dashboard/product/product_form.html
@@ -143,7 +143,7 @@
</div>
</div>
</div>
- <table class="bordered hoverable data-table">
+ <table class="bordered hoverable responsive data-table">
{% if variants %}
<thead>
<tr>
@@ -226,7 +226,7 @@
</div>
</div>
</div>
- <table class="bordered hoverable data-table">
+ <table class="bordered hoverable responsive data-table">
{% if stock_items %}
<thead>
<tr>
diff --git a/saleor/static/scss/widget/_data-table.scss b/saleor/static/scss/widget/_data-table.scss
index 63981b8aaa..b7b4ab00eb 100644
--- a/saleor/static/scss/widget/_data-table.scss
+++ b/saleor/static/scss/widget/_data-table.scss
@@ -53,6 +53,12 @@
&.hoverable {
box-shadow: none;
}
+
+ .card &:first-child, .card-title + & {
+ th {
+ border-top: none;
+ }
+ }
}
.data-table {
diff --git a/saleor/static/scss/widget/_list.scss b/saleor/static/scss/widget/_list.scss
index 08af7828ab..0b97b38af9 100644
--- a/saleor/static/scss/widget/_list.scss
+++ b/saleor/static/scss/widget/_list.scss
@@ -47,9 +47,13 @@
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
+
+ &--single {
+ margin-bottom: 10px;
+ }
}
- &-price, &-desc {
+ &-price, &-desc, &-name--single {
border-bottom: 1px solid $collection-border-color;
padding-bottom: 12px;
}
@@ -72,6 +76,17 @@
padding-left: 0;
}
}
+
+ .card & {
+ margin-bottom: 0;
+
+ &-item:last-child {
+ .list-item-name {
+ border-bottom: none;
+ padding-bottom: 0;
+ }
+ }
+ }
}
.list {