The standard b.o. pager
This commit is contained in:
69
templates/backOffice/default/includes/pagination.html
Normal file
69
templates/backOffice/default/includes/pagination.html
Normal file
@@ -0,0 +1,69 @@
|
||||
{*
|
||||
A generic pager for thelia back-office
|
||||
|
||||
Parameters :
|
||||
|
||||
$loop_ref: the name of the related loop
|
||||
$max_page_count : maximum number of pages to display
|
||||
$page_url : the URL of the page. The parameter page=x is appended to this URL.
|
||||
|
||||
*}
|
||||
|
||||
{* Prepare the URL so that the page=x parameter coumd be safely appended *}
|
||||
|
||||
{if strpos($page_url, '?')}
|
||||
{$page_url="$page_url&"}
|
||||
{else}
|
||||
{$page_url="$page_url?"}
|
||||
{/if}
|
||||
|
||||
<div class="text-center">
|
||||
<ul class="pagination pagination-centered">
|
||||
{pageloop rel=$loop_ref limit=$max_page_count}
|
||||
{$prev_page = $PREV}
|
||||
{$next_page = $NEXT}
|
||||
{$last_page = $LAST}
|
||||
{$has_prev = $CURRENT > 1}
|
||||
{$has_next = $CURRENT < $LAST}
|
||||
|
||||
{$has_pages_after = $END < $LAST && $LAST > $max_page_count}
|
||||
{$has_pages_before = $START > 1}
|
||||
|
||||
{if $PAGE == $START}
|
||||
{if $has_prev}
|
||||
<li><a title="{intl l="Go to first page"}" href="{$page_url}page=1">«</a></li>
|
||||
<li><a title="{intl l="Go to previous page"}" href="{$page_url}page=$prev_page">‹</a></li>
|
||||
|
||||
{if $has_pages_before}
|
||||
<li title="{intl l="More pages before"}" class="disabled"><a href="#">…</a></li>
|
||||
{/if}
|
||||
|
||||
{else}
|
||||
<li class="disabled"><a href="#">«</a></li>
|
||||
<li class="disabled"><a href="#">‹</a></li>
|
||||
{/if}
|
||||
{/if}
|
||||
|
||||
{if $PAGE != $CURRENT}
|
||||
<li><a href="{$page_url}page={$PAGE}">{$PAGE}</a></li>
|
||||
{else}
|
||||
<li class="active"><a href="#">{$PAGE}</a></li>
|
||||
{/if}
|
||||
|
||||
{if $PAGE == $END}
|
||||
{if $has_next}
|
||||
{if $has_pages_after}
|
||||
<li title="{intl l="More pages after"}" class="disabled"><a href="#">…</a></li>
|
||||
{/if}
|
||||
|
||||
<li><a title="{intl l="Go to next page"}" href="{$page_url}page={$next_page}">›</a></li>
|
||||
<li><a title="{intl l="Go to last page"}" href="{$page_url}page={$last_page}">»</a></li>
|
||||
|
||||
{else}
|
||||
<li class="disabled"><a href="#">›</a></li>
|
||||
<li class="disabled"><a href="#">»</a></li>
|
||||
{/if}
|
||||
{/if}
|
||||
{/pageloop}
|
||||
</ul>
|
||||
</div>
|
||||
Reference in New Issue
Block a user