From 0943b752dab292c20ff998e429311099f6a8a420 Mon Sep 17 00:00:00 2001 From: OStefan2001 Date: Tue, 11 Aug 2026 21:04:06 +0300 Subject: [PATCH] Fixed pagination with buttons to first and last page --- .../templates/partial/pagination.html.twig | 22 +++++++++++++++++++ .../templates/page/author-resource.html.twig | 13 +---------- src/Blog/templates/page/blog.html.twig | 13 +---------- .../page/category-resource.html.twig | 13 +---------- 4 files changed, 25 insertions(+), 36 deletions(-) create mode 100644 src/App/templates/partial/pagination.html.twig diff --git a/src/App/templates/partial/pagination.html.twig b/src/App/templates/partial/pagination.html.twig new file mode 100644 index 00000000..4169386f --- /dev/null +++ b/src/App/templates/partial/pagination.html.twig @@ -0,0 +1,22 @@ + diff --git a/src/Blog/templates/page/author-resource.html.twig b/src/Blog/templates/page/author-resource.html.twig index ccb80450..4358de08 100644 --- a/src/Blog/templates/page/author-resource.html.twig +++ b/src/Blog/templates/page/author-resource.html.twig @@ -44,18 +44,7 @@ {% if data.lastPage > 1 %} - + {{ include('@partial/pagination.html.twig', {data: data, aria_label: 'Author posts pagination'}) }}

Page {{ data.currentPage }} of {{ data.lastPage }} diff --git a/src/Blog/templates/page/blog.html.twig b/src/Blog/templates/page/blog.html.twig index cae16e01..afd850f4 100644 --- a/src/Blog/templates/page/blog.html.twig +++ b/src/Blog/templates/page/blog.html.twig @@ -40,18 +40,7 @@ {% if data.lastPage > 1 %} -

+ {{ include('@partial/pagination.html.twig', {data: data, aria_label: 'Posts pagination'}) }}

Page {{ data.currentPage }} of {{ data.lastPage }} diff --git a/src/Blog/templates/page/category-resource.html.twig b/src/Blog/templates/page/category-resource.html.twig index 784792e0..5694a5d4 100644 --- a/src/Blog/templates/page/category-resource.html.twig +++ b/src/Blog/templates/page/category-resource.html.twig @@ -42,18 +42,7 @@ {% if data.lastPage > 1 %} -

+ {{ include('@partial/pagination.html.twig', {data: data, aria_label: 'Category posts pagination'}) }}

Page {{ data.currentPage }} of {{ data.lastPage }}