diff --git a/club/templates/club/club_sellings.jinja b/club/templates/club/club_sellings.jinja index 184abda7..4928e356 100644 --- a/club/templates/club/club_sellings.jinja +++ b/club/templates/club/club_sellings.jinja @@ -1,5 +1,33 @@ {% extends "core/base.jinja" %} -{% from 'core/macros.jinja' import user_profile_link, paginate %} +{% from 'core/macros.jinja' import user_profile_link %} + +{# This page uses a custom macro instead of the core `paginate_jinja` and `paginate_alpine` +because it works with a somewhat dynamic form, +but was written before Alpine was introduced in the project. +TODO : rewrite the pagination used in this template an Alpine one +#} +{% macro paginate(page_obj, paginator, js_action) %} + {% set js = js_action|default('') %} + {% if page_obj.has_previous() or page_obj.has_next() %} + {% if page_obj.has_previous() %} + {% trans %}Previous{% endtrans %} + {% else %} + {% trans %}Previous{% endtrans %} + {% endif %} + {% for i in paginator.page_range %} + {% if page_obj.number == i %} + {{ i }} ({% trans %}current{% endtrans %}) + {% else %} + {{ i }} + {% endif %} + {% endfor %} + {% if page_obj.has_next() %} + {% trans %}Next{% endtrans %} + {% else %} + {% trans %}Next{% endtrans %} + {% endif %} + {% endif %} +{% endmacro %} {% block content %}

{% trans %}Sales{% endtrans %}

@@ -53,7 +81,6 @@ {% endfor %} - {# TODO: Replace this pagination by an Alpine pagination #}