diff options
-rw-r--r-- | tpl/tplimpl/embedded/templates.autogen.go | 3 | ||||
-rw-r--r-- | tpl/tplimpl/embedded/templates/pagination.html | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/tpl/tplimpl/embedded/templates.autogen.go b/tpl/tplimpl/embedded/templates.autogen.go index 89dd1d469..190c88e32 100644 --- a/tpl/tplimpl/embedded/templates.autogen.go +++ b/tpl/tplimpl/embedded/templates.autogen.go @@ -260,7 +260,8 @@ if (!doNotTrack) { {{- $shouldEllipse := false -}} {{- range $pag.Pagers -}} {{- $right := sub .TotalPages .PageNumber -}} - {{- $showNumber := or (eq .TotalPages 5) (le .PageNumber 3) (eq $right 0) -}} + {{- $showNumber := or (le .PageNumber 3) (eq $right 0) -}} + {{- $showNumber := or $showNumber (and (gt .PageNumber (sub $pag.PageNumber 2)) (lt .PageNumber (add $pag.PageNumber 2))) -}} {{- if $showNumber -}} {{- $ellipsed = false -}} {{- $shouldEllipse = false -}} diff --git a/tpl/tplimpl/embedded/templates/pagination.html b/tpl/tplimpl/embedded/templates/pagination.html index 3c8a7e393..7b60c5d05 100644 --- a/tpl/tplimpl/embedded/templates/pagination.html +++ b/tpl/tplimpl/embedded/templates/pagination.html @@ -13,7 +13,8 @@ {{- $shouldEllipse := false -}} {{- range $pag.Pagers -}} {{- $right := sub .TotalPages .PageNumber -}} - {{- $showNumber := or (eq .TotalPages 5) (le .PageNumber 3) (eq $right 0) -}} + {{- $showNumber := or (le .PageNumber 3) (eq $right 0) -}} + {{- $showNumber := or $showNumber (and (gt .PageNumber (sub $pag.PageNumber 2)) (lt .PageNumber (add $pag.PageNumber 2))) -}} {{- if $showNumber -}} {{- $ellipsed = false -}} {{- $shouldEllipse = false -}} |