<%= _.isUndefined(i18n['Total']) ? 'Total':i18n['Total'] %> <%= totalRecords %> <%= _.isUndefined(i18n['records found']) ? 'records found':i18n['records found'] %>
<% if (firstPage != currentPage) { %>
<%= _.isUndefined(i18n['First']) ? 'First':i18n['First'] %>
<% } %>
<% if(totalPages*perPage == totalRecords && lastPage !== 0) { %>
<% lastPage = lastPage - 1 %>
<% } %>
<% if(totalPages*perPage == totalRecords && totalPages !== 0) { %>
<% totalPages = totalPages - 1 %>
<% } %>
<% if (currentPage > firstPage) { %>
<%= _.isUndefined(i18n['Previous']) ? 'Previous':i18n['Previous'] %>
<% } %>
<% if (currentPage - 3 > firstPage) { %>
...
<% } %>
<% if (!_.isNaN(totalPages)) { %>
<% for (p=currentPage-3; p<=currentPage+3; p++) { %>
<% if (p < firstPage || p > lastPage) continue %>
<% if (p*perPage == totalRecords) break%>
<% if (currentPage == p) { %>
<%= p+1 %>
<% } else { %>
<%= p+1 %>
<% } %>
<% } %>
<% if (currentPage + 3 < lastPage) { %>
...
<% } %>
<% if (currentPage < totalPages) { %>
<%= _.isUndefined(i18n['Next']) ? 'Next':i18n['Next'] %>
<% } %>
<% if (lastPage != currentPage) { %>
<%= _.isUndefined(i18n['Last']) ? 'Last':i18n['Last'] %>
<% } %>
<% } %>