This repository has been archived on 2026-05-31. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
imagerepo/app/templates/_pagination_floating.html
T

38 lines
1.2 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!-- /app/templates/_pagination_floating.html -->
{% set total_pages = images.pages %}
{% set current_page = images.page %}
{% set endpoint = request.endpoint %}
{# Build a merged param dict: query args + path args #}
{% set params = request.args.to_dict(flat=True) %}
{% for k, v in request.view_args.items() %}
{% set _ = params.update({k: v}) %}
{% endfor %}
{# Helper to make a page URL while preserving all other params #}
{% macro page_url(p) -%}
{%- set pmap = params.copy() -%}
{%- set _ = pmap.update({'page': p}) -%}
{{ url_for(endpoint, **pmap) }}
{%- endmacro %}
<div class="floating-pagination">
<a class="fp-btn fp-prev {% if not images.has_prev %}disabled{% endif %}"
{% if images.has_prev %}href="{{ page_url(images.prev_num) }}"{% endif %}
title="Previous page">
</a>
<span class="fp-indicator">
<span class="fp-current">{{ current_page }}</span>
<span class="fp-sep">/</span>
<span class="fp-total">{{ total_pages }}</span>
</span>
<a class="fp-btn fp-next {% if not images.has_next %}disabled{% endif %}"
{% if images.has_next %}href="{{ page_url(images.next_num) }}"{% endif %}
title="Next page">
</a>
</div>