mirror of
https://github.com/lempamo/Project-Unite.git
synced 2025-04-20 00:10:24 +00:00
286 lines
No EOL
14 KiB
Text
286 lines
No EOL
14 KiB
Text
@using Project_Unite.Models;
|
|
@using Microsoft.AspNet.Identity;
|
|
@using Project_Unite.Controllers;
|
|
|
|
@{
|
|
ViewBag.Title = "Administration Control Panel";
|
|
var db = new ApplicationDbContext();
|
|
}
|
|
|
|
<div class="panel row">
|
|
<div class="panel-body">
|
|
<div class="col-xs-4">
|
|
<h4>Navigation</h4>
|
|
|
|
<ul class="nav nav-stacked nav-tabs" id="tabs" data-tabs="tabs" role="tablist">
|
|
<li class="active"><a data-toggle="tab" href="#a_index">Home</a></li>
|
|
<li><a data-toggle="tab" href="#a_site_config">Site Config</a></li>
|
|
<li><a data-toggle="tab" href="#a_users">Users</a></li>
|
|
<li><a data-toggle="tab" href="#a_roles">Roles</a></li>
|
|
<li><a data-toggle="tab" href="#a_forums">Forums</a></li>
|
|
<li><a data-toggle="tab" href="#a_skins">Skins</a></li>
|
|
<li><a data-toggle="tab" href="#a_groups">Groups</a></li>
|
|
<li><a data-toggle="tab" href="#a_backups">Backups</a></li>
|
|
<li><a data-toggle="tab" href="#a_logs">Audit Logs</a></li>
|
|
|
|
|
|
|
|
</ul>
|
|
</div>
|
|
<div class="col-xs-8">
|
|
<div class="tab-content">
|
|
<div class="tab-pane fade in active" id="a_index">
|
|
<h2>Administration Control Panel</h2>
|
|
|
|
<p>Welcome to the ShiftOS Administration Control Panel. To begin administrating, select an option from the left.</p>
|
|
|
|
<h4>System status</h4>
|
|
|
|
<table class="table-condensed">
|
|
<tr>
|
|
<td><strong>Current user: </strong></td>
|
|
<td>@Html.UserLink(User.Identity.GetUserId())</td>
|
|
</tr>
|
|
<tr>
|
|
<td><strong>Users:</strong></td>
|
|
<td>@db.Users.Count()</td>
|
|
</tr>
|
|
<tr>
|
|
<td><strong>Forum Categories:</strong></td>
|
|
<td>@db.ForumCategories.Count()</td>
|
|
</tr>
|
|
<tr>
|
|
<td><strong>Posts:</strong></td>
|
|
<td>@db.ForumPosts.Count()</td>
|
|
</tr>
|
|
<tr>
|
|
<td><strong>Topics:</strong></td>
|
|
<td><strong>@db.ForumTopics.Count()</strong></td>
|
|
</tr>
|
|
<tr>
|
|
<td><strong>Skins:</strong></td>
|
|
<td>@db.Skins.Count()</td>
|
|
</tr>
|
|
<tr>
|
|
<td><strong>Releases:</strong></td>
|
|
<td>@db.Downloads.Count()</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<hr/>
|
|
|
|
<h4>Shifting the website</h4>
|
|
|
|
<p>You can add new features to the website by modifying our GitHub repository. If you are a ShiftOS developer, chances are you have write access to the repository. If not, please contact Michael.</p>
|
|
|
|
<p>To clone the repository, use this command:</p>
|
|
|
|
@Html.Markdown(@"```bash
|
|
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 class="tab-pane fade in" id="a_site_config">
|
|
<h2>Site Configuration</h2>
|
|
|
|
<p>This feature is not yet implemented.</p>
|
|
</div>
|
|
|
|
@*ROLES*@
|
|
<div class="tab-pane fade in" id="a_roles">
|
|
<h2>Roles</h2>
|
|
|
|
<p>Here, you can see a list of all the roles in the system.</p>
|
|
|
|
<ul class="pagination" data-tabs="roletabs" id="roletabs">
|
|
@for (int i = 0; i < db.Roles.GetPageCount(10); i++)
|
|
{
|
|
string htmlClass = "";
|
|
if (i == 0)
|
|
{
|
|
htmlClass = "active";
|
|
}
|
|
int page = i + 1;
|
|
<li class="@htmlClass"><a data-toggle="tab" href="#r_page_@i">@page</a></li>
|
|
}
|
|
</ul>
|
|
<div class="tab-content">
|
|
@for (int i = 0; i < db.Roles.GetPageCount(10); i++)
|
|
{
|
|
string htmlClass = "tab-pane fade in";
|
|
if (i == 0)
|
|
{
|
|
htmlClass += " active";
|
|
}
|
|
<div class="@htmlClass" id="r_page_@i">
|
|
<table class="table">
|
|
<tr>
|
|
<th style="width:45%">Role</th>
|
|
<th>Priority</th>
|
|
<th>Actions</th>
|
|
</tr>
|
|
@{
|
|
var roles = db.Roles.ToArray();
|
|
roles = roles.OrderByDescending(x => (x as Role).Priority).ToArray();
|
|
}
|
|
@foreach (Role role in roles.GetItemsOnPage(i, 10))
|
|
{
|
|
<tr>
|
|
<td>
|
|
<p class="color: @role.ColorHex">@role.Name</p>
|
|
<p>ID: @role.Id •Users: @role.Users.Count() • Priority: @role.Priority</p>
|
|
</td>
|
|
<td>
|
|
@if(role.Priority > 0)
|
|
{
|
|
<a href="@Url.Action("DecreaseRolePriority", "Admin", new {id=role.Id})" class="btn btn-default"><span class="glyphicon glyphicon-arrow-down"></span></a>
|
|
}
|
|
@if (role.Priority < roles.Length - 1)
|
|
{
|
|
<a href="@Url.Action("IncreaseRolePriority", "Admin", new {id=role.Id})" class="btn btn-default"><span class="glyphicon glyphicon-arrow-up"></span></a>
|
|
}
|
|
</td>
|
|
<td>
|
|
<a href="@Url.Action("RoleDetails", "Admin", new {id=role.Id})" class="btn btn-default"><span class="glyphicon glyphicon-dashboard"></span> Details</a>
|
|
</td>
|
|
</tr>
|
|
}
|
|
</table>
|
|
</div>
|
|
}
|
|
</div>
|
|
</div>
|
|
|
|
|
|
@*SKINS*@
|
|
<div class="tab-pane fade in" id="a_skins">
|
|
<h2>Skins</h2>
|
|
|
|
<p>Below is a list of all skins in the system.</p>
|
|
|
|
<ul class="pagination" data-tabs="skintabs" id="skintabs">
|
|
@for (int i = 0; i < db.Skins.GetPageCount(10); i++)
|
|
{
|
|
string htmlClass = "";
|
|
if (i == 0)
|
|
{
|
|
htmlClass = "active";
|
|
}
|
|
int page = i + 1;
|
|
<li class="@htmlClass"><a data-toggle="tab" href="#skn_page_@i">@page</a></li>
|
|
}
|
|
</ul>
|
|
<div class="tab-content">
|
|
@for (int i = 0; i < db.Skins.GetPageCount(10); i++)
|
|
{
|
|
string htmlClass = "tab-pane fade in";
|
|
if (i == 0)
|
|
{
|
|
htmlClass += " active";
|
|
}
|
|
<div class="@htmlClass" id="skn_page_@i">
|
|
<table class="table">
|
|
<tr>
|
|
<th style="width:65%">Skin</th>
|
|
<th>Actions</th>
|
|
</tr>
|
|
@foreach (var skin in db.Skins.OrderByDescending(x => x.PostedAt).ToArray().GetItemsOnPage(i, 10))
|
|
{
|
|
<tr>
|
|
<td>
|
|
@Html.ActionLink(skin.Name, "ViewSkin", "Skins", new { id = skin.Id }, null) <br />
|
|
<p>Created at: @skin.PostedAt • Likes: @skin.Likes.Count() • Dislikes: @skin.Dislikes.Count() • Views: @skin.Views.Count()</p>
|
|
<p>@Html.Markdown(skin.ShortDescription)</p>
|
|
</td>
|
|
<td>
|
|
<a href="@Url.Action("ModerateSkin", "Moderator", new {id=skin.Id})" class="btn btn-warning"><span class="glyphicon glyphicon-wrench">Moderate</span></a>
|
|
</td>
|
|
</tr>
|
|
}
|
|
</table>
|
|
</div>
|
|
}
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
@foreach (var user in db.Users.ToArray())
|
|
{
|
|
<div class="modal fade" id="u_details_@user.DisplayName">
|
|
<div class="modal-dialog" role="document">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h5 class="modal-title">Users</h5>
|
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
|
<span aria-hidden="true">×</span>
|
|
</button>
|
|
</div>
|
|
<div class="modal-body">
|
|
@Html.Partial("~/Views/Moderator/UserDetails.cshtml", user)
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-primary" data-dismiss="modal" data-target="#u_details_@user.DisplayName">Close</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
}
|
|
|
|
|
|
@*USERS*@
|
|
<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 • Banned: @user.IsBanned • Posts: @user.PostCount • 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 data-toggle="modal" href="#u_details_@user.DisplayName" class="btn btn-warning"><span class="glyphicon glyphicon-wrench"></span> Moderate</a>
|
|
</td>
|
|
</tr>
|
|
}
|
|
</table>
|
|
</div>
|
|
}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div> |