- {% cache 100 "counters_activity" %}
- {# The sith has no periodic tasks manager
- and using cron jobs would be way too overkill here.
- Thus the barmen timeout is handled in the only place that
- is loaded on every page : the header bar.
- However, let's be clear : this has nothing to do here.
- It's' merely a contrived workaround that should
- replaced by a proper task manager as soon as possible. #}
- {% set _ = Counter.objects.filter(type="BAR").handle_timeout() %}
- {% endcache %}
- {% for bar in Counter.objects.annotate_has_barman(user).annotate_is_open().filter(type="BAR") %}
-
+ {% cache 100 "counters_activity" %}
+ {# The sith has no periodic tasks manager
+ and using cron jobs would be way too overkill here.
+ Thus the barmen timeout is handled in the only place that
+ is loaded on every page : the header bar.
+ However, let's be clear : this has nothing to do here.
+ It's' merely a contrived workaround that should
+ replaced by a proper task manager as soon as possible. #}
+ {% set _ = Counter.objects.filter(type="BAR").handle_timeout() %}
+ {% endcache %}
+ {% for bar in Counter.objects.annotate_has_barman(user).annotate_is_open().filter(type="BAR") %}
+
{% endblock %}
diff --git a/core/templates/core/macros.jinja b/core/templates/core/macros.jinja
index c08053dd..43a90d07 100644
--- a/core/templates/core/macros.jinja
+++ b/core/templates/core/macros.jinja
@@ -166,9 +166,37 @@
current_page (django.core.paginator.Page): the current page object
paginator (django.core.paginator.Paginator): the paginator object
#}
+ {{ paginate_server_side(current_page, paginator, False) }}
+{% endmacro %}
+
+{% macro paginate_htmx(current_page, paginator) %}
+ {# Add pagination buttons for pages without Alpine but supporting framgents.
+
+ This must be coupled with a view that handles pagination
+ with the Django Paginator object and supports framgents.
+
+ The relpaced fragment will be #content so make sure you are calling this macro inside your content block.
+
+ Parameters:
+ current_page (django.core.paginator.Page): the current page object
+ paginator (django.core.paginator.Paginator): the paginator object
+ #}
+ {{ paginate_server_side(current_page, paginator, True) }}
+{% endmacro %}
+
+{% macro paginate_server_side(current_page, paginator, use_htmx) %}