slight devcp ui revamp

This commit is contained in:
Michael 2017-05-22 11:42:05 -04:00
parent ba7bfaabc5
commit 15f1eef6f2
4 changed files with 37 additions and 54 deletions

View file

@ -14,9 +14,9 @@ namespace Project_Unite.Controllers
public class DeveloperController : Controller public class DeveloperController : Controller
{ {
// GET: Developer // GET: Developer
public ActionResult Index() public ActionResult Index(string id = "home")
{ {
ViewBag.Developer = true; ViewBag.Page = id;
return View(); return View();
} }
@ -51,8 +51,7 @@ public ActionResult MakeStable(string id)
public ActionResult Releases() public ActionResult Releases()
{ {
var db = new ApplicationDbContext(); return RedirectToAction("Index", new { id = "releases" });
return View(db.Downloads);
} }
public ActionResult AddRelease() public ActionResult AddRelease()
@ -154,10 +153,7 @@ public ActionResult AddRelease(PostDownloadViewModel model)
[Authorize] [Authorize]
public ActionResult Wiki() public ActionResult Wiki()
{ {
ViewBag.Developer = true; return RedirectToAction("Index", new { id = "wiki" });
var db = new ApplicationDbContext();
var cats = db.WikiCategories;
return View(cats);
} }
public ActionResult AddWikiCategory() public ActionResult AddWikiCategory()

View file

@ -130,6 +130,10 @@
<HintPath>..\packages\Nito.AsyncEx.3.0.1\lib\net45\Nito.AsyncEx.Enlightenment.dll</HintPath> <HintPath>..\packages\Nito.AsyncEx.3.0.1\lib\net45\Nito.AsyncEx.Enlightenment.dll</HintPath>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="Octokit, Version=0.24.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Octokit.0.24.1-alpha0001\lib\net45\Octokit.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Reachmail, Version=2.0.0.87, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="Reachmail, Version=2.0.0.87, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\reachmail.2.0.0.87\lib\Reachmail.dll</HintPath> <HintPath>..\packages\reachmail.2.0.0.87\lib\Reachmail.dll</HintPath>
<Private>True</Private> <Private>True</Private>

View file

@ -1,57 +1,39 @@
 
@{ @{
ViewBag.Title = "Dev Control Panel"; ViewBag.Title = "Dev Control Panel";
string homeclass = (ViewBag.Page == "home") ? "active" : "";
string releasesclass = (ViewBag.Page == "releases") ? "active" : "";
string wikiclass = (ViewBag.Page == "wiki") ? "active" : "";
var db = new Project_Unite.Models.ApplicationDbContext(); var db = new Project_Unite.Models.ApplicationDbContext();
int fixedbugs = db.Bugs.Where(x => x.Open == false).Count(); var releases = db.Downloads;
int notfixedbugs = db.Bugs.Where(x => x.Open == true).Count(); var cats = db.WikiCategories;
} }
<h2>Welcome!</h2> <h2>Developer Control Panel</h2>
<p>Here, have a bunch of charts that tell you what you already know!</p> <p>A place that only the best of the best ShiftOS developers can access.</p>
<div class="row"> <div class="row">
<div class="col-lg-6"> <div class="col-xs-4">
<h3>Bugs</h3> <h4>Places</h4>
<p>Here's a pie chart that tells you how many bugs have been fixed.</p>
<div id="c_bugs"></div> <ul class="nav-pills nav-stacked nav" id="tabs" data-tabs="tabs">
<li class="@homeclass"><a data-toggle="tab" href="#d_home"><span class="glyphicon glyphicon-home"></span> Home</a></li>
<li class="@releasesclass"><a data-toggle="tab" href="#d_releases"><span class="glyphicon glyphicon-download"></span> Releases</a></li>
<li class="@wikiclass"><a data-toggle="tab" href="#d_wiki"><span class="glyphicon glyphicon-book"></span> Wiki</a></li>
</ul>
</div> </div>
</div> <div class="col-xs-8 tab-content">
<div class="tab-pane fade in @homeclass" id="d_home">
<h3>Not yet implemented.</h3>
<style> <p>Please suggest things to put in here.</p>
#c_bugs{ </div>
width:100%; <div class="tab-pane fade in @releasesclass" id="d_releases">
height:900px; @Html.Partial("~/Views/Developer/Releases.cshtml", releases);
} </div>
</style> <div class="tab-pane fade in @wikiclass" id="d_wiki">
@Html.Partial("~/Views/Developer/Wiki.cshtml", cats);
<!-- Resources --> </div>
<script src="https://www.amcharts.com/lib/3/amcharts.js"></script> </div>
<script src="https://www.amcharts.com/lib/3/pie.js"></script> </div>
<script src="https://www.amcharts.com/lib/3/plugins/export/export.min.js"></script>
<link rel="stylesheet" href="https://www.amcharts.com/lib/3/plugins/export/export.css" type="text/css" media="all" />
<script src="https://www.amcharts.com/lib/3/themes/light.js"></script>
<!-- Chart code -->
<script>
var chart = AmCharts.makeChart( "c_bugs", {
"type": "pie",
"theme": "dark",
"dataProvider": [{
"status": "Fixed",
"amount": @fixedbugs
}, {
"status": "Needs attention",
"amount": @notfixedbugs
}],
"valueField": "amount",
"titleField": "status",
"balloon":{
"fixedPosition":true
},
"export": {
"enabled": false
}
} );
</script>

View file

@ -42,6 +42,7 @@
<package id="NAudio" version="1.7.3" targetFramework="net452" /> <package id="NAudio" version="1.7.3" targetFramework="net452" />
<package id="Newtonsoft.Json" version="10.0.2" targetFramework="net452" /> <package id="Newtonsoft.Json" version="10.0.2" targetFramework="net452" />
<package id="Nito.AsyncEx" version="3.0.1" targetFramework="net452" /> <package id="Nito.AsyncEx" version="3.0.1" targetFramework="net452" />
<package id="Octokit" version="0.24.1-alpha0001" targetFramework="net452" />
<package id="Owin" version="1.0" targetFramework="net452" /> <package id="Owin" version="1.0" targetFramework="net452" />
<package id="reachmail" version="2.0.0.87" targetFramework="net452" /> <package id="reachmail" version="2.0.0.87" targetFramework="net452" />
<package id="Respond" version="1.2.0" targetFramework="net452" /> <package id="Respond" version="1.2.0" targetFramework="net452" />