blob: 8ad4ac4807989d335829558073d58293c22cd7a7 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
@model IEnumerable<Project_Unite.Models.ApplicationUser>
@using Project_Unite.Controllers
@{
ViewBag.Moderator = true;
ViewBag.Title = "Users";
int pages = Model.ToArray().GetPageCount(15);
var ordered = Model.OrderBy(x => x.DisplayName).ToArray();
}
<h2>Users</h2>
<p>Below is a list of all users in the database.</p>
<div class="tab-content" >
@for (int i = 1; i < pages; i++)
{
string a = (i == 1) ? "active" : "";
var page = ordered.GetItemsOnPage(i, 15);
<table class="tab-pane fade in @a table" id="u_page_@i">
<tr>
<th style="width:85%">User</th>
<th>Actions</th>
</tr>
@foreach (var user in page)
{
<tr>
<td>@Html.UserLink(user.Id)</td>
<td>
@Html.ActionLink("User details", "UserDetails", "Moderator", new { id = user.DisplayName }, new { @class = "btn btn-default" })
</td>
</tr>
}
</table>
}
</div>
<ul class="pagination" data-tabs="tabs" id="u_pages">
@for(int i = 1; i < pages; i++)
{
string a = (i == 1) ? "active" : "";
<li class="@a"><a href="#u_page_@i" data-toggle="tab">@i</a></li>
}
</ul>
|