From 47cbf94785454f50e885031992e3c36fa6265d38 Mon Sep 17 00:00:00 2001 From: Eniko Tot <eniko.tot@codebrewery.hu> Date: Thu, 11 Jan 2024 11:11:44 +0100 Subject: [PATCH] [FEATURE] Convert jobs pagination with bootstrap 5, fix setup --- .../TypoScript/Frontend/setup.typoscript | 3 +- .../Bootstrap5/PageBrowser/Index.html | 58 +++++++++++++++++++ 2 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 Resources/Private/Templates/Bootstrap5/PageBrowser/Index.html diff --git a/Configuration/TypoScript/Frontend/setup.typoscript b/Configuration/TypoScript/Frontend/setup.typoscript index 44cc2888..b7834b41 100644 --- a/Configuration/TypoScript/Frontend/setup.typoscript +++ b/Configuration/TypoScript/Frontend/setup.typoscript @@ -54,5 +54,6 @@ config.recordLinks { } [{$plugin.tx_project_theme.config.bootstrapVersion} == 5] - plugin.tx_sgjobs.view.partialRootPaths.0 = EXT:sg_jobs/Resources/Private/Partials/Bootstrap5/ + plugin.tx_sgjobs.view.templateRootPaths.10 = EXT:sg_jobs/Resources/Private/Templates/Bootstrap5/ + plugin.tx_sgjobs.view.partialRootPaths.10 = EXT:sg_jobs/Resources/Private/Partials/Bootstrap5/ [end] diff --git a/Resources/Private/Templates/Bootstrap5/PageBrowser/Index.html b/Resources/Private/Templates/Bootstrap5/PageBrowser/Index.html new file mode 100644 index 00000000..becf1986 --- /dev/null +++ b/Resources/Private/Templates/Bootstrap5/PageBrowser/Index.html @@ -0,0 +1,58 @@ +{namespace sg=SGalinski\SgJobs\ViewHelpers} + +<f:layout name="PageBrowser" /> + +<f:section name="main"> + <f:if condition="{numberOfPages} > 1"> + <nav aria-label="Jobs pagination"> + <ul class="pagination"> + <li class="page-item {f:if(condition: '!{prevPageExist}', then: 'disabled')}"> + <f:variable name="prevPage" value="{currentPage - 1}" /> + <f:link.action addQueryString="1" class="page-link" + additionalParams="{tx_sgjobs_pagebrowser: {currentPage: prevPage}}" + additionalAttributes="{aria-label: 'Previous'}"> + « + </f:link.action> + </li> + + <f:if condition="{enableLessPages} && {showLessPages}"> + <li class="page-item"> + <f:variable name="lessPage" value="{currentPage - 2}" /> + <f:link.action addQueryString="1" class="page-link" + additionalParams="{tx_sgjobs_pagebrowser: {currentPage: lessPage}}"> + ... + </f:link.action> + </li> + </f:if> + + <f:for each="{pageLinks}" as="pageLink"> + <li class="page-item {f:if(condition: '{pageLink.isCurrentPage}', then: 'active')}"> + <f:link.action addQueryString="1" class="page-link" + additionalParams="{tx_sgjobs_pagebrowser: {currentPage: pageLink.page}}"> + {pageLink.number} + </f:link.action> + </li> + </f:for> + + <f:if condition="{enableMorePages} && {showNextPages}"> + <li class="page-item"> + <f:variable name="morePage" value="{currentPage + 2}" /> + <f:link.action addQueryString="1" class="page" + additionalParams="{tx_sgjobs_pagebrowser: {currentPage: morePage}}"> + ... + </f:link.action> + </li> + </f:if> + + <li class="page-item {f:if(condition: '!{nextPageExist}', then: 'disabled')}"> + <f:variable name="nextPage" value="{currentPage + 1}" /> + <f:link.action addQueryString="1" class="page-link" + additionalParams="{tx_sgjobs_pagebrowser: {currentPage: nextPage}}" + additionalAttributes="{aria-label: 'Next'}"> + » + </f:link.action> + </li> + </ul> + </nav> + </f:if> +</f:section> \ No newline at end of file -- GitLab