Created
July 18, 2013 16:10
-
-
Save PierrickP/6030632 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="pagination pagination-centered"> | |
<% | |
var startPagination = (curPage - 5 > 0) ? curPage - 5 : 1; | |
var endPagination = (curPage + 5 < (nbMails / 20)) ? curPage + 5 : nbMails / 20; | |
%> | |
<ul> | |
<li <% if (curPage == 1){ %>class="disabled"<% } %>><a <% if (curPage != 1){%>href="/admin/mail/<%= curPage - 1 %>"<% } %>>«</a></li> | |
<% if (startPagination != 1) { %><li class="disabled"><a>...</a></li><% } %> | |
<% for (var i = startPagination; i <= endPagination ; i++){ %> | |
<li <% if (i == curPage){ %>class="active"<% } %>><a href="/admin/mail/<%= i %>"><%= i %></a></li> | |
<% } %> | |
<% if (endPagination != (nbMails / 20)) { %><li class="disabled"><a>...</a></li><% } %> | |
<li <% if (curPage == Math.round(nbMails / 20)){ %>class="disabled"<% } %>><a <% if (curPage != Math.round(nbMails / 20)){ %>href="/admin/mail/<%= curPage + 1 %>"<% } %>>»</a></li> | |
</ul> | |
</div> |
Author
PierrickP
commented
Jul 18, 2013
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment