Commit 1ba29462 authored by Maxim's avatar Maxim
Browse files

Search2 Navigation bug fix

parent 58cc7141
......@@ -3,9 +3,9 @@
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ attribute name="page" required="true"
type="org.springframework.data.domain.Page" %>
<%@ attribute name="page" required="true" type="org.springframework.data.domain.Page" %>
<%@ attribute name="action" required="false" type="java.lang.String" %>
<%@ attribute name="q" required="false" type="java.lang.String" %>
<%--
This is the more civil <nav> version of the pagination
--%>
......@@ -28,15 +28,30 @@
</c:if>
<c:if test="${page.number gt 0}">
<li><a href="?"
aria-label="<spring:message
<c:choose>
<c:when test="${empty q}">
<li><a href="?"
aria-label="<spring:message
code="pagination.previous-page" />">
<span aria-hidden="true">&laquo;</span>
</a></li>
<li><a
href="<spring:url value=""><spring:param name="page" value="${page.number eq 0 ? 1 : page.number}" /></spring:url>"
aria-label="<spring:message
<span aria-hidden="true">&laquo;</span>
</a></li>
<li><a
href="<spring:url value=""><spring:param name="page" value="${page.number eq 0 ? 1 : page.number}" /></spring:url>"
aria-label="<spring:message
code="pagination.previous-page" />">&lsaquo;</a></li>
</c:when>
<c:otherwise>
<li><a href="<spring:url value=""><spring:param name="q" value="${q}" /></spring:url>"
aria-label="<spring:message
code="pagination.previous-page" />">
<span aria-hidden="true">&laquo;</span>
</a></li>
<li><a
href="<spring:url value=""><spring:param name="page" value="${page.number eq 0 ? 1 : page.number}" /><spring:param name="q" value="${q}" /></spring:url>"
aria-label="<spring:message
code="pagination.previous-page" />">&lsaquo;</a></li>
</c:otherwise>
</c:choose>
</c:if>
<li><span class="pagination-input">
......@@ -51,12 +66,25 @@
<li class="disabled"><span aria-label="<spring:message code="pagination.next-page" />">&raquo;</span></li>
</c:if>
<c:if test="${page.number lt page.totalPages-1}">
<li><a
href="<spring:url value=""><spring:param name="page" value="${page.number+2}" /></spring:url>" aria-label="<spring:message
<c:choose>
<c:when test="${empty q}">
<li><a
href="<spring:url value=""><spring:param name="page" value="${page.number+2}" /></spring:url>" aria-label="<spring:message
code="pagination.next-page" />">&rsaquo;</a></li>
<li><a
href="<spring:url value=""><spring:param name="page" value="${page.totalPages}" /></spring:url>" aria-label="<spring:message
code="pagination.next-page" />">&raquo;</a></li>
</c:when>
<c:otherwise>
<li><a
href="<spring:url value=""><spring:param name="page" value="${page.number+2}" /><spring:param name="q" value="${q}" /></spring:url>" aria-label="<spring:message
code="pagination.next-page" />">&rsaquo;</a></li>
<li><a
href="<spring:url value=""><spring:param name="page" value="${page.totalPages}" /></spring:url>" aria-label="<spring:message
<li><a
href="<spring:url value=""><spring:param name="page" value="${page.totalPages}" /><spring:param name="q" value="${q}" /></spring:url>" aria-label="<spring:message
code="pagination.next-page" />">&raquo;</a></li>
</c:otherwise>
</c:choose>
</c:if>
<li><span><spring:message code="paged.pageOfPages" arguments="${page.number+1},${page.totalPages}" /></span></li>
</ul>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment