Skip to content

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

Fix some tables' design

dominik-zeglenbcc2694ff509
diff --git a/saleor/static/dashboard/scss/components/_data-table.scss b/saleor/static/dashboard/scss/components/_data-table.scss
index d17090744c..a4f2d87b48 100644
--- a/saleor/static/dashboard/scss/components/_data-table.scss
+++ b/saleor/static/dashboard/scss/components/_data-table.scss
@@ -9,18 +9,6 @@
}
}
- &-description {
- tr {
- th, td {
- padding: 10px 24px;
- p {
- margin: 5px 0 0 0;
- color: color('grey', 'base');
- }
- }
- }
- }
-
&-action {
border-top: 1px solid $table-border-color;
padding: 10px 8px;
@@ -60,7 +48,7 @@
display: block;
}
th, a {
- color: color('teal', 'base');
+ color: $secondary-color;
}
}
}
@@ -129,6 +117,10 @@
padding: 0;
}
+ &.nowrap {
+ white-space: normal;
+ }
+
.dropdown-button {
color: inherit;
display: inline-block;
diff --git a/templates/dashboard/category/list.html b/templates/dashboard/category/list.html
index 5001bc0377..0d25f06a78 100644
--- a/templates/dashboard/category/list.html
+++ b/templates/dashboard/category/list.html
@@ -113,25 +113,30 @@
<div class="card">
<div class="data-table-container">
<table class="bordered highlight responsive data-table data-table-description">
+ <thead>
+ <tr>
+ <th>{% trans "Name" context "Category list table header name" %}</th>
+ <th>{% trans "Description" context "Category list table header description" %}</th>
+ <th>{% trans "Visible" context "Category list table header visible" %}</th>
+ </tr>
+ </thead>
<tbody>
{% for node in categories %}
<tr data-action-go="{% url "dashboard:category-list" root_pk=node.pk %}">
<td>
{{ node.name }}
- <p>
- <span>
- {% if node.description %}
- {{ node.description }}
- {% else %}
- &nbsp;
- {% endif %}
- </span>
- </p>
+ </td>
+ <td class="nowrap">
+ {% if node.description %}
+ {{ node.description }}
+ {% else %}
+ &nbsp;
+ {% endif %}
+ </td>
+ <td class="center-align">
{% if node.hidden %}
- <span>
- <svg data-src="{% static "dashboard/images/visibility_off.svg" %}"
- width="20" height="20"/>
- </span>
+ <svg data-src="{% static "dashboard/images/visibility_off.svg" %}"
+ width="20" height="20"/>
{% endif %}
</td>
</tr>
diff --git a/templates/dashboard/group/list.html b/templates/dashboard/group/list.html
index 4b80ee5dfd..7a1bbb9c99 100644
--- a/templates/dashboard/group/list.html
+++ b/templates/dashboard/group/list.html
@@ -37,18 +37,22 @@
<div class="card">
<div class="data-table-container">
<table class="bordered highlight data-table data-table-description">
+ <thead>
+ <tr>
+ <th>{% trans "Name" context "Dashboard groups list table header name" %}</th>
+ <th>{% trans "Permissions" context "Dashboard groups list table header permissions" %}</th>
+ </tr>
+ </thead>
<tbody>
{% for group in groups %}
<tr data-action-go="{% url 'dashboard:group-details' pk=group.name.pk %}">
<td>
{{ group.name }}
- <p>
- <span>
- {% for permission in group.permissions %}
- {{ permission.name }},
- {% endfor %}
- </span>
- </p>
+ </td>
+ <td>
+ {% for permission in group.permissions %}
+ {{ permission.name }},
+ {% endfor %}
</td>
</tr>
{% endfor %}
diff --git a/templates/dashboard/product/product_attribute/list.html b/templates/dashboard/product/product_attribute/list.html
index 977df7e764..fa1c28a88e 100644
--- a/templates/dashboard/product/product_attribute/list.html
+++ b/templates/dashboard/product/product_attribute/list.html
@@ -37,16 +37,22 @@
<div class="card">
<div class="data-table-container">
<table class="bordered highlight data-table data-table-description">
+ <thead>
+ <tr>
+ <th>{% trans "Name" context "Dashboard attributes list table header name" %}</th>
+ <th>{% trans "Values" context "Dashboard attributes list table header values" %}</th>
+ </tr>
+ </thead>
<tbody>
{% for pk, name, values in attributes %}
<tr data-action-go="{% url 'dashboard:product-attribute-detail' pk=pk %}">
<td>
{{ name }}
- <p>
- {% for value in values %}
- {{ value }}{% if not forloop.last %}, {% endif %}
- {% endfor %}
- </p>
+ </td>
+ <td>
+ {% for value in values %}
+ {{ value }}{% if not forloop.last %}, {% endif %}
+ {% endfor %}
</td>
</tr>
{% endfor %}
diff --git a/templates/dashboard/product/product_class/list.html b/templates/dashboard/product/product_class/list.html
index 31b38693ca..0a5a30f838 100644
--- a/templates/dashboard/product/product_class/list.html
+++ b/templates/dashboard/product/product_class/list.html
@@ -38,29 +38,40 @@
<div class="card">
<div class="data-table-container">
<table class="bordered highlight data-table data-table-description">
+ <thead>
+ <tr>
+ <th>{% trans "Name" context "Dashboard product types list table header name" %}</th>
+ <th>{% trans "Variants" context "Dashboard variants" %}</th>
+ <th>{% trans "Variant attributes" context "Product type item list text" %}</th>
+ <th>{% trans "Product attributes" context "Product type item list text" %}</th>
+ </tr>
+ </thead>
<tbody>
{% for pk, name, has_variants, product_attributes, variant_attributes in product_classes %}
<tr data-action-go="{% url 'dashboard:product-class-update' pk=pk %}">
<td>
{{ name }}
- <p>
- {% trans "Variants" context "Dashboard variants" %}:
- {% if has_variants %}
- {% trans "Yes" %}
- {% else %}
- {% trans "No" %}
- {% endif %}
- {% if variant_attributes %}
- &middot;
- {% trans "Variant attributes" context "Product type item list text" %}
- : {{ variant_attributes|join:", " }}
- {% endif %}
- {% if product_attributes %}
- &middot;
- {% trans "Product attributes" context "Product type item list text" %}
- : {{ product_attributes|join:", " }}
- {% endif %}
- </p>
+ </td>
+ <td>
+ {% if has_variants %}
+ {% trans "Yes" %}
+ {% else %}
+ {% trans "No" %}
+ {% endif %}
+ </td>
+ <td>
+ {% if variant_attributes %}
+ {{ variant_attributes|join:", " }}
+ {% else %}
+ {% trans "None" %}
+ {% endif %}
+ </td>
+ <td>
+ {% if product_attributes %}
+ {{ product_attributes|join:", " }}
+ {% else %}
+ {% trans "None" %}
+ {% endif %}
</td>
</tr>
{% endfor %}
diff --git a/templates/dashboard/product/stock_location/list.html b/templates/dashboard/product/stock_location/list.html
index d69b0631bb..ffce92e8c7 100644
--- a/templates/dashboard/product/stock_location/list.html
+++ b/templates/dashboard/product/stock_location/list.html
@@ -37,6 +37,11 @@
<div class="card">
<div class="data-table-container">
<table class="highlight bordered data-table">
+ <thead>
+ <tr>
+ <th>{% trans "Name" context "Dashboard stock location table header name" %}</th>
+ </tr>
+ </thead>
<tbody>
{% for location in locations %}
<tr data-action-go="