{namespace ig=Internetgalerie\IgRender\ViewHelpers}
{namespace dp=Internetgalerie\IgDatapoolFe\ViewHelpers}
{namespace r=Ig\IgRuckzuckevent\ViewHelpers}
<f:comment>
Page Browser Template.
Copy this to the /Resources/Private/Partials/[controllerName]/ directory if you want to use
a controller-specific pagebrowser.
</f:comment>
<f:if condition="{configuration.insertAbove}">
	<div class="dp-paginator-div dp-paginator-div-top">
		<f:render section="paginator" arguments="{pagination: pagination, configuration: configuration}" />
	</div>
</f:if>

<f:renderChildren arguments="{contentArguments}" />

<f:if condition="{configuration.insertBelow}">
	<div class="dp-paginator-div dp-paginator-div-bottom">
		<f:render section="paginator" arguments="{pagination: pagination, configuration: configuration}" />
	</div>
</f:if>

<f:section name="paginator">
	<ul class="dp-paginator">
		<f:if condition="{pagination.previousPage}">
			<li class="previous">
				<f:if condition="{pagination.previousPage} > 1">
					<f:then>
						<f:widget.link arguments="{currentPage: pagination.previousPage}" addQueryStringMethod="{configuration.addQueryStringMethod}"><ig:translate key="list.prev" /></f:widget.link>
					</f:then>
					<f:else>
						<f:widget.link addQueryStringMethod="{configuration.addQueryStringMethod}"><ig:translate key="list.prev" /></f:widget.link>
					</f:else>
				</f:if>
			</li>
		</f:if>
		<f:if condition="{pagination.displayRangeStart} > 1">
			<li class="first">
				<f:widget.link addQueryStringMethod="{configuration.addQueryStringMethod}">1</f:widget.link>
			</li>
		</f:if>
	<f:if condition="{pagination.hasLessPages}">
			<li class="hasMore">...</li>
	</f:if>
		<f:for each="{pagination.pages}" as="page">
			<f:if condition="{page.isCurrent}">
				<f:then>
					<li class="current">
						{page.number}
					</li>
				</f:then>
				<f:else>
					<li>
						<f:if condition="{page.number} > 1">
							<f:then>
								<f:widget.link arguments="{currentPage: page.number}" addQueryStringMethod="{configuration.addQueryStringMethod}">{page.number}</f:widget.link>
							</f:then>
							<f:else>
								<f:widget.link addQueryStringMethod="{configuration.addQueryStringMethod}">{page.number}</f:widget.link>
							</f:else>
						</f:if>
					</li>
				</f:else>
			</f:if>
		</f:for>

		<f:if condition="{pagination.hasMorePages}">
				<li class="hasMore">...</li>
		</f:if>

		<f:if condition="{pagination.displayRangeEnd} < {pagination.numberOfPages}">
			<li class="last">
				<f:widget.link arguments="{currentPage: pagination.numberOfPages}" addQueryStringMethod="{configuration.addQueryStringMethod}">{pagination.numberOfPages}</f:widget.link>
			</li>
		</f:if>
		<f:if condition="{pagination.nextPage}">
			<li class="next">
				<f:widget.link arguments="{currentPage: pagination.nextPage}" addQueryStringMethod="{configuration.addQueryStringMethod}"><ig:translate key="list.next" /></f:widget.link>
			</li>
		</f:if>
	</ul>
</f:section>
