Skip to content

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

Refresh template

akjanik051aecd31f58
diff --git a/templates/dashboard/collection/list.html b/templates/dashboard/collection/list.html
index 8276cd825c..f00937ee90 100644
--- a/templates/dashboard/collection/list.html
+++ b/templates/dashboard/collection/list.html
@@ -1,8 +1,12 @@
{% extends 'dashboard/base.html' %}
{% load i18n %}
+{% load staticfiles %}
+{% load utils %}
-{% block title %}{% trans "Collections" %} - {{ block.super }}{% endblock %}
+{% block title %}
+ {% trans "Collections" context "Collections list page title "%} - {{ block.super }}
+{% endblock %}
{% block body_class %}body-collections{% endblock %}
@@ -15,32 +19,49 @@
{% endblock %}
{% block header_extra %}
- <div class="fixed-action-btn">
- <a class="btn-fab btn-floating btn-large waves-effect waves-light teal" title="{% trans "Add collection" %}"
- href="{% url 'dashboard:collection-add' %}">
- <i class="material-icons">add</i>
- </a>
- </div>
+ {% if perms.product.edit_product %}
+ <div class="btn-fab-fixed">
+ <a href="{% url 'dashboard:collection-add' %}" class="btn-fab-default waves-effect waves-light" title="{% trans "Add collection" context 'Collections list add button text' %}">
+ <svg data-src="{% static 'dashboard/images/add.svg' %}"/>
+ </a>
+ </div>
+ {% endif %}
{% endblock %}
{% block content %}
<div class="row">
<div class="col s12">
{% if collections %}
- <ul class="collection list">
- {% for collection in collections %}
- <li class="collection-item list-item list-item--two-lines">
- <a class="list-item-name" href="{% url 'dashboard:collection-update' collection.pk %}">
- {{ collection }}
- <p class="list-item-desc">
- <span>
- {% trans "Products in collection:" %} {{ collection.products.count }}
- </span>
- </p>
- </a>
- </li>
- {% endfor %}
- </ul>
+ <div class="card">
+ <div class="data-table-container">
+ <table class="bordered highlight responsive data-table data-table-description">
+ <thead>
+ <tr>
+ {% trans "Name" context "Collections list table header name" as label %}
+ {% sorting_header 'name' label %}
+
+ {% trans "Products" context "Collections list table header description" as label %}
+ {% sorting_header 'description' label is_wide=True %}
+ </tr>
+ </thead>
+ <tbody>
+ {% for node in collections %}
+ <tr data-action-go="{% if perms.product.edit_product %}{% url 'dashboard:collection-update' node.pk %}{% endif %}">
+ <td>
+ {{ node.name }}
+ </td>
+ <td class="nowrap">
+ {% if node.products %}
+ {% trans "Products in collection:" %} {{ node.products.count }}
+ {% else %}
+ &nbsp;
+ {% endif %}
+ </td>
+ </tr>
+ {% endfor %}
+ </tbody>
+ </div>
+ </div>
{% else %}
<p>{% trans "No collections" %}</p>
{% endif %}