Add admin index.

This commit is contained in:
2019-05-18 11:45:41 +01:00
parent 83c660d9c1
commit aed5df094a
4 changed files with 191 additions and 75 deletions

View File

@@ -0,0 +1,41 @@
/******************************************************************************
// Canary Islands Computer Museum Website
// ----------------------------------------------------------------------------
//
// Filename : HomeController.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// --[ Description ] ----------------------------------------------------------
//
// Admin controller
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2003-2018 Natalia Portillo
*******************************************************************************/
using Microsoft.AspNetCore.Mvc;
namespace cicm_web.Areas.Admin.Controllers
{
[Area("Admin")]
public class HomeController : Controller
{
// GET
public IActionResult Index() => View();
}
}

View File

@@ -0,0 +1,59 @@
@{
/******************************************************************************
// Canary Islands Computer Museum Website
// ----------------------------------------------------------------------------
//
// Filename : Index.cshtml
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// --[ Description ] ----------------------------------------------------------
//
// Admin page
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2003-2018 Natalia Portillo
*******************************************************************************/
ViewData["Title"] = "Admin";
}
<h2>Administration</h2>
<div class="content">
<h3>Database administrative pages</h3>
<a asp-controller="BrowserTests">Browser tests</a><br />
<a asp-controller="Companies">Companies</a><br />
<a asp-controller="CompanyDescriptions">Company descriptions</a><br />
<a asp-controller="Gpus">GPUs</a><br />
<a asp-controller="InstructionSets">Instruction sets</a><br />
<a asp-controller="InstructionSetExtensions">Instruction set extensions</a><br />
<a asp-controller="MachineFamilies">Machine families</a><br />
<a asp-controller="Machines">Machines</a><br />
<a asp-controller="MemoryByMachines">Memory by machines</a><br />
<a asp-controller="News">News</a><br />
<a asp-controller="ProcessorsByMachines">Processors by machines</a><br />
<a asp-controller="Processors">Processors</a><br />
<a asp-controller="Resolutions">Resolutions</a><br />
<a asp-controller="SoundSynths">Sound synthetizers</a><br />
<a asp-controller="StorageByMachines">Storage by machines</a><br />
</div>
<div class="content">
<h3>User administrative pages</h3>
@* TODO *@ To be implemented
</div>

View File

@@ -1,4 +1,7 @@
@using Microsoft.AspNetCore.Identity
@using Microsoft.Extensions.PlatformAbstractions @using Microsoft.Extensions.PlatformAbstractions
@inject SignInManager<IdentityUser> SignInManager
@inject UserManager<IdentityUser> UserManager
@{ @{
/****************************************************************************** /******************************************************************************
// Canary Islands Computer Museum Website // Canary Islands Computer Museum Website
@@ -33,109 +36,122 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta charset=utf-8 /> <meta charset="utf-8" />
<meta content="width=device-width, initial-scale=1.0" <meta content="width=device-width, initial-scale=1.0"
name=viewport /> name="viewport" />
<title>Canary Islands Computer Museum - @ViewData["Title"]</title> <title>Canary Islands Computer Museum - @ViewData["Title"]</title>
<environment include=Development> <environment include="Development">
<link href=~/lib/bootstrap/dist/css/bootstrap.css <link href="~/lib/bootstrap/dist/css/bootstrap.css"
rel=stylesheet /> rel="stylesheet" />
<link href=~/css/site.css <link href="~/css/site.css"
rel=stylesheet /> rel="stylesheet" />
</environment> </environment>
<environment exclude=Development> <environment exclude="Development">
<link asp-fallback-href=~/lib/bootstrap/dist/css/bootstrap.min.css <link asp-fallback-href="~/lib/bootstrap/dist/css/bootstrap.min.css"
asp-fallback-test-class=sr-only asp-fallback-test-class="sr-only"
asp-fallback-test-property=position asp-fallback-test-property="position"
asp-fallback-test-value=absolute asp-fallback-test-value="absolute"
href=https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css"
rel=stylesheet /> rel="stylesheet" />
<link asp-append-version=true <link asp-append-version="true"
href=~/css/site.min.css href="~/css/site.min.css"
rel=stylesheet /> rel="stylesheet" />
</environment> </environment>
</head> </head>
<body> <body>
<nav class="bg-dark navbar navbar-dark navbar-expand-lg"> <nav class="bg-dark navbar navbar-dark navbar-expand-lg">
<a class=navbar-brand <a class="navbar-brand"
href=#> href="#">
CICM CICM
</a> </a>
<button aria-controls=navbarSupportedContent <button aria-controls="navbarSupportedContent"
aria-expanded=false aria-expanded="false"
aria-label="Toggle navigation" aria-label="Toggle navigation"
class=navbar-toggler class="navbar-toggler"
data-target=#navbarSupportedContent data-target="#navbarSupportedContent"
data-toggle=collapse data-toggle="collapse"
type=button> type="button">
<span class=navbar-toggler-icon> <span class="navbar-toggler-icon">
</span> </span>
</button> </button>
<div class="collapse navbar-collapse" <div class="collapse navbar-collapse"
id=navbarSupportedContent> id="navbarSupportedContent">
<ul class="mr-auto navbar-nav"> <ul class="mr-auto navbar-nav">
<li class=nav-item> <li class="nav-item">
<a asp-action=Index <a asp-action="Index"
asp-area="" asp-area=""
asp-controller=Home asp-controller="Home"
class=nav-link> class="nav-link">
Home Home
</a> </a>
</li> </li>
<li class="dropdown nav-item"> <li class="dropdown nav-item">
<a aria-expanded=false <a aria-expanded="false"
aria-haspopup=true aria-haspopup="true"
class="dropdown-toggle nav-link" class="dropdown-toggle nav-link"
data-toggle=dropdown data-toggle="dropdown"
href=# href="#"
id=navbarDropdown id="navbarDropdown"
role=button> role="button">
Database Database
</a> </a>
<div aria-labelledby=navbarDropdown <div aria-labelledby="navbarDropdown"
class=dropdown-menu> class="dropdown-menu">
<a asp-action=Index <a asp-action="Index"
asp-controller=Company asp-controller="Company"
class=dropdown-item> class="dropdown-item">
Companies Companies
</a> </a>
<div class=dropdown-divider> <div class="dropdown-divider">
</div> </div>
<a asp-action=Index <a asp-action="Index"
asp-controller=Computer asp-controller="Computer"
class=dropdown-item> class="dropdown-item">
Computers Computers
</a> </a>
<div class=dropdown-divider> <div class="dropdown-divider">
</div> </div>
<a asp-action=Index <a asp-action="Index"
asp-controller=Console asp-controller="Console"
class=dropdown-item> class="dropdown-item">
Consoles Consoles
</a> </a>
</div> </div>
</li> </li>
<li class=nav-item> <li class="nav-item">
<a asp-action=About <a asp-action="About"
asp-area="" asp-area=""
asp-controller=Home asp-controller="Home"
class=nav-link> class="nav-link">
About About
</a> </a>
</li> </li>
<li class=nav-item> <li class="nav-item">
<a asp-action=Contact <a asp-action="Contact"
asp-area="" asp-area=""
asp-controller=Home asp-controller="Home"
class=nav-link> class="nav-link">
Contact Contact
</a> </a>
</li> </li>
@if(SignInManager.IsSignedIn(User))
{
<li class=nav-item>
<a asp-action=Index
asp-area="Admin"
class=nav-link>
Admin
</a>
</li>
}
</ul> </ul>
<partial name="_LoginPartial" /> <partial name="_LoginPartial" />
</div> </div>
</nav> </nav>
<div class="body-content container"> <div class="body-content container">
@RenderBody() @RenderBody()
@@ -145,25 +161,25 @@
</footer> </footer>
</div> </div>
<environment include=Development> <environment include="Development">
<script src=~/lib/jquery/dist/jquery.js></script> <script src="~/lib/jquery/dist/jquery.js"></script>
<script src=~/lib/bootstrap/dist/js/bootstrap.js></script> <script src="~/lib/bootstrap/dist/js/bootstrap.js"></script>
<script asp-append-version=true <script asp-append-version="true"
src=~/js/site.js></script> src="~/js/site.js"></script>
</environment> </environment>
<environment exclude=Development> <environment exclude="Development">
<script asp-fallback-src=~/lib/jquery/dist/jquery.min.js <script asp-fallback-src="~/lib/jquery/dist/jquery.min.js"
asp-fallback-test=window.jQuery asp-fallback-test="window.jQuery"
crossorigin=anonymous crossorigin="anonymous"
src=https://ajax.aspnetcdn.com/ajax/jquery/jquery-3.3.1.min.js> src="https://ajax.aspnetcdn.com/ajax/jquery/jquery-3.3.1.min.js">
</script> </script>
<script asp-fallback-src=~/lib/bootstrap/dist/js/bootstrap.min.js <script asp-fallback-src="~/lib/bootstrap/dist/js/bootstrap.min.js"
asp-fallback-test="window.jQuery && window.jQuery.fn && window.jQuery.fn.modal" asp-fallback-test="window.jQuery && window.jQuery.fn && window.jQuery.fn.modal"
crossorigin=anonymous crossorigin="anonymous"
src=https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/bootstrap.min.js> src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/bootstrap.min.js">
</script> </script>
<script asp-append-version=true <script asp-append-version="true"
src=~/js/site.min.js></script> src="~/js/site.min.js"></script>
</environment> </environment>
@RenderSection("Scripts", false) @RenderSection("Scripts", false)

View File

@@ -2,7 +2,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web"> <Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup> <PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework> <TargetFramework>netcoreapp2.2</TargetFramework>
<Version>3.0.99.392</Version> <Version>3.0.99.394</Version>
<Company>Canary Islands Computer Museum</Company> <Company>Canary Islands Computer Museum</Company>
<Copyright>Copyright © 2003-2018 Natalia Portillo</Copyright> <Copyright>Copyright © 2003-2018 Natalia Portillo</Copyright>
<Product>Canary Islands Computer Museum Website</Product> <Product>Canary Islands Computer Museum Website</Product>