From 7d52895b197a37877ffe2aff4cc2995d47dc3cac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9DNyymix=E2=80=9D?= Date: Sun, 4 May 2025 10:43:04 +0300 Subject: [PATCH] Update pagination mobile support --- .../gallery/partials/pagination.html | 20 +++++++++++-------- locale/en/LC_MESSAGES/django.po | 3 +++ locale/fi/LC_MESSAGES/django.po | 5 ++++- 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/gallery/templates/gallery/partials/pagination.html b/gallery/templates/gallery/partials/pagination.html index 354cafc..b38be0d 100644 --- a/gallery/templates/gallery/partials/pagination.html +++ b/gallery/templates/gallery/partials/pagination.html @@ -11,29 +11,33 @@ {% else %}
  • « {% trans "Prev" %}
  • {% endif %} - + +
  • + {% blocktrans with current=page_obj.number total=page_obj.paginator.num_pages %}Page {{ current }} of {{ total }}{% endblocktrans %} +
  • + {% if page_obj.number|add:'-3' > 1 %} -
  • 1
  • +
  • 1
  • {% if page_obj.number|add:'-4' > 1 %} -
  • +
  • {% endif %} {% endif %} {% for i in page_obj.paginator.page_range %} {% if page_obj.number == i %} -
  • {{ i }}
  • +
  • {{ i }}
  • {% elif i > page_obj.number|add:'-4' and i < page_obj.number|add:'4' %} -
  • {{ i }}
  • +
  • {{ i }}
  • {% endif %} {% endfor %} {% if page_obj.paginator.num_pages > page_obj.number|add:'3' %} {% if page_obj.number|add:'4' < page_obj.paginator.num_pages %} -
  • +
  • {% endif %} -
  • {{ page_obj.paginator.num_pages }}
  • +
  • {{ page_obj.paginator.num_pages }}
  • {% endif %} - + {% if page_obj.has_next %}
  • {% trans "Next" %} »
  • {% else %} diff --git a/locale/en/LC_MESSAGES/django.po b/locale/en/LC_MESSAGES/django.po index 87477c7..b7e06a9 100644 --- a/locale/en/LC_MESSAGES/django.po +++ b/locale/en/LC_MESSAGES/django.po @@ -146,4 +146,7 @@ msgid "Events photography" msgstr "" msgid "Nyymix.net Gallery" +msgstr "" + +msgid "Page %(current)s of %(total)s" msgstr "" \ No newline at end of file diff --git a/locale/fi/LC_MESSAGES/django.po b/locale/fi/LC_MESSAGES/django.po index 7f58760..6875863 100644 --- a/locale/fi/LC_MESSAGES/django.po +++ b/locale/fi/LC_MESSAGES/django.po @@ -146,4 +146,7 @@ msgid "Events photography" msgstr "Tapahtumavalokuvausta" msgid "Nyymix.net Gallery" -msgstr "Nyymix.net kuvagalleria" \ No newline at end of file +msgstr "Nyymix.net kuvagalleria" + +msgid "Page %(current)s of %(total)s" +msgstr "Sivu %(current)s / %(total)s" \ No newline at end of file