Updating pagination to use the total item count instead of a has next page bool for better flexibility.

--HG--
branch : dev
This commit is contained in:
Nathan Heskew
2010-11-02 00:25:25 -07:00
parent f4721065b9
commit 10a7abd278
10 changed files with 45 additions and 40 deletions

View File

@@ -88,8 +88,7 @@ namespace Orchard.Core.Contents.Controllers {
var list = Shape.List();
list.AddRange(pageOfContentItems.Select(ci => _contentManager.BuildDisplay(ci, "SummaryAdmin")));
var hasNextPage = query.Slice(pager.GetStartIndex(pager.Page + 1), 1).Any();
var pagerShape = Shape.Pager(pager).HasNextPage(hasNextPage);
var pagerShape = Shape.Pager(pager).TotalItemCount(query.Count());
var viewModel = Shape.ViewModel()
.ContentItems(list)