Skip to content

Commit

Permalink
Fix ellipsis display logic in pagination template
Browse files Browse the repository at this point in the history
Closes #7523
  • Loading branch information
jmooring authored and bep committed Jul 31, 2020
1 parent 21dbfa1 commit 2fa851e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions tpl/tplimpl/embedded/templates.autogen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions tpl/tplimpl/embedded/templates/pagination.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
{{- $shouldEllipse := false -}}
{{- range $pag.Pagers -}}
{{- $right := sub .TotalPages .PageNumber -}}
{{- $showNumber := or (le .PageNumber 3) (eq $right 0) -}}
{{- $showNumber := or $showNumber (and (gt .PageNumber (sub $pag.PageNumber 2)) (lt .PageNumber (add $pag.PageNumber 2))) -}}
{{- $showNumber := or (eq .TotalPages 5) (le .PageNumber 3) (eq $right 0) -}}
{{- if $showNumber -}}
{{- $ellipsed = false -}}
{{- $shouldEllipse = false -}}
Expand Down

0 comments on commit 2fa851e

Please sign in to comment.