From bffc4e12fe6d255e1fb8d28943993afc7e99e010 Mon Sep 17 00:00:00 2001 From: Joe Mooring Date: Wed, 5 Aug 2020 12:36:48 -0400 Subject: [PATCH] Revert "Fix ellipsis display logic in pagination template" This reverts commit 2fa851e6500752c0cea1da5cfdfc6d99e0a81a71. --- tpl/tplimpl/embedded/templates.autogen.go | 3 ++- 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 89dd1d4690e..190c88e3286 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 3c8a7e393f7..7b60c5d0591 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 -}}