Commit 8b146047 authored by Matija Obreza's avatar Matija Obreza
Browse files

local:paginate tag

parent 0b108dfb
......@@ -13,15 +13,7 @@
<div class="main-col-header clearfix">
<div class="nav-header pull-left">
<div class="results"><spring:message code="paged.totalElements" arguments="${pagedData.totalElements}" /></div>
<form method="get" action="">
<div class="pagination">
<spring:message code="paged.pageOfPages" arguments="${pagedData.number+1},${pagedData.totalPages}" />
<a href="<spring:url value=""><spring:param name="page" value="${pagedData.number eq 0 ? 1 : pagedData.number}" /></spring:url>"><spring:message code="pagination.previous-page" /></a>
<input class="form-control" style="display: inline; max-width: 5em; text-align: center" type="text" name="page" placeholder="${pagedData.number + 1}" />
<a href="<spring:url value=""><spring:param name="page" value="${pagedData.number+2}" /></spring:url>"><spring:message code="pagination.next-page" /></a>
</div>
</form>
<local:paginate page="${pagedData}" />
</div>
</div>
......
......@@ -13,11 +13,7 @@
<div class="main-col-header clearfix">
<div class="nav-header pull-left">
<div class="results"><spring:message code="paged.totalElements" arguments="${pagedData.totalElements}" /></div>
<div class="pagination">
<spring:message code="paged.pageOfPages" arguments="${pagedData.number+1},${pagedData.totalPages}" />
<a class="${pagedData.number eq 0 ? 'disabled' :''}" href="?page=${pagedData.number eq 0 ? 1 : pagedData.number}"><spring:message code="pagination.previous-page" /></a> <a href="?page=${pagedData.number + 2}"><spring:message code="pagination.next-page" /></a>
</div>
<local:paginate page="${pagedData}" />
</div>
</div>
......
......@@ -12,20 +12,17 @@
</h1>
<div class="main-col-header clearfix">
<div class="nav-header pull-left">
<div class="results"><spring:message code="paged.totalElements" arguments="${pagedData.totalElements}" />
<c:if test="${activeOnly eq true}">
<div class="nav-header">
<div>
<c:if test="${activeOnly eq true}">
<a href="<c:url value="/wiews/active/map" />"><spring:message code="maps.view-map" /></a>
<a href="<c:url value="/wiews/" />"><spring:message code="faoInstitutes.viewAll" /></a>
</c:if>
<c:if test="${activeOnly ne true}">
<a href="<c:url value="/wiews/active" />"><spring:message code="faoInstitutes.viewActiveOnly" /></a>
</c:if>
</div>
<div class="pagination">
<spring:message code="paged.pageOfPages" arguments="${pagedData.number+1},${pagedData.totalPages}" />
<a class="${pagedData.number eq 0 ? 'disabled' :''}" href="?page=${pagedData.number eq 0 ? 1 : pagedData.number}"><spring:message code="pagination.previous-page" /></a> <a href="?page=${pagedData.number + 2}"><spring:message code="pagination.next-page" /></a>
</c:if>
<c:if test="${activeOnly ne true}">
<a href="<c:url value="/wiews/active" />"><spring:message code="faoInstitutes.viewActiveOnly" /></a>
</c:if>
</div>
<local:paginate page="${pagedData}" />
</div>
</div>
......
<%@ tag description="Display pagination block" pageEncoding="UTF-8" %>
<%@ tag body-content="tagdependent" %>
<%@ 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="action" required="false" type="java.lang.String" %>
<%
%>
<form method="get" action="">
<div class="results"><spring:message code="paged.totalElements" arguments="${page.totalElements}" /></div>
<jsp:doBody/>
<div class="paginate">
<span class="">
<spring:message code="paged.pageOfPages" arguments="${page.number+1},${page.totalPages}" />
</span>
<c:if test="${page.number eq 0}">
<a><spring:message code="pagination.previous-page" /></a>
</c:if>
<c:if test="${page.number gt 0}">
<a href="<spring:url value=""><spring:param name="page" value="${page.number eq 0 ? 1 : page.number}" /></spring:url>"><spring:message code="pagination.previous-page" /></a>
</c:if>
<input class="form-control" style="display: inline; max-width: 5em; text-align: center" type="text" name="page" placeholder="${page.number + 1}" />
<c:if test="${page.number ge page.totalPages-1}">
<a><spring:message code="pagination.next-page" /></a>
</c:if>
<c:if test="${page.number lt page.totalPages-1}">
<a href="<spring:url value=""><spring:param name="page" value="${page.number+2}" /></spring:url>"><spring:message code="pagination.next-page" /></a>
</c:if>
</div>
</form>
\ No newline at end of file
......@@ -1136,7 +1136,7 @@ html[dir="rtl"] #stats .stat-lists ol li img {
color:#6f6e69;
}
.main-col .pagination {
.main-col .pagination, .paginate {
font-size:18px;
font-weight:bold;
margin: 10px 0 5px;
......@@ -1149,8 +1149,8 @@ html[dir="rtl"] #stats .stat-lists ol li img {
padding:10px 0;
}
.main-col .pagination a {
padding:0 10px;
.main-col .pagination a, .main-col .paginate a {
padding:0 0px;
text-transform:uppercase;
}
......
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