Skip to content

Commit

Permalink
* Updating the host app to use the tag helpers to render links/forms
Browse files Browse the repository at this point in the history
  • Loading branch information
artiomchi committed Jun 1, 2017
1 parent 3e852dc commit dbf23e5
Show file tree
Hide file tree
Showing 16 changed files with 32 additions and 32 deletions.
2 changes: 1 addition & 1 deletion src/R4MvcHostApp/Views/Account/ConfirmEmail.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
<h2>@ViewData["Title"].</h2>
<div>
<p>
Thank you for confirming your email. Please <a asp-controller="Account" asp-action="Login">Click here to Log in</a>.
Thank you for confirming your email. Please <a mvc-action="MVC.Account.Login()">Click here to Log in</a>.
</p>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<h2>@ViewData["Title"].</h2>
<h3>Associate your @ViewData["LoginProvider"] account.</h3>

<form asp-controller="Account" asp-action="ExternalLoginConfirmation" asp-route-returnurl="@ViewData["ReturnUrl"]" method="post" class="form-horizontal">
<form mvc-action="@MVC.Account.ExternalLoginConfirmation()" asp-route-returnurl="@ViewData["ReturnUrl"]" method="post" class="form-horizontal">
<h4>Association Form</h4>
<hr />
<div asp-validation-summary="All" class="text-danger"></div>
Expand Down
2 changes: 1 addition & 1 deletion src/R4MvcHostApp/Views/Account/ForgotPassword.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
For more information on how to enable reset password please see this <a href="https://go.microsoft.com/fwlink/?LinkID=532713">article</a>.
</p>

@*<form asp-controller="Account" asp-action="ForgotPassword" method="post" class="form-horizontal">
@*<form mvc-action="MVC.Account.ForgotPassword()" method="post" class="form-horizontal">
<h4>Enter your email.</h4>
<hr />
<div asp-validation-summary="All" class="text-danger"></div>
Expand Down
8 changes: 4 additions & 4 deletions src/R4MvcHostApp/Views/Account/Login.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<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">
<form mvc-action="@MVC.Account.Login(ViewData["ReturnUrl"] as string)" method="post" class="form-horizontal">
<h4>Use a local account to log in.</h4>
<hr />
<div asp-validation-summary="All" class="text-danger"></div>
Expand Down Expand Up @@ -46,10 +46,10 @@
</div>
</div>
<p>
<a asp-action="Register" asp-route-returnurl="@ViewData["ReturnUrl"]">Register as a new user?</a>
<a mvc-action="@MVC.Account.Register(ViewData["ReturnUrl"] as string)">Register as a new user?</a>
</p>
<p>
<a asp-action="ForgotPassword">Forgot your password?</a>
<a mvc-action="MVC.Account.ForgotPassword()">Forgot your password?</a>
</p>
</form>
</section>
Expand All @@ -71,7 +71,7 @@
}
else
{
<form asp-controller="Account" asp-action="ExternalLogin" asp-route-returnurl="@ViewData["ReturnUrl"]" method="post" class="form-horizontal">
<form mvc-action="@MVC.Account.ExternalLogin(null, returnUrl: ViewData["ReturnUrl"] as string)" method="post" class="form-horizontal">
<div>
<p>
@foreach (var provider in loginProviders)
Expand Down
2 changes: 1 addition & 1 deletion src/R4MvcHostApp/Views/Account/Register.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<h2>@ViewData["Title"].</h2>

<form asp-controller="Account" asp-action="Register" asp-route-returnurl="@ViewData["ReturnUrl"]" method="post" class="form-horizontal">
<form mvc-action="@MVC.Account.Register(ViewData["ReturnUrl"] as string)" asp-controller="Account" asp-action="Register" asp-route-returnurl="@ViewData["ReturnUrl"]" method="post" class="form-horizontal">
<h4>Create a new account.</h4>
<hr />
<div asp-validation-summary="All" class="text-danger"></div>
Expand Down
2 changes: 1 addition & 1 deletion src/R4MvcHostApp/Views/Account/ResetPassword.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<h2>@ViewData["Title"].</h2>

<form asp-controller="Account" asp-action="ResetPassword" method="post" class="form-horizontal">
<form mvc-action="MVC.Account.ResetPassword()" method="post" class="form-horizontal">
<h4>Reset your password.</h4>
<hr />
<div asp-validation-summary="All" class="text-danger"></div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@

<h1>@ViewData["Title"].</h1>
<p>
Your password has been reset. Please <a asp-controller="Account" asp-action="Login">Click here to log in</a>.
Your password has been reset. Please <a mvc-action="MVC.Account.Login()">Click here to log in</a>.
</p>
2 changes: 1 addition & 1 deletion src/R4MvcHostApp/Views/Account/SendCode.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<h2>@ViewData["Title"].</h2>

<form asp-controller="Account" asp-action="SendCode" asp-route-returnurl="@Model.ReturnUrl" method="post" class="form-horizontal">
<form mvc-action="@MVC.Account.SendCode(returnUrl: ViewData["ReturnUrl"] as string)" method="post" class="form-horizontal">
<input asp-for="RememberMe" type="hidden" />
<div class="row">
<div class="col-md-8">
Expand Down
2 changes: 1 addition & 1 deletion src/R4MvcHostApp/Views/Account/VerifyCode.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<h2>@ViewData["Title"].</h2>

<form asp-controller="Account" asp-action="VerifyCode" asp-route-returnurl="@Model.ReturnUrl" method="post" class="form-horizontal">
<form mvc-action="@MVC.Account.VerifyCode()" asp-route-returnurl="@ViewData["ReturnUrl"]" method="post" class="form-horizontal">
<div asp-validation-summary="All" class="text-danger"></div>
<input asp-for="Provider" type="hidden" />
<input asp-for="RememberMe" type="hidden" />
Expand Down
2 changes: 1 addition & 1 deletion src/R4MvcHostApp/Views/Manage/AddPhoneNumber.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
}

<h2>@ViewData["Title"].</h2>
<form asp-controller="Manage" asp-action="AddPhoneNumber" method="post" class="form-horizontal">
<form mvc-action="MVC.Manage.AddPhoneNumber()" method="post" class="form-horizontal">
<h4>Add a phone number.</h4>
<hr />
<div asp-validation-summary="All" class="text-danger"></div>
Expand Down
2 changes: 1 addition & 1 deletion src/R4MvcHostApp/Views/Manage/ChangePassword.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<h2>@ViewData["Title"].</h2>

<form asp-controller="Manage" asp-action="ChangePassword" method="post" class="form-horizontal">
<form mvc-action="MVC.Manage.ChangePassword()" method="post" class="form-horizontal">
<h4>Change Password Form</h4>
<hr />
<div asp-validation-summary="All" class="text-danger"></div>
Expand Down
16 changes: 8 additions & 8 deletions src/R4MvcHostApp/Views/Manage/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@
<dd>
@if (Model.HasPassword)
{
<a asp-controller="Manage" asp-action="ChangePassword" class="btn-bracketed">Change</a>
<a mvc-action="MVC.Manage.ChangePassword()" class="btn-bracketed">Change</a>
}
else
{
<a asp-controller="Manage" asp-action="SetPassword" class="btn-bracketed">Create</a>
<a mvc-action="MVC.Manage.SetPassword()" class="btn-bracketed">Create</a>
}
</dd>
<dt>External Logins:</dt>
<dd>

@Model.Logins.Count <a asp-controller="Manage" asp-action="ManageLogins" class="btn-bracketed">Manage</a>
@Model.Logins.Count <a mvc-action="MVC.Manage.ManageLogins()" class="btn-bracketed">Manage</a>
</dd>
<dt>Phone Number:</dt>
<dd>
Expand All @@ -37,14 +37,14 @@
@if (Model.PhoneNumber != null)
{
<br />
<a asp-controller="Manage" asp-action="AddPhoneNumber" class="btn-bracketed">Change</a>
<form asp-controller="Manage" asp-action="RemovePhoneNumber" method="post">
<a mvc-action="MVC.Manage.AddPhoneNumber()" class="btn-bracketed">Change</a>
<form mvc-action="MVC.Manage.RemovePhoneNumber()" method="post">
[<button type="submit" class="btn-link">Remove</button>]
</form>
}
else
{
<a asp-controller="Manage" asp-action="AddPhoneNumber" class="btn-bracketed">Add</a>
<a mvc-action="MVC.Manage.AddPhoneNumber()" class="btn-bracketed">Add</a>
}*@
</dd>

Expand All @@ -56,13 +56,13 @@
</p>
@*@if (Model.TwoFactor)
{
<form asp-controller="Manage" asp-action="DisableTwoFactorAuthentication" method="post" class="form-horizontal">
<form mvc=action="MVC.Manage.DisableTwoFactorAuthentication()" method="post" class="form-horizontal">
Enabled <button type="submit" class="btn-link btn-bracketed">Disable</button>
</form>
}
else
{
<form asp-controller="Manage" asp-action="EnableTwoFactorAuthentication" method="post" class="form-horizontal">
<form mvc-action="MVC.Manage.EnableTwoFactorAuthentication()" method="post" class="form-horizontal">
<button type="submit" class="btn-link btn-bracketed">Enable</button> Disabled
</form>
}*@
Expand Down
2 changes: 1 addition & 1 deletion src/R4MvcHostApp/Views/Manage/SetPassword.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
account so you can log in without an external login.
</p>

<form asp-controller="Manage" asp-action="SetPassword" asp-route-returnurl="@ViewData["ReturnUrl"]" method="post" class="form-horizontal">
<form mvc-action="MVC.Manage.SetPassword()" asp-route-returnurl="@ViewData["ReturnUrl"]" method="post" class="form-horizontal">
<h4>Set your password</h4>
<hr />
<div asp-validation-summary="All" class="text-danger"></div>
Expand Down
2 changes: 1 addition & 1 deletion src/R4MvcHostApp/Views/Manage/VerifyPhoneNumber.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<h2>@ViewData["Title"].</h2>

<form asp-controller="Manage" asp-action="VerifyPhoneNumber" asp-route-returnurl="@ViewData["ReturnUrl"]" method="post" class="form-horizontal">
<form mvc-action="MVC.Manage.VerifyPhoneNumber()" asp-route-returnurl="@ViewData["ReturnUrl"]" method="post" class="form-horizontal">
<input asp-for="PhoneNumber" type="hidden" />
<h4>Add a phone number.</h4>
<h5>@ViewData["Status"]</h5>
Expand Down
8 changes: 4 additions & 4 deletions src/R4MvcHostApp/Views/Shared/_Layout.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a asp-area="" asp-controller="Home" asp-action="Index" class="navbar-brand">R4MvcHostApp</a>
<a mvc-action="MVC.Home.Index()" class="navbar-brand">R4MvcHostApp</a>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li><a asp-area="" asp-controller="Home" asp-action="Index">Home</a></li>
<li><a asp-area="" asp-controller="Home" asp-action="About">About</a></li>
<li><a asp-area="" asp-controller="Home" asp-action="Contact">Contact</a></li>
<li><a mvc-action="MVC.Home.Index()">Home</a></li>
<li><a mvc-action="MVC.Home.About()">About</a></li>
<li><a mvc-action="MVC.Home.Contact()">Contact</a></li>
</ul>
@await Html.PartialAsync("_LoginPartial")
</div>
Expand Down
8 changes: 4 additions & 4 deletions src/R4MvcHostApp/Views/Shared/_LoginPartial.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@

@if (SignInManager.IsSignedIn(User))
{
<form asp-area="" asp-controller="Account" asp-action="Logout" method="post" id="logoutForm" class="navbar-right">
<form mvc-action="MVC.Account.Logout()" method="post" id="logoutForm" class="navbar-right">
<ul class="nav navbar-nav navbar-right">
<li>
<a asp-area="" asp-controller="Manage" asp-action="Index" title="Manage">Hello @UserManager.GetUserName(User)!</a>
<a mvc-action="MVC.Manage.Index()" title="Manage">Hello @UserManager.GetUserName(User)!</a>
</li>
<li>
<button type="submit" class="btn btn-link navbar-btn navbar-link">Log out</button>
Expand All @@ -20,7 +20,7 @@
else
{
<ul class="nav navbar-nav navbar-right">
<li><a asp-area="" asp-controller="Account" asp-action="Register">Register</a></li>
<li><a asp-area="" asp-controller="Account" asp-action="Login">Log in</a></li>
<li><a mvc-action="MVC.Account.Register()">Register</a></li>
<li><a mvc-action="MVC.Account.Login()">Log in</a></li>
</ul>
}

0 comments on commit dbf23e5

Please sign in to comment.