tpl/collections: Fix slice type handling in sort

The `sort` template func was producing a `[]page.Page` which did not work in `.Paginate`.

Fixes #6023
This commit is contained in:
Bjørn Erik Pedersen
2019-06-09 12:50:53 +02:00
parent 3e6cb2cb77
commit e8a716b23a
6 changed files with 72 additions and 23 deletions

View File

@@ -66,6 +66,12 @@ func ToPages(seq interface{}) (Pages, error) {
return v.Pages(), nil
case PageGroup:
return v.Pages, nil
case []Page:
pages := make(Pages, len(v))
for i, vv := range v {
pages[i] = vv
}
return pages, nil
case []interface{}:
pages := make(Pages, len(v))
success := true