File "admin-pagination.tmpl"

Full Path: /srv/www/www.cadoro.it/src/templates/admin-pagination.tmpl
File size: 1.5 KB
MIME-type: text/html
Charset: utf-8

{if $params.count gt $params.batch}
  <div class="text-left">
    <ul class="pagination">
      <li><a class="disabled" style="margin-right: 20px;"><strong>Trovati {$params.count} elementi</strong></a></li>
    {if $params.offset ne 0}
      <li><a href="{$batch_url}offset={$params.offset - $params.batch}">&laquo;</a></li>
    {else}
      <li class="disabled"><a href="#">&laquo;</a></li>
    {/if}
    {section name=batch loop=ceil((float)$params.count/(float)$params.batch)}
      {if $smarty.section.batch.rownum eq 1 or
          $smarty.section.batch.rownum ge ($params.offset / $params.batch + 1 - 2 ) and $smarty.section.batch.rownum le ($params.offset / $params.batch + 1 + 2 ) or
          $smarty.section.batch.rownum eq ceil((float)$params.count/(float)$params.batch)}
      <li{if ($smarty.section.batch.rownum - 1) eq ($params.offset / $params.batch) } class="active"{/if}>
        <a href="{$batch_url}offset={($smarty.section.batch.rownum -1) * $params.batch}">{$smarty.section.batch.rownum}</a>
      </li>
      {elseif $smarty.section.batch.rownum eq ($params.offset / $params.batch + 1 - 3 ) or
          $smarty.section.batch.rownum eq ($params.offset / $params.batch + 1 + 3 )}
        <li class="disabled"><a href="#">...</a></li>
      {/if}
    {/section}
    {if $params.offset + $params.batch lt $params.count}
      <li><a href="{$batch_url}offset={$params.offset + $params.batch}">&raquo;</a></li>
    {else}
      <li class="disabled"><a href="#">&raquo;</a></li>
    {/if}
    </ul>
  </div>
{/if}