<f:if condition="{paginator.numberOfPages} > 1">
    <nav class="pagination-wrap">
        <ul class="pagination">
            <f:if condition="{pagination.previousPageNumber} && {pagination.previousPageNumber} >= {pagination.firstPageNumber}">
                <f:then>
                    <li class="page-item">
                        <f:link.action action="index" arguments="{page: 1, searchTerm: searchTerm, orderField: orderField, orderDirection: orderDirection}" title="{f:translate(key:'pagination.first')}" class="page-link">
                            <core:icon identifier="actions-view-paging-first" />
                        </f:link.action>
                    </li>
                    <li class="page-item">
                        <f:link.action action="index" arguments="{page: pagination.previousPageNumber, searchTerm: searchTerm, orderField: orderField, orderDirection: orderDirection}" title="{f:translate(key:'pagination.previous')}" class="page-link">
                            <core:icon identifier="actions-view-paging-previous" />
                        </f:link.action>
                    </li>
                </f:then>
                <f:else>
                    <li class="page-item disabled">
                        <span class="page-link">
                            <core:icon identifier="empty-empty"/>
                        </span>
                    </li>
                    <li class="page-item disabled">
                        <span class="page-link">
                            <core:icon identifier="empty-empty"/>
                        </span>
                    </li>
                </f:else>
            </f:if>
            <li class="page-item">
                <span class="page-link">
                    <f:translate key="pagination.forms" /> {pagination.startRecordNumber} - {pagination.endRecordNumber}
                </span>
            </li>
            <li class="page-item">
                <span class="page-link">
                    <f:translate key="pagination.page" />
                    <form
                        class="form-inline"
                        data-global-event="submit"
                        data-action-navigate="$form=~s/$value/"
                        data-navigate-value="{f:uri.action(action:'index', arguments:'{page: \'$[value]\', searchTerm: searchTerm, orderField: orderField, orderDirection: orderDirection}')}"
                        data-value-selector="input[name='paginator-target-page']">
                        <input
                            min="{pagination.firstPageNumber}"
                            max="{pagination.lastPageNumber}"
                            data-number-of-pages="{paginator.numberOfPages}"
                            name="paginator-target-page"
                            class="form-control form-control-sm paginator-input"
                            size="5"
                            value="{paginator.currentPageNumber}"
                            type="number"/>
                    </form>
                    / {pagination.lastPageNumber}
                </span>
            </li>
            <f:if condition="{pagination.nextPageNumber} && {pagination.nextPageNumber} <= {pagination.lastPageNumber}">
                <f:then>
                    <li class="page-item">
                        <f:link.action action="index" arguments="{page: pagination.nextPageNumber, searchTerm: searchTerm, orderField: orderField, orderDirection: orderDirection}" title="{f:translate(key:'pagination.next')}" class="page-link">
                            <core:icon identifier="actions-view-paging-next" />
                        </f:link.action>
                    </li>
                    <li class="page-item">
                        <f:link.action action="index" arguments="{page: pagination.lastPageNumber, searchTerm: searchTerm, orderField: orderField, orderDirection: orderDirection}" title="{f:translate(key:'pagination.last')}" class="page-link">
                            <core:icon identifier="actions-view-paging-last" />
                        </f:link.action>
                    </li>
                </f:then>
                <f:else>
                    <li class="page-item disabled">
                        <span class="page-link">
                            <core:icon identifier="empty-empty"/>
                        </span>
                    </li>
                    <li class="page-item disabled">
                        <span class="page-link">
                            <core:icon identifier="empty-empty"/>
                        </span>
                    </li>
                </f:else>
            </f:if>
            <li class="page-item">
                <f:link.action action="index" arguments="{page: paginator.currentPageNumber, searchTerm: searchTerm, orderField: orderField, orderDirection: orderDirection}" title="{f:translate(key:'pagination.refresh')}" class="page-link">
                    <core:icon identifier="actions-refresh" />
                </f:link.action>
            </li>
        </ul>
    </nav>
</f:if>
