{if $pages && $pages|@count gt 1}
{assign var=padding value=2}
{if $actual_page == 1}
{else}
Prev
{/if}
{foreach from=$pages item=page_link key=pager_number}
{if $pager_number == 1}
{* *}
{/if}
{if $actual_page - $padding == $pager_number && $actual_page - $padding > 1 && $actual_page - $padding -1 > 1}
{* *}
{* *}
{/if}
{if $pager_number!=1 && $pager_number!=$last_page && $pager_number>=$actual_page-$padding && $pager_number<=$actual_page+$padding}
{/if}
{if $actual_page + $padding == $pager_number && $actual_page + $padding < $last_page && $actual_page + $padding + 1 < $last_page}
{* *}
{/if}
{if $pager_number == $last_page}
{* *}
{/if}
{/foreach}
{if $actual_page == $last_page}
{else}
Next
{/if}
{else}
{/if}