summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael <[email protected]>2017-05-07 11:50:53 -0400
committerMichael <[email protected]>2017-05-07 11:50:53 -0400
commit4fa350c2cfd77a183e96665078823325b6d7d06d (patch)
tree19fe7e5b37e89f693549e9f824e48376817f9d1f
parentce5adf173437eb552b16b1d4d96927e0d62171aa (diff)
downloadproject-unite-4fa350c2cfd77a183e96665078823325b6d7d06d.tar.gz
project-unite-4fa350c2cfd77a183e96665078823325b6d7d06d.tar.bz2
project-unite-4fa350c2cfd77a183e96665078823325b6d7d06d.zip
users page
-rw-r--r--Project-Unite/Views/Admin/Index.cshtml58
1 files changed, 57 insertions, 1 deletions
diff --git a/Project-Unite/Views/Admin/Index.cshtml b/Project-Unite/Views/Admin/Index.cshtml
index 16c0b82..942838e 100644
--- a/Project-Unite/Views/Admin/Index.cshtml
+++ b/Project-Unite/Views/Admin/Index.cshtml
@@ -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> \ No newline at end of file