Add dev CP index.

This commit is contained in:
Michael 2017-04-05 18:45:44 -04:00
parent d4c087381f
commit b7457b5d53
4 changed files with 55 additions and 9 deletions

View file

@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace Project_Unite.Controllers
{
[Authorize]
public class DeveloperController : Controller
{
// GET: Developer
public ActionResult Index()
{
ViewBag.Developer = true;
return View();
}
}
}

View file

@ -238,6 +238,7 @@
<Compile Include="App_Start\Startup.Auth.cs" /> <Compile Include="App_Start\Startup.Auth.cs" />
<Compile Include="Controllers\AccountController.cs" /> <Compile Include="Controllers\AccountController.cs" />
<Compile Include="Controllers\AdminController.cs" /> <Compile Include="Controllers\AdminController.cs" />
<Compile Include="Controllers\DeveloperController.cs" />
<Compile Include="Controllers\DownloadController.cs" /> <Compile Include="Controllers\DownloadController.cs" />
<Compile Include="Controllers\ForumController.cs" /> <Compile Include="Controllers\ForumController.cs" />
<Compile Include="Controllers\HomeController.cs" /> <Compile Include="Controllers\HomeController.cs" />
@ -537,6 +538,7 @@
<Content Include="Views\Download\Index.cshtml" /> <Content Include="Views\Download\Index.cshtml" />
<Content Include="Views\Forum\ViewUnread.cshtml" /> <Content Include="Views\Forum\ViewUnread.cshtml" />
<Content Include="Views\Wiki\Index.cshtml" /> <Content Include="Views\Wiki\Index.cshtml" />
<Content Include="Views\Developer\Index.cshtml" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Folder Include="App_Data\" /> <Folder Include="App_Data\" />

View file

@ -1 +1,8 @@
This is/will be the developer cp page. its not done yet 
@{
ViewBag.Title = "Dev Control Panel";
}
<h2>Welcome!</h2>
<p>Hey devs! In the future, this page will give you fancy details on how ShiftOS and the website are progressing. But, that data is not yet available to me - so for now, here's some placeholder text telling you that the dev CP is work-in-progress.</p>

View file

@ -113,6 +113,19 @@
} }
<li>@Html.ActionLink("Audit logs", "Logs", "Moderator")</li> <li>@Html.ActionLink("Audit logs", "Logs", "Moderator")</li>
</ul> </ul>
@RenderBody();
}
else if (ViewBag.Developer)
{
<ul class="nav nav-pills">
<li>@Html.ActionLink("Home", "Index", "Developer")</li>
<li>@Html.ActionLink("Releases", "Releases", "Developer")</li>
<li>@Html.ActionLink("Wiki", "Wiki", "Developer")</li>
<li>@Html.ActionLink("Bugs", "Bugs", "Developer")</li>
</ul>
@RenderBody(); @RenderBody();
} }
else if (ACL.Granted(User.Identity.Name, ViewBag.ACLRule)) else if (ACL.Granted(User.Identity.Name, ViewBag.ACLRule))
@ -121,14 +134,17 @@
{ {
if (ACL.Granted(User.Identity.Name, "CanAccessAdminCP")) if (ACL.Granted(User.Identity.Name, "CanAccessAdminCP"))
{ {
<ul class="nav nav-tabs"> <ul class="nav nav-tabs">
<li>@Html.ActionLink("Home", "Index", "Admin")</li> <li>@Html.ActionLink("Home", "Index", "Admin")</li>
@if (ACL.Granted(User.Identity.Name, "CanEditRoles")) @if (ACL.Granted(User.Identity.Name, "CanEditRoles"))
{ {
<li>@Html.ActionLink("Roles", "Roles", "Admin")</li> <li>@Html.ActionLink("Roles", "Roles", "Admin")</li>
<li>@Html.ActionLink("Access Control", "AccessControl", "Admin")</li> <li>@Html.ActionLink("Access Control", "AccessControl", "Admin")</li>
} }
@if (ACL.Granted(User.Identity.Name, "CanEditProfiles")) @if (ACL.Granted(User.Identity.Name, "CanEditProfiles"))
{ {
<li>@Html.ActionLink("Users", "Users", "Admin")</li> <li>@Html.ActionLink("Users", "Users", "Admin")</li>
@ -139,6 +155,7 @@
} }
<li>@Html.ActionLink("Audit logs", "Logs", "Admin")</li> <li>@Html.ActionLink("Audit logs", "Logs", "Admin")</li>
</ul> </ul>
@RenderBody(); @RenderBody();
} }
else else
@ -149,6 +166,7 @@
} }
else else
{ {
@RenderBody() @RenderBody()
} }