Skip to content

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

Improve pagination

Paweł Kowalewski922000526e41
diff --git a/saleor/dashboard/templates/dashboard/includes/_pagination.html b/saleor/dashboard/templates/dashboard/includes/_pagination.html
index eb42196658..8bbd969ea9 100644
--- a/saleor/dashboard/templates/dashboard/includes/_pagination.html
+++ b/saleor/dashboard/templates/dashboard/includes/_pagination.html
@@ -1,17 +1,29 @@
{% load i18n %}
{% load utils %}
-<div class="pagination">
- <span class="step-links">
+<ul class="pagination">
+ <li{% if not page_obj.has_previous %} class="disabled"{% endif %}>
{% if page_obj.has_previous %}
- <a href="{% construct_get_query page=page_obj.previous_page_number %}">{% trans "previous" %}</a>
+ <a href="{% construct_get_query page=page_obj.previous_page_number %}">
+ <i class="mdi-navigation-chevron-left"></i>
+ </a>
+ {% else %}
+ <span><i class="mdi-navigation-chevron-left"></i></span>
{% endif %}
-
- <span class="current">
- {% trans "Page" %} {{ page_obj.number }} of {{ paginator.num_pages }}.
- </span>
-
+ </li>
+ {% for page in paginator.page_range %}
+ <li class="{% if page == page_obj.number %}active{% else %}waves-effect{% endif %}">
+ <a href="{% construct_get_query page=page %}">
+ {{ page }}
+ </a>
+ </li>
+ {% endfor %}
+ <li{% if not page_obj.has_next %} class="disabled"{% endif %}>
{% if page_obj.has_next %}
- <a href="{% construct_get_query page=page_obj.next_page_number %}">{% trans "next" %}</a>
+ <a href="{% construct_get_query page=page_obj.next_page_number %}">
+ <i class="mdi-navigation-chevron-right"></i>
+ </a>
+ {% else %}
+ <span><i class="mdi-navigation-chevron-right"></i></span>
{% endif %}
- </span>
-</div>
+ </li>
+</ul>
diff --git a/saleor/static/scss/_app.scss b/saleor/static/scss/_app.scss
index 5287a0f25f..e01fcc4885 100644
--- a/saleor/static/scss/_app.scss
+++ b/saleor/static/scss/_app.scss
@@ -170,4 +170,8 @@ table {
max-width: 300px;
}
+.pagination li.disabled span {
+ color: #999;
+}
+
@import "widget/product-list";