users page

This commit is contained in:
Michael 2017-05-07 11:50:53 -04:00
parent ce5adf1734
commit 4fa350c2cf

View file

@ -1,5 +1,7 @@
@using Project_Unite.Models;
@using Microsoft.AspNet.Identity;
@using Project_Unite.Controllers;
@{
ViewBag.Title = "Administration Control Panel";
var db = new ApplicationDbContext();
@ -79,7 +81,61 @@ git clone https://github.com/MichaelTheShifter/Project-Unite
<p>Your changes will be applied after you push your commits to this repository, or your pull request gets merged.</p>
</div>
</div>
<div class="tab-pane fade in" id="a_site_config">
<h2>Site Configuration</h2>
<p>This feature is not yet implemented.</p>
</div>
<div class="tab-pane fade in" id="a_users">
<h2>Users</h2>
<p>Below is a paginated list of all users in the database, most recent users first.</p>
<ul class="pagination" data-tabs="usertabs" id="usertabs" >
@for (int i = 0; i < db.Users.GetPageCount(10); i++)
{
string htmlClass = "";
if(i == 0)
{
htmlClass = "active";
}
int page = i + 1;
<li class="@htmlClass"><a data-toggle="tab" href="#u_page_@i">@page</a></li>
}
</ul>
<div class="tab-content">
@for(int i= 0; i < db.Users.GetPageCount(10); i++)
{
string htmlClass = "tab-pane fade in";
if(i==0)
{
htmlClass += " active";
}
<div class="@htmlClass" id="u_page_@i">
<table class="table">
<tr>
<th style="width:65%">User</th>
<th>Actions</th>
</tr>
@foreach (var user in db.Users.OrderByDescending(x=>x.JoinedAt).ToArray().GetItemsOnPage(i, 10))
{
<tr>
<td>
@Html.UserLink(user.Id) <br/>
<p>Joined on: @user.JoinedAt &bull; Banned: @user.IsBanned &bull; Posts: @user.PostCount &bull; Topics: @user.TopicCount</p>
</td>
<td>
<a href="@Url.Action("ViewProfile", "Profiles", new { id = user.DisplayName })" class="btn btn-default"><span class="glyphicon glyphicon-user"></span> View Profile</a>
<a href="@Url.Action("UserDetails", "Moderator", new {id=user.DisplayName})" class="btn btn-warning"><span class="glyphicon glyphicon-wrench"></span> Moderate</a>
</td>
</tr>
}
</table>
</div>
}
</div>
</div>
</div>
</div>
</div>
</div>