Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Fix inconsistent table style
dominik-zeglenb0be56f52ae4
diff --git a/saleor/static/dashboard/scss/components/_data-table.scss b/saleor/static/dashboard/scss/components/_data-table.scssindex 9ce1b79507..d17090744c 100644--- a/saleor/static/dashboard/scss/components/_data-table.scss+++ b/saleor/static/dashboard/scss/components/_data-table.scss@@ -9,6 +9,18 @@}}+ &-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;diff --git a/templates/dashboard/category/list.html b/templates/dashboard/category/list.htmlindex e0bd7a2c74..5001bc0377 100644--- a/templates/dashboard/category/list.html+++ b/templates/dashboard/category/list.html@@ -5,7 +5,8 @@{% load staticfiles %}{% load utils %}-{% block title %}{% trans "Categories" context "Category list page title" %} - {{ block.super }}{% endblock %}+{% block title %}{% trans "Categories" context "Category list page title" %} -+ {{ block.super }}{% endblock %}{% block body_class %}body-categories{% endblock %}@@ -18,8 +19,8 @@{% else %}{% url 'dashboard:category-list' as url %}{% endif %}- {% include "dashboard/includes/_back-link.html" with url=url %}- {% else %}+ {% include "dashboard/includes/_back-link.html" with url=url %}+ {% else %}{{ block.super }}{% endif %}{% endblock %}@@ -28,23 +29,30 @@{% if perms.product.edit_category %}<div class="fixed-action-btn"><a class="btn-fab btn-floating btn-large waves-effect waves-light"- title="{% trans "Add category" context "Category list add button text" %}"- href="{% if root %}{% url 'dashboard:category-add' root_pk=root.pk %}{% else %}{% url 'dashboard:category-add' %}{% endif %}">- <svg data-src="{% static "dashboard/images/add.svg" %}" />+ title="{% trans "Add category" context "Category list add button text" %}"+ href="+ {% if root %}{% url 'dashboard:category-add' root_pk=root.pk %}{% else %}{% url 'dashboard:category-add' %}{% endif %}">+ <svg data-src="{% static "dashboard/images/add.svg" %}"/></a></div>{% if root %}- <a class="dropdown-button right" href="#" data-activates="category-delete" data-constrainwidth="false">- <svg data-src="{% static "dashboard/images/more_vert.svg" %}" height="24" width="24" />+ <a class="dropdown-button right" href="#" data-activates="category-delete"+ data-constrainwidth="false">+ <svg data-src="{% static "dashboard/images/more_vert.svg" %}" height="24"+ width="24"/></a><ul id="category-delete" class="dropdown-content"><li>- <a class="modal-trigger-custom" data-href="{% url 'dashboard:category-edit' root_pk=root.pk %}" href="#base-modal">+ <a class="modal-trigger-custom"+ data-href="{% url 'dashboard:category-edit' root_pk=root.pk %}"+ href="#base-modal">{% trans "Edit category" context "Dashboard edit action" %}</a></li><li>- <a class="modal-trigger-custom" data-href="{% url 'dashboard:category-delete' pk=root.pk %}" href="#base-modal">+ <a class="modal-trigger-custom"+ data-href="{% url 'dashboard:category-delete' pk=root.pk %}"+ href="#base-modal">{% trans "Remove category" context "Category list action link" %}</a></li>@@ -71,7 +79,8 @@{% if path %}<li class="back-mobile"><a href="{% url 'dashboard:category-list' %}">- <svg data-src="{% static "dashboard/images/arrow_left.svg" %}" fill="#fff" width="20px" height="20px" />+ <svg data-src="{% static "dashboard/images/arrow_left.svg" %}" fill="#fff"+ width="20px" height="20px"/></a></li>{% for node in path %}@@ -83,7 +92,9 @@</li>{% else %}<li class="hide-on-med-and-down">- <a title="{{ node.name }}" href="{% url 'dashboard:category-list' root_pk=node.pk %}" class="breadcrumbs--ellipsed-item">+ <a title="{{ node.name }}"+ href="{% url 'dashboard:category-list' root_pk=node.pk %}"+ class="breadcrumbs--ellipsed-item">{{ node.name }}</a></li>@@ -96,42 +107,53 @@{% block menu_catalogue_class %} active{% endblock %}{% block content %}- {% if categories %}- <ul class="collection list">- {% for node in categories %}- <li class="collection-item list-item">- <a class="list-item-name" href="{% url "dashboard:category-list" root_pk=node.pk %}">- {{ node.name }}- <p class="list-item-desc">- <span>- {% if node.description %}- {{ node.description }}- {% else %}- - {% endif %}- </span>- </p>- {% if node.hidden %}- <span class="list-item-icon">- <svg data-src="{% static "dashboard/images/visibility_off.svg" %}" width="20" height="20" />- </span>- {% endif %}- </a>- </li>- {% endfor %}- </ul>- {% paginate categories %}- {% else %}- <div class="not-found">- {% if root %}- <p class="grey-text">- {% trans "No subcategories." context "Empty Category list message" %}- </p>+ <div class="row">+ <div class="col s12">+ {% if categories %}+ <div class="card">+ <div class="data-table-container">+ <table class="bordered highlight responsive data-table data-table-description">+ <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 %}+ + {% endif %}+ </span>+ </p>+ {% if node.hidden %}+ <span>+ <svg data-src="{% static "dashboard/images/visibility_off.svg" %}"+ width="20" height="20"/>+ </span>+ {% endif %}+ </td>+ </tr>+ {% endfor %}+ </tbody>+ </table>+ </div>+ </div>+ {% paginate categories %}{% else %}- <p class="grey-text">- {% trans "No categories." context "Empty Category list message" %}- </p>+ <div class="not-found">+ {% if root %}+ <p class="grey-text">+ {% trans "No subcategories." context "Empty Category list message" %}+ </p>+ {% else %}+ <p class="grey-text">+ {% trans "No categories." context "Empty Category list message" %}+ </p>+ {% endif %}+ </div>{% endif %}</div>- {% endif %}+ </div>{% endblock %}diff --git a/templates/dashboard/group/list.html b/templates/dashboard/group/list.htmlindex 571ab339e2..4b80ee5dfd 100644--- a/templates/dashboard/group/list.html+++ b/templates/dashboard/group/list.html@@ -13,13 +13,13 @@{% block menu_groups_class %}active{% endblock %}{% block header_extra %}- <div class="fixed-action-btn">- <a class="btn-fab btn-floating btn-large waves-effect waves-light"- title="{% trans "Add group" context "Group list add button text" %}"- href="{% url 'dashboard:group-create' %}">- <svg data-src="{% static "dashboard/images/add.svg" %}" />- </a>- </div>+ <div class="fixed-action-btn">+ <a class="btn-fab btn-floating btn-large waves-effect waves-light"+ title="{% trans "Add group" context "Group list add button text" %}"+ href="{% url 'dashboard:group-create' %}">+ <svg data-src="{% static "dashboard/images/add.svg" %}"/>+ </a>+ </div>{% endblock %}{% block breadcrumbs %}@@ -31,32 +31,40 @@{% endblock %}{% block content %}- {% if groups %}- <ul class="collection list">- {% for group in groups %}- <li class="collection-item list-item">- <a class="list-item-name" href="{% url 'dashboard:group-details' pk=group.name.pk %}">- {{ group.name }}- <p class="list-item-desc">- <span>- {% for permission in group.permissions %}- {{ permission.name }},- {% endfor %}- </span>- </p>- </a>- </li>- {% endfor %}- </ul>- {% else %}- <div class="card-content card-content--no-data not-found">- <p class="grey-text">- {% trans "No groups found." context "Empty group table message" %}- </p>+ <div class="row">+ <div class="col s12">+ {% if groups %}+ <div class="card">+ <div class="data-table-container">+ <table class="bordered highlight data-table data-table-description">+ <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>+ </tr>+ {% endfor %}+ </tbody>+ </table>+ </div>+ </div>+ {% paginate groups %}+ {% else %}+ <div class="card-content card-content--no-data not-found">+ <p class="grey-text">+ {% trans "No groups found." context "Empty group table message" %}+ </p>+ </div>+ {% endif %}</div>- {% endif %}-- {% paginate groups %}-+ </div>{% endblock %}diff --git a/templates/dashboard/product/product_attribute/list.html b/templates/dashboard/product/product_attribute/list.htmlindex b7e75295a1..977df7e764 100644--- a/templates/dashboard/product/product_attribute/list.html+++ b/templates/dashboard/product/product_attribute/list.html@@ -31,28 +31,37 @@{% block menu_catalogue_class %} active{% endblock %}{% block content %}- {% if attributes %}- <ul class="collection list">- {% for pk, name, values in attributes %}- <li class="collection-item list-item">- <a class="list-item-name" href="{% url 'dashboard:product-attribute-detail' pk=pk %}">- {{ name }}- <p class="list-item-desc">- {% for value in values %}- {{ value }}- {% if not forloop.last %}, {% endif %}- {% endfor %}- </p>- </a>- </li>- {% endfor %}- </ul>- {% paginate attributes %}- {% else %}- <div class="not-found">- <p class="grey-text">- {% trans "No attributes found." context "Empty attribute list message" %}- </p>+ <div class="row">+ <div class="col s12">+ {% if attributes %}+ <div class="card">+ <div class="data-table-container">+ <table class="bordered highlight data-table data-table-description">+ <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>+ </tr>+ {% endfor %}+ </tbody>+ </table>+ </div>+ </div>+ {% paginate attributes %}+ {% else %}+ <div class="not-found">+ <p class="grey-text">+ {% trans "No attributes found." context "Empty attribute list message" %}+ </p>+ </div>+ {% endif %}</div>- {% endif %}+ </div>{% endblock %}diff --git a/templates/dashboard/product/product_class/list.html b/templates/dashboard/product/product_class/list.htmlindex 8c1e8fbfe0..31b38693ca 100644--- a/templates/dashboard/product/product_class/list.html+++ b/templates/dashboard/product/product_class/list.html@@ -35,31 +35,39 @@<div class="row"><div class="col s12">{% if product_classes %}- <ul class="collection list">- {% for pk, name, has_variants, product_attributes, variant_attributes in product_classes %}- <li class="collection-item list-item">- <a class="title" href="{% url 'dashboard:product-class-update' pk=pk %}">- <span class="list-item-name">- {{ name }}- </span>- <p class="list-item-desc">- {% trans "Variants" context "Dashboard variants" %}:- {% if has_variants %}- {% trans "Yes" %}- {% else %}- {% trans "No" %}- {% endif %}- {% if variant_attributes %}- · {% trans "Variant attributes" context "Product type item list text" %}: {{ variant_attributes|join:", " }}- {% endif %}- {% if product_attributes %}- · {% trans "Product attributes" context "Product type item list text" %}: {{ product_attributes|join:", " }}- {% endif %}- </p>- </a>- </li>- {% endfor %}- </ul>+ <div class="card">+ <div class="data-table-container">+ <table class="bordered highlight data-table data-table-description">+ <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 %}+ ·+ {% trans "Variant attributes" context "Product type item list text" %}+ : {{ variant_attributes|join:", " }}+ {% endif %}+ {% if product_attributes %}+ ·+ {% trans "Product attributes" context "Product type item list text" %}+ : {{ product_attributes|join:", " }}+ {% endif %}+ </p>+ </td>+ </tr>+ {% endfor %}+ </tbody>+ </table>+ </div>+ </div>{% paginate product_classes %}{% else %}<div class="not-found">diff --git a/templates/dashboard/product/stock_location/list.html b/templates/dashboard/product/stock_location/list.htmlindex 5836a77bce..d69b0631bb 100644--- a/templates/dashboard/product/stock_location/list.html+++ b/templates/dashboard/product/stock_location/list.html@@ -34,17 +34,20 @@<div class="row"><div class="col s12">{% if locations %}- <ul class="collection list">- {% for location in locations %}- <li class="collection-item list-item">- <a href="{% if perms.product.edit_stock_location %}{% url 'dashboard:product-stock-location-edit' location.pk %}{% endif %}">- <p class="list-item-name--single">- {{ location }}- </p>- </a>- </li>- {% endfor %}- </ul>+ <div class="card">+ <div class="data-table-container">+ <table class="highlight bordered data-table">+ <tbody>+ {% for location in locations %}+ <tr data-action-go="+ {% if perms.product.edit_stock_location %}{% url 'dashboard:product-stock-location-edit' location.pk %}{% endif %}">+ <td>{{ location }}</td>+ </tr>+ {% endfor %}+ </tbody>+ </table>+ </div>+ </div>{% paginate locations %}{% else %}<div class="not-found">