-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial commit
- Loading branch information
Showing
78 changed files
with
36,957 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio 15 | ||
VisualStudioVersion = 15.0.27130.2036 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FeatureFoldersWebApp", "FeatureFoldersWebApp\FeatureFoldersWebApp.csproj", "{BD746A27-3876-4C3A-B199-2AD0695C498E}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{BD746A27-3876-4C3A-B199-2AD0695C498E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{BD746A27-3876-4C3A-B199-2AD0695C498E}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{BD746A27-3876-4C3A-B199-2AD0695C498E}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{BD746A27-3876-4C3A-B199-2AD0695C498E}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {B028DCAE-17D8-4A2A-8017-17B1E2ABA648} | ||
EndGlobalSection | ||
EndGlobal |
12 changes: 12 additions & 0 deletions
12
FeatureFoldersWebApp/Areas/Admin/Features/Home/About.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
@{ | ||
ViewData["Title"] = "Admin - About"; | ||
} | ||
|
||
<div class="container"> | ||
<h1> | ||
Admin | ||
</h1> | ||
<h3> | ||
About | ||
</h3> | ||
</div> |
12 changes: 12 additions & 0 deletions
12
FeatureFoldersWebApp/Areas/Admin/Features/Home/Contact.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
@{ | ||
ViewData["Title"] = "Admin - Contact"; | ||
} | ||
|
||
<div class="container"> | ||
<h1> | ||
Admin | ||
</h1> | ||
<h3> | ||
Contact | ||
</h3> | ||
</div> |
34 changes: 34 additions & 0 deletions
34
FeatureFoldersWebApp/Areas/Admin/Features/Home/HomeController.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Diagnostics; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
using Microsoft.AspNetCore.Mvc; | ||
using FeatureFoldersWebApp.Models; | ||
|
||
namespace FeatureFoldersWebApp.Areas.AdminFeatures.Home | ||
{ | ||
[Area("Admin")] | ||
public class HomeController : Controller | ||
{ | ||
public IActionResult Index() | ||
{ | ||
return View(); | ||
} | ||
|
||
public IActionResult About() | ||
{ | ||
return View(); | ||
} | ||
|
||
public IActionResult Contact() | ||
{ | ||
return View(); | ||
} | ||
|
||
public IActionResult Error() | ||
{ | ||
return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier }); | ||
} | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
FeatureFoldersWebApp/Areas/Admin/Features/Home/Index.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
@{ | ||
ViewData["Title"] = "Admin - Home Page"; | ||
} | ||
|
||
<div class="container"> | ||
<h1> | ||
Admin | ||
</h1> | ||
<h3> | ||
Home Page | ||
</h3> | ||
</div> |
22 changes: 22 additions & 0 deletions
22
FeatureFoldersWebApp/Areas/Admin/Features/Shared/Error.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
@model ErrorViewModel | ||
@{ | ||
ViewData["Title"] = "Error"; | ||
} | ||
|
||
<h1 class="text-danger">Error.</h1> | ||
<h2 class="text-danger">An error occurred while processing your request.</h2> | ||
|
||
@if (Model.ShowRequestId) | ||
{ | ||
<p> | ||
<strong>Request ID:</strong> <code>@Model.RequestId</code> | ||
</p> | ||
} | ||
|
||
<h3>Development Mode</h3> | ||
<p> | ||
Swapping to <strong>Development</strong> environment will display more detailed information about the error that occurred. | ||
</p> | ||
<p> | ||
<strong>Development environment should not be enabled in deployed applications</strong>, as it can result in sensitive information from exceptions being displayed to end users. For local debugging, development environment can be enabled by setting the <strong>ASPNETCORE_ENVIRONMENT</strong> environment variable to <strong>Development</strong>, and restarting the application. | ||
</p> |
73 changes: 73 additions & 0 deletions
73
FeatureFoldersWebApp/Areas/Admin/Features/Shared/_Layout.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>@ViewData["Title"] - FeatureFoldersWebApp</title> | ||
|
||
<environment include="Development"> | ||
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.css" /> | ||
<link rel="stylesheet" href="~/css/site.css" /> | ||
</environment> | ||
<environment exclude="Development"> | ||
<link rel="stylesheet" href="https://ajax.aspnetcdn.com/ajax/bootstrap/3.3.7/css/bootstrap.min.css" | ||
asp-fallback-href="~/lib/bootstrap/dist/css/bootstrap.min.css" | ||
asp-fallback-test-class="sr-only" asp-fallback-test-property="position" asp-fallback-test-value="absolute" /> | ||
<link rel="stylesheet" href="~/css/site.min.css" asp-append-version="true" /> | ||
</environment> | ||
</head> | ||
<body> | ||
<nav class="navbar navbar-inverse navbar-fixed-top"> | ||
<div class="container"> | ||
<div class="navbar-header"> | ||
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> | ||
<span class="sr-only">Toggle navigation</span> | ||
<span class="icon-bar"></span> | ||
<span class="icon-bar"></span> | ||
<span class="icon-bar"></span> | ||
</button> | ||
<a asp-area="Admin" asp-controller="Home" asp-action="Index" class="navbar-brand">FeatureFolders - Admin</a> | ||
</div> | ||
<div class="navbar-collapse collapse"> | ||
<ul class="nav navbar-nav"> | ||
<li><a asp-area="Admin" asp-controller="Home" asp-action="Index">Home</a></li> | ||
<li><a asp-area="Admin" asp-controller="Home" asp-action="About">About</a></li> | ||
<li><a asp-area="Admin" asp-controller="Home" asp-action="Contact">Contact</a></li> | ||
<li><a asp-area="Admin" asp-controller="User" asp-action="Index">Users</a></li> | ||
<li><a asp-area="" asp-controller="Home" asp-action="Index">Client Area</a></li> | ||
</ul> | ||
</div> | ||
</div> | ||
</nav> | ||
<div class="container body-content"> | ||
@RenderBody() | ||
<hr /> | ||
<footer> | ||
<p>© 2018 - FeatureFoldersWebApp</p> | ||
</footer> | ||
</div> | ||
|
||
<environment include="Development"> | ||
<script src="~/lib/jquery/dist/jquery.js"></script> | ||
<script src="~/lib/bootstrap/dist/js/bootstrap.js"></script> | ||
<script src="~/js/site.js" asp-append-version="true"></script> | ||
</environment> | ||
<environment exclude="Development"> | ||
<script src="https://ajax.aspnetcdn.com/ajax/jquery/jquery-2.2.0.min.js" | ||
asp-fallback-src="~/lib/jquery/dist/jquery.min.js" | ||
asp-fallback-test="window.jQuery" | ||
crossorigin="anonymous" | ||
integrity="sha384-K+ctZQ+LL8q6tP7I94W+qzQsfRV2a+AfHIi9k8z8l9ggpc8X+Ytst4yBo/hH+8Fk"> | ||
</script> | ||
<script src="https://ajax.aspnetcdn.com/ajax/bootstrap/3.3.7/bootstrap.min.js" | ||
asp-fallback-src="~/lib/bootstrap/dist/js/bootstrap.min.js" | ||
asp-fallback-test="window.jQuery && window.jQuery.fn && window.jQuery.fn.modal" | ||
crossorigin="anonymous" | ||
integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa"> | ||
</script> | ||
<script src="~/js/site.min.js" asp-append-version="true"></script> | ||
</environment> | ||
|
||
@RenderSection("Scripts", required: false) | ||
</body> | ||
</html> |
18 changes: 18 additions & 0 deletions
18
FeatureFoldersWebApp/Areas/Admin/Features/Shared/_ValidationScriptsPartial.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<environment include="Development"> | ||
<script src="~/lib/jquery-validation/dist/jquery.validate.js"></script> | ||
<script src="~/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.js"></script> | ||
</environment> | ||
<environment exclude="Development"> | ||
<script src="https://ajax.aspnetcdn.com/ajax/jquery.validate/1.14.0/jquery.validate.min.js" | ||
asp-fallback-src="~/lib/jquery-validation/dist/jquery.validate.min.js" | ||
asp-fallback-test="window.jQuery && window.jQuery.validator" | ||
crossorigin="anonymous" | ||
integrity="sha384-Fnqn3nxp3506LP/7Y3j/25BlWeA3PXTyT1l78LjECcPaKCV12TsZP7yyMxOe/G/k"> | ||
</script> | ||
<script src="https://ajax.aspnetcdn.com/ajax/jquery.validation.unobtrusive/3.2.6/jquery.validate.unobtrusive.min.js" | ||
asp-fallback-src="~/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js" | ||
asp-fallback-test="window.jQuery && window.jQuery.validator && window.jQuery.validator.unobtrusive" | ||
crossorigin="anonymous" | ||
integrity="sha384-JrXK+k53HACyavUKOsL+NkmSesD2P+73eDMrbTtTk0h4RmOF8hF8apPlkp26JlyH"> | ||
</script> | ||
</environment> |
27 changes: 27 additions & 0 deletions
27
FeatureFoldersWebApp/Areas/Admin/Features/User/Index.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
@using FeatureFoldersWebApp.Areas.Admin.Features.User.Models | ||
@model List<UserModel> | ||
|
||
@{ | ||
ViewData["Title"] = "Admin- Users"; | ||
} | ||
|
||
<div class="container"> | ||
<h2>Users:</h2> | ||
<table class="table table-striped"> | ||
<thead> | ||
<tr> | ||
<th>Id</th> | ||
<th>Name</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
@foreach (var user in Model) | ||
{ | ||
<tr> | ||
<td>@user.Id</td> | ||
<td><a asp-area="Admin" asp-controller="User" asp-action="View" asp-route-userId="@user.Id">@user.Name</a></td> | ||
</tr> | ||
} | ||
</tbody> | ||
</table> | ||
</div> |
15 changes: 15 additions & 0 deletions
15
FeatureFoldersWebApp/Areas/Admin/Features/User/Models/UserModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
|
||
namespace FeatureFoldersWebApp.Areas.Admin.Features.User.Models | ||
{ | ||
public class UserModel | ||
{ | ||
public int Id { get; set; } | ||
public string Name { get; set; } | ||
public int Age { get; set; } | ||
public string City { get; set; } | ||
} | ||
} |
62 changes: 62 additions & 0 deletions
62
FeatureFoldersWebApp/Areas/Admin/Features/User/UserController.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
using FeatureFoldersWebApp.Areas.Admin.Features.User.Models; | ||
using Microsoft.AspNetCore.Mvc; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
|
||
namespace FeatureFoldersWebApp.Areas.Admin.Features.User | ||
{ | ||
[Area("Admin")] | ||
public class UserController : Controller | ||
{ | ||
private List<UserModel> UserList { get; set; } | ||
|
||
public UserController() | ||
{ | ||
this.UserList = new List<UserModel>() | ||
{ | ||
new UserModel() | ||
{ | ||
Id = 1, | ||
Name = "John", | ||
Age = 21, | ||
City = "Bucharest" | ||
}, | ||
new UserModel() | ||
{ | ||
Id = 2, | ||
Name = "Justin", | ||
Age = 44, | ||
City = "New York" | ||
}, | ||
new UserModel() | ||
{ | ||
Id = 3, | ||
Name = "George", | ||
Age = 46, | ||
City = "London" | ||
} | ||
}; | ||
} | ||
|
||
public IActionResult Index() | ||
{ | ||
return View(this.UserList); | ||
} | ||
|
||
public IActionResult View(int? userId) | ||
{ | ||
if (userId == null) | ||
return RedirectToAction(nameof(Index)); | ||
|
||
var model = this.UserList.Where(c => c.Id == userId.Value).FirstOrDefault(); | ||
|
||
if(model == null) | ||
return RedirectToAction(nameof(Index)); | ||
|
||
return View(model); | ||
} | ||
|
||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
FeatureFoldersWebApp/Areas/Admin/Features/User/View.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
@using FeatureFoldersWebApp.Areas.Admin.Features.User.Models | ||
@model UserModel | ||
|
||
@{ | ||
ViewData["Title"] = "Admin: " + Model.Name; | ||
} | ||
|
||
<div class="container"> | ||
<h3><strong>User:</strong></h3> | ||
<h4><strong>Id:</strong> @Model.Id</h4> | ||
<h4><strong>Name:</strong> @Model.Name</h4> | ||
<h4><strong>City: </strong>@Model.City</h4> | ||
<h4><strong>Age:</strong> @Model.Age</h4> | ||
</div> |
3 changes: 3 additions & 0 deletions
3
FeatureFoldersWebApp/Areas/Admin/Features/_ViewImports.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
@using FeatureFoldersWebApp | ||
@using FeatureFoldersWebApp.Areas.Admin.Features.Models | ||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
@{ | ||
Layout = "_Layout"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using System; | ||
|
||
namespace FeatureFoldersWebApp.Areas.Admin.Features.Models | ||
{ | ||
public class ErrorViewModel | ||
{ | ||
public string RequestId { get; set; } | ||
|
||
public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<Project Sdk="Microsoft.NET.Sdk.Web"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>netcoreapp2.0</TargetFramework> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.5" /> | ||
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.0.2" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="2.0.2" /> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<WebStackScaffolding_ViewDialogWidth>600</WebStackScaffolding_ViewDialogWidth> | ||
<WebStackScaffolding_IsLayoutPageSelected>True</WebStackScaffolding_IsLayoutPageSelected> | ||
<WebStackScaffolding_IsPartialViewSelected>False</WebStackScaffolding_IsPartialViewSelected> | ||
<WebStackScaffolding_IsReferencingScriptLibrariesSelected>False</WebStackScaffolding_IsReferencingScriptLibrariesSelected> | ||
<WebStackScaffolding_LayoutPageFile /> | ||
</PropertyGroup> | ||
</Project> |
Oops, something went wrong.