<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%--
  ~ This file is part of DebGen Biobank Software developed by ASTRID Research.
  ~ All rights reserved. Reproduction, modification, use or disclosure
  ~ to third parties without express authority is forbidden.
  ~
  ~ Copyright ASTRID Research Inc., Hungary, 2009-2011.
  ~
  ~ ASTRID Research
  ~ Headquaters: Csapo utca 42. Debrecen H-4029 HUNGARY
  ~ Phone: +36-52-533-173        Fax: +36-52-533-174
  ~ Web: http://www.astrid.hu    E-mail: info@astrid.hu
  ~
  ~ Project name: DebGen Biobank Software project.
  ~ URLS:
  ~ Developers: Istvan Zoltan Nagy (istvan.nagy@astrid.hu)
  --%>

<%--
    Document   : pageselector
    Created on : Dec 14, 2009, 10:40:14 AM
    Author     : inagy
--%>

<%@ page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="/WEB-INF/dateformat.tld" prefix="da" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<div class="pageselector">
    <p>
        <span style="font-weight: bold;"><fmt:message key="pages" /></span> &nbsp;
    <c:if test="${current gt 4}">
        <a href="${site}?page=0&size=${size}${refind}&orderBy=${order}&asc=${asc}">1</a> &nbsp;
    </c:if>
    ${current gt 5 ? ' ... &nbsp;' : ''}
    <c:forEach var="p" begin="${current gt 4 ? current - 4 : '0'}" end="${maxpage gt current + 3 ? current + 4 : maxpage}" step="1">
        <c:if test="${p ne current}">
            <a href="${site}?page=${p}&size=${size}${refind}&orderBy=${order}&asc=${asc}">${p+1}</a> &nbsp;
        </c:if>
        <c:if test="${p eq current}">
            <span class="currentpage">${p+1}</span> &nbsp;
        </c:if>
    </c:forEach>
    ${maxpage gt current + 5 ? ' ... &nbsp;' : ''}
    <c:if test="${maxpage gt current + 4}">
        <a href="${site}?page=${maxpage - 1}&size=${size}${refind}&orderBy=${order}&asc=${asc}">${maxpage+1}</a> &nbsp;
    </c:if>
</p>
<p>
    <span style="font-weight: bold;"><fmt:message key="pageSize" /></span> &nbsp;
<c:if test="${5 ne size}">
    <a href="${site}?page=0&size=5${refind}&orderBy=${order}&asc=${asc}">5</a> &nbsp;
</c:if>
<c:if test="${5 eq size}">
    <span class="currentpage">5</span> &nbsp;
</c:if>
<c:if test="${10 ne size}">
    <a href="${site}?page=0&size=10${refind}&orderBy=${order}&asc=${asc}">10</a> &nbsp;
</c:if>
<c:if test="${10 eq size}">
    <span class="currentpage">10</span> &nbsp;
</c:if>
<c:if test="${25 ne size}">
    <a href="${site}?page=0&size=25${refind}&orderBy=${order}&asc=${asc}">25</a> &nbsp;
</c:if>
<c:if test="${25 eq size}">
    <span class="currentpage">25</span> &nbsp;
</c:if>
<c:if test="${50 ne size}">
    <a href="${site}?page=0&size=50${refind}&orderBy=${order}&asc=${asc}">50</a> &nbsp;
</c:if>
<c:if test="${50 eq size}">
    <span class="currentpage">50</span> &nbsp;
</c:if>
<c:if test="${75 ne size}">
    <a href="${site}?page=0&size=75${refind}&orderBy=${order}&asc=${asc}">75</a> &nbsp;
</c:if>
<c:if test="${75 eq size}">
    <span class="currentpage">75</span> &nbsp;
</c:if>
<c:if test="${100 ne size}">
    <a href="${site}?page=0&size=100${refind}&orderBy=${order}&asc=${asc}">100</a> &nbsp;
</c:if>
<c:if test="${100 eq size}">
    <span class="currentpage">100</span> &nbsp;
</c:if>
</p>
</div>
