forked from HerbertBodner/webapp-core
-
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.
- Loading branch information
1 parent
73b82f5
commit 5021a61
Showing
38 changed files
with
28,127 additions
and
2,619 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
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 |
---|---|---|
@@ -1,16 +1,6 @@ | ||
@{ | ||
Layout = null; | ||
} | ||
|
||
<!DOCTYPE html> | ||
|
||
<html> | ||
<head> | ||
<title>Hello on the HOME page</title> | ||
</head> | ||
<body> | ||
<div> | ||
yeah, you are at home!!! | ||
yeah, you are at home!!!!!!!!!!!! | ||
</div> | ||
</body> | ||
</html> |
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,6 @@ | ||
@{ | ||
ViewData["Title"] = "Error"; | ||
} | ||
|
||
<h1 class="text-danger">Error.</h1> | ||
<h2 class="text-danger">An error occurred while processing your request.</h2> |
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,81 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>@ViewData["Title"] - WaCore Example</title> | ||
|
||
@*<environment names="Development"> | ||
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.css" /> | ||
<link rel="stylesheet" href="~/lib/bootstrap-touch-carousel/dist/css/bootstrap-touch-carousel.css" /> | ||
<link rel="stylesheet" href="~/css/site.css" /> | ||
</environment> | ||
<environment names="Staging,Production"> | ||
<link rel="stylesheet" href="https://ajax.aspnetcdn.com/ajax/bootstrap/3.0.0/css/bootstrap.min.css" | ||
asp-fallback-href="~/lib/bootstrap/dist/css/bootstrap.min.css" | ||
asp-fallback-test-class="hidden" asp-fallback-test-property="visibility" asp-fallback-test-value="hidden" /> | ||
<link rel="stylesheet" href="https://ajax.aspnetcdn.com/ajax/bootstrap-touch-carousel/0.8.0/css/bootstrap-touch-carousel.css" | ||
asp-fallback-href="~/lib/bootstrap-touch-carousel/css/bootstrap-touch-carousel.css" | ||
asp-fallback-test-class="carousel-caption" asp-fallback-test-property="display" asp-fallback-test-value="none" /> | ||
<link rel="stylesheet" href="~/css/site.css" asp-append-version="true" /> | ||
</environment>*@ | ||
</head> | ||
<body> | ||
<div 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="icon-bar"></span> | ||
<span class="icon-bar"></span> | ||
<span class="icon-bar"></span> | ||
</button> | ||
<a asp-controller="Home" asp-action="Index" class="navbar-brand">WebApplication7</a> | ||
</div> | ||
<div class="navbar-collapse collapse"> | ||
<ul class="nav navbar-nav"> | ||
<li><a asp-controller="Home" asp-action="Index">Home</a></li> | ||
<li><a asp-controller="Home" asp-action="About">About</a></li> | ||
<li><a asp-controller="Home" asp-action="Contact">Contact</a></li> | ||
</ul> | ||
@await Html.PartialAsync("_LoginPartial") | ||
</div> | ||
</div> | ||
</div> | ||
<div class="container body-content"> | ||
@RenderBody() | ||
<hr /> | ||
<footer> | ||
<p>© 2015 - WaCore Example</p> | ||
</footer> | ||
</div> | ||
|
||
@*<environment names="Development"> | ||
<script src="~/lib/jquery/dist/jquery.js"></script> | ||
<script src="~/lib/bootstrap/dist/js/bootstrap.js"></script> | ||
<script src="~/lib/hammer.js/hammer.js"></script> | ||
<script src="~/lib/bootstrap-touch-carousel/dist/js/bootstrap-touch-carousel.js"></script> | ||
<script src="~/js/site.js" asp-append-version="true"></script> | ||
</environment> | ||
<environment names="Staging,Production"> | ||
<script src="https://ajax.aspnetcdn.com/ajax/jquery/jquery-2.1.4.min.js" | ||
asp-fallback-src="~/lib/jquery/dist/jquery.min.js" | ||
asp-fallback-test="window.jQuery"> | ||
</script> | ||
<script src="https://ajax.aspnetcdn.com/ajax/bootstrap/3.0.0/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"> | ||
</script> | ||
<script src="https://ajax.aspnetcdn.com/ajax/hammer.js/2.0.4/hammer.min.js" | ||
asp-fallback-src="~/lib/hammer.js/hammer.js" | ||
asp-fallback-test="window.Hammer"> | ||
</script> | ||
<script src="https://ajax.aspnetcdn.com/ajax/bootstrap-touch-carousel/0.8.0/js/bootstrap-touch-carousel.js" | ||
asp-fallback-src="~/lib/bootstrap-touch-carousel/dist/js/bootstrap-touch-carousel.js" | ||
asp-fallback-test="window.Hammer && window.Hammer.Instance"> | ||
</script> | ||
<script src="~/js/site.js" asp-append-version="true"></script> | ||
</environment>*@ | ||
|
||
@RenderSection("scripts", required: false) | ||
</body> | ||
</html> |
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,20 @@ | ||
@using System.Security.Claims | ||
|
||
@if (User.Identity.IsAuthenticated) | ||
{ | ||
<form asp-controller="Account" asp-action="LogOff" method="post" id="logoutForm" class="navbar-right"> | ||
<ul class="nav navbar-nav navbar-right"> | ||
<li> | ||
<a asp-controller="Manage" asp-action="Index" title="Manage">Hello @User.GetUserName()!</a> | ||
</li> | ||
<li><a href="javascript:document.getElementById('logoutForm').submit()">Log off</a></li> | ||
</ul> | ||
</form> | ||
} | ||
else | ||
{ | ||
<ul class="nav navbar-nav navbar-right"> | ||
<li><a asp-controller="Account" asp-action="Register">Register</a></li> | ||
<li><a asp-controller="Account" asp-action="Login">Log in</a></li> | ||
</ul> | ||
} |
14 changes: 14 additions & 0 deletions
14
src/Example.Web/Views/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,14 @@ | ||
<environment names="Development"> | ||
<script src="~/lib/jquery-validation/jquery.validate.js"></script> | ||
<script src="~/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.js"></script> | ||
</environment> | ||
<environment names="Staging,Production"> | ||
<script src="https://ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/jquery.validate.min.js" | ||
asp-fallback-src="~/lib/jquery-validation/jquery.validate.js" | ||
asp-fallback-test="window.jquery && window.jquery.validator"> | ||
</script> | ||
<script src="https://ajax.aspnetcdn.com/ajax/mvc/5.2.3/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"> | ||
</script> | ||
</environment> |
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 |
---|---|---|
@@ -1,16 +1,49 @@ | ||
@{ | ||
Layout = null; | ||
} | ||
@using System.Threading.Tasks | ||
@using WaCore.Web.ViewModels.Accounts | ||
@model WaCore.Web.ViewModels.Accounts.LoginViewModel | ||
|
||
<!DOCTYPE html> | ||
|
||
<html> | ||
<head> | ||
<title>Hello on the LOGIN page</title> | ||
</head> | ||
<body> | ||
<div> | ||
yeah, you are at login!!! | ||
<h2>Login</h2> | ||
<div class="row"> | ||
<div class="col-md-8"> | ||
<section> | ||
<form asp-controller="Account" asp-action="Login" asp-route-returnurl="@ViewData["ReturnUrl"]" method="post" class="form-horizontal" role="form"> | ||
<h4>Use a local account to log in.</h4> | ||
<hr /> | ||
<div asp-validation-summary="ValidationSummary.All" class="text-danger"></div> | ||
<div class="form-group"> | ||
<label asp-for="Email" class="col-md-2 control-label"></label> | ||
<div class="col-md-10"> | ||
<input asp-for="Email" class="form-control" /> | ||
<span asp-validation-for="Email" class="text-danger"></span> | ||
</div> | ||
</div> | ||
<div class="form-group"> | ||
<label asp-for="Password" class="col-md-2 control-label"></label> | ||
<div class="col-md-10"> | ||
<input asp-for="Password" class="form-control" /> | ||
<span asp-validation-for="Password" class="text-danger"></span> | ||
</div> | ||
</div> | ||
<div class="form-group"> | ||
<div class="col-md-offset-2 col-md-10"> | ||
<div class="checkbox"> | ||
<input asp-for="RememberMe" /> | ||
<label asp-for="RememberMe"></label> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="form-group"> | ||
<div class="col-md-offset-2 col-md-10"> | ||
<button type="submit" class="btn btn-default">Log in</button> | ||
</div> | ||
</div> | ||
<p> | ||
<a asp-action="Register">Register as a new user?</a> | ||
</p> | ||
<p> | ||
<a asp-action="ForgotPassword">Forgot your password?</a> | ||
</p> | ||
</form> | ||
</section> | ||
</div> | ||
</body> | ||
</html> | ||
</div> |
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,43 @@ | ||
@using System.Threading.Tasks | ||
@using WaCore.Web.ViewModels.Accounts | ||
@model WaCore.Web.ViewModels.Accounts.RegisterViewModel | ||
@{ | ||
} | ||
|
||
<h2>Register.</h2> | ||
|
||
<form asp-controller="Account" asp-action="Register" method="post" class="form-horizontal" role="form"> | ||
<h4>Create a new account.</h4> | ||
<hr /> | ||
<div asp-validation-summary="ValidationSummary.All" class="text-danger"></div> | ||
<div class="form-group"> | ||
<label asp-for="Email" class="col-md-2 control-label"></label> | ||
<div class="col-md-10"> | ||
<input asp-for="Email" class="form-control" /> | ||
<span asp-validation-for="Email" class="text-danger"></span> | ||
</div> | ||
</div> | ||
<div class="form-group"> | ||
<label asp-for="Password" class="col-md-2 control-label"></label> | ||
<div class="col-md-10"> | ||
<input asp-for="Password" class="form-control" /> | ||
<span asp-validation-for="Password" class="text-danger"></span> | ||
</div> | ||
</div> | ||
<div class="form-group"> | ||
<label asp-for="ConfirmPassword" class="col-md-2 control-label"></label> | ||
<div class="col-md-10"> | ||
<input asp-for="ConfirmPassword" class="form-control" /> | ||
<span asp-validation-for="ConfirmPassword" class="text-danger"></span> | ||
</div> | ||
</div> | ||
<div class="form-group"> | ||
<div class="col-md-offset-2 col-md-10"> | ||
<button type="submit" class="btn btn-default">Register</button> | ||
</div> | ||
</div> | ||
</form> | ||
|
||
@section Scripts { | ||
@{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); } | ||
} |
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 @@ | ||
@addTagHelper "*, Microsoft.AspNet.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,7 @@ | ||
{ | ||
"Data": { | ||
"DefaultConnection": { | ||
"ConnectionString": "Server=(localdb)\\MSSQLLocalDB;Database=WaCoreExample;Trusted_Connection=True;" | ||
} | ||
} | ||
} |
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
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 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
using WaCore.Contracts.Bl.Services.Account; | ||
|
||
namespace WaCore.Bl.Services.Account | ||
{ | ||
public class AccountResult : IAccountResult | ||
{ | ||
public static AccountResult Success() | ||
{ | ||
return new AccountResult(); | ||
} | ||
|
||
public AccountResult(List<string> errors = null) | ||
{ | ||
Errors = errors ?? new List<string>(); | ||
} | ||
|
||
public IEnumerable<string> Errors { get; } | ||
|
||
public bool Succeeded => !Errors.Any(); | ||
} | ||
} |
Oops, something went wrong.