|
|
@@ -15,14 +15,13 @@
|
|
|
*/
|
|
|
package io.jpress.core.render.freemarker;
|
|
|
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.List;
|
|
|
-
|
|
|
import com.jfinal.plugin.activerecord.Page;
|
|
|
-
|
|
|
import io.jpress.model.query.OptionQuery;
|
|
|
import io.jpress.utils.StringUtils;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
public abstract class BasePaginateTag extends JTag {
|
|
|
|
|
|
final Page<?> page;
|
|
|
@@ -59,20 +58,20 @@ public abstract class BasePaginateTag extends JTag {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- int startPage = currentPage - 4;
|
|
|
+ int startPage = currentPage - 3;
|
|
|
if (startPage < 1) {
|
|
|
startPage = 1;
|
|
|
}
|
|
|
- int endPage = currentPage + 4;
|
|
|
+ int endPage = currentPage + 3;
|
|
|
if (endPage > totalPage) {
|
|
|
endPage = totalPage;
|
|
|
}
|
|
|
|
|
|
- if (currentPage <= 8) {
|
|
|
+ if (currentPage <= 6) {
|
|
|
startPage = 1;
|
|
|
}
|
|
|
|
|
|
- if ((totalPage - currentPage) < 8) {
|
|
|
+ if ((totalPage - currentPage) < 6) {
|
|
|
endPage = totalPage;
|
|
|
}
|
|
|
|
|
|
@@ -83,7 +82,7 @@ public abstract class BasePaginateTag extends JTag {
|
|
|
pages.add(new PaginateItem(previousClass, getUrl(currentPage - 1), previousText));
|
|
|
}
|
|
|
|
|
|
- if (currentPage > 8 && !onlyShowPreviousAndNext) {
|
|
|
+ if (currentPage > 6 && !onlyShowPreviousAndNext) {
|
|
|
pages.add(new PaginateItem("", getUrl(1), "1"));
|
|
|
pages.add(new PaginateItem("", getUrl(2), "2"));
|
|
|
pages.add(new PaginateItem(disabledClass, "javascript:;", "..."));
|
|
|
@@ -99,7 +98,7 @@ public abstract class BasePaginateTag extends JTag {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if ((totalPage - currentPage) >= 8 && !onlyShowPreviousAndNext) {
|
|
|
+ if ((totalPage - currentPage) >= 6 && !onlyShowPreviousAndNext) {
|
|
|
pages.add(new PaginateItem(disabledClass, "javascript:;", "..."));
|
|
|
pages.add(new PaginateItem("", getUrl(totalPage - 1), totalPage - 1));
|
|
|
pages.add(new PaginateItem("", getUrl(totalPage), totalPage));
|