feat: add pagination controls to admin post list
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
82feccf64a
commit
d7a5d425b8
2 changed files with 27 additions and 0 deletions
|
|
@ -26,3 +26,12 @@ func (p PageInfo) PreviousPage() int {
|
|||
func (p PageInfo) NextPage() int {
|
||||
return p.CurrentPage + 1
|
||||
}
|
||||
|
||||
// Pages returns a slice of page numbers for rendering numbered pagination.
|
||||
func (p PageInfo) Pages() []int {
|
||||
pages := make([]int, p.TotalPages)
|
||||
for i := range pages {
|
||||
pages[i] = i + 1
|
||||
}
|
||||
return pages
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue