From a615b533057b0a5ed9c64d6ae686a62293f812aa Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 22 May 2017 20:56:08 -0400 Subject: [PATCH] add some admin cp stuff --- Project-Unite/Views/Admin/Index.cshtml | 291 ++++--------------------- 1 file changed, 37 insertions(+), 254 deletions(-) diff --git a/Project-Unite/Views/Admin/Index.cshtml b/Project-Unite/Views/Admin/Index.cshtml index 4839e31..378983e 100644 --- a/Project-Unite/Views/Admin/Index.cshtml +++ b/Project-Unite/Views/Admin/Index.cshtml @@ -5,6 +5,24 @@ @{ ViewBag.Title = "Administration Control Panel"; var db = new ApplicationDbContext(); + + string homeclass = (ViewBag.Page == "home") ? "active" : ""; + string siteconfigclass = (ViewBag.Page == "siteconfig") ? "active" : ""; + string usersclass = (ViewBag.Page == "users") ? "active" : ""; + string rolesclass = (ViewBag.Page == "roles") ? "active" : ""; + string forumsclass = (ViewBag.Page == "forums") ? "active" : ""; + string skinsclass = (ViewBag.Page == "skins") ? "active" : ""; + string groupsclass = (ViewBag.Page == "groups") ? "active" : ""; + string backupsclass = (ViewBag.Page == "backups") ? "active" : ""; + string logsclass = (ViewBag.Page == "logs") ? "active" : ""; + var db = new ApplicationDbContext(); + var users = db.Users; + var roles = new List(); + foreach(var role in db.Roles.ToArray()) + { + roles.Add(role as Role); + } + }
@@ -13,15 +31,15 @@

Navigation

-
-

Administration Control Panel

- -

Welcome to the ShiftOS Administration Control Panel. To begin administrating, select an option from the left.

+
+

Not yet implemented.

-

System status

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current user: @Html.UserLink(User.Identity.GetUserId())
Users:@db.Users.Count()
Forum Categories:@db.ForumCategories.Count()
Posts:@db.ForumPosts.Count()
Topics:@db.ForumTopics.Count()
Skins:@db.Skins.Count()
Releases:@db.Downloads.Count()
- -
- -

Shifting the website

- -

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.

- -

To clone the repository, use this command:

- - @Html.Markdown(@"```bash -git clone https://github.com/MichaelTheShifter/Project-Unite -```") - -

Your changes will be applied after you push your commits to this repository, or your pull request gets merged.

+

Please suggest features to add on this page.

-
-

Site Configuration

+
+

Not yet implemented.

-

This feature is not yet implemented.

-
- - @*ROLES*@ -
-

Roles

- -

Here, you can see a list of all the roles in the system.

- -
    - @for (int i = 0; i < db.Roles.GetPageCount(10); i++) - { - string htmlClass = ""; - if (i == 0) - { - htmlClass = "active"; - } - int page = i + 1; -
  • @page
  • - } -
-
- @for (int i = 0; i < db.Roles.GetPageCount(10); i++) - { - string htmlClass = "tab-pane fade in"; - if (i == 0) - { - htmlClass += " active"; - } -
- - - - - - - @{ - var roles = db.Roles.ToArray(); - roles = roles.OrderByDescending(x => (x as Role).Priority).ToArray(); - } - @foreach (Role role in roles.GetItemsOnPage(i, 10)) - { - - - - - - } -
RolePriorityActions
-

@role.Name

-

ID: @role.Id •Users: @role.Users.Count() • Priority: @role.Priority

-
- @if(role.Priority > 0) - { - - } - @if (role.Priority < roles.Length - 1) - { - - } - - Details -
-
- } -
+

We need to add this in.

- - - @*SKINS*@ -
-

Skins

- -

Below is a list of all skins in the system.

- -
    - @for (int i = 0; i < db.Skins.GetPageCount(10); i++) - { - string htmlClass = ""; - if (i == 0) - { - htmlClass = "active"; - } - int page = i + 1; -
  • @page
  • - } -
-
- @for (int i = 0; i < db.Skins.GetPageCount(10); i++) - { - string htmlClass = "tab-pane fade in"; - if (i == 0) - { - htmlClass += " active"; - } -
- - - - - - @foreach (var skin in db.Skins.OrderByDescending(x => x.PostedAt).ToArray().GetItemsOnPage(i, 10)) - { - - - - - } -
SkinActions
- @Html.ActionLink(skin.Name, "ViewSkin", "Skins", new { id = skin.Id }, null)
-

Created at: @skin.PostedAt • Likes: @skin.Likes.Count() • Dislikes: @skin.Dislikes.Count() • Views: @skin.Views.Count()

-

@Html.Markdown(skin.ShortDescription)

-
- Moderate -
-
- } -
+
+ @Html.Partial("~/Views/Moderator/Users.cshtml", users)
- - - - - @foreach (var user in db.Users.ToArray()) - { - - } - - - @*USERS*@ -
-

Users

- -

Below is a paginated list of all users in the database, most recent users first.

- -
    - @for (int i = 0; i < db.Users.GetPageCount(10); i++) - { - string htmlClass = ""; - if(i == 0) - { - htmlClass = "active"; - } - int page = i + 1; -
  • @page
  • - } -
-
- @for(int i= 0; i < db.Users.GetPageCount(10); i++) - { - string htmlClass = "tab-pane fade in"; - if(i==0) - { - htmlClass += " active"; - } -
- - - - - - @foreach (var user in db.Users.OrderByDescending(x=>x.JoinedAt).ToArray().GetItemsOnPage(i, 10)) - { - - - - - } -
UserActions
- @Html.UserLink(user.Id)
-

Joined on: @user.JoinedAt • Banned: @user.IsBanned • Posts: @user.PostCount • Topics: @user.TopicCount

-
- View Profile - Moderate -
-
- } -
+
+ @Html.Partial("~/Views/Admin/Roles.cshtml", roles)