From 2be40475029692d0b2e9eebb284353e02d9951c5 Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 22 May 2017 14:50:06 -0400 Subject: [PATCH] paginate userlist --- Project-Unite/Views/Moderator/Users.cshtml | 23 +++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/Project-Unite/Views/Moderator/Users.cshtml b/Project-Unite/Views/Moderator/Users.cshtml index b352d53..70cb92f 100644 --- a/Project-Unite/Views/Moderator/Users.cshtml +++ b/Project-Unite/Views/Moderator/Users.cshtml @@ -1,19 +1,26 @@ @model IEnumerable +@using Project_Unite.Controllers @{ ViewBag.Moderator = true; ViewBag.Title = "Users"; + int pages = Model.ToArray().GetPageCount(15); + var ordered = Model.OrderBy(x => x.DisplayName).ToArray(); }

Users

Below is a list of all users in the database.

- +
+@for (int i = 1; i < pages; i++) +{ + var page = ordered.GetItemsOnPage(i, 15); +
- @foreach (var user in Model) + @foreach (var user in page) { @@ -25,4 +32,14 @@ } -
User Actions
@Html.UserLink(user.Id)
\ No newline at end of file + +} + + + \ No newline at end of file