Skip to content

Commit

Permalink
embedded: Always show page number when 5 pages or less
Browse files Browse the repository at this point in the history
Fixes #7523
  • Loading branch information
moorereason authored and bep committed Oct 16, 2020
1 parent acfa153 commit 08e4f9f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions tpl/tplimpl/embedded/templates.autogen.go

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

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

0 comments on commit 08e4f9f

Please sign in to comment.