- {% 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") %}
+
{% endif %}
@@ -74,8 +79,11 @@
{% if user.profile_pict %}
{% else %}
-
+
{% endif %}
@@ -166,9 +174,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 fragments.
+
+ This must be coupled with a view that handles pagination
+ with the Django Paginator object and supports fragments.
+
+ The replaced 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) %}