Browse Source
* Adding slugify parameter transform Fixes #172 * Cleaning up code And slugifying my ordersmain
committed by
GitHub
8 changed files with 92 additions and 76 deletions
@ -0,0 +1,17 @@ |
|||||
|
using Microsoft.AspNetCore.Routing; |
||||
|
using System.Text.RegularExpressions; |
||||
|
|
||||
|
namespace Microsoft.eShopWeb.Web |
||||
|
{ |
||||
|
|
||||
|
public class SlugifyParameterTransformer : IOutboundParameterTransformer |
||||
|
{ |
||||
|
public string TransformOutbound(object value) |
||||
|
{ |
||||
|
if (value == null) { return null; } |
||||
|
|
||||
|
// Slugify value
|
||||
|
return Regex.Replace(value.ToString(), "([a-z])([A-Z])", "$1-$2").ToLower(); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -1,64 +1,55 @@ |
|||||
@if (Context.User.Identity.IsAuthenticated) |
@if (Context.User.Identity.IsAuthenticated) |
||||
{ |
{ |
||||
<section class="col-lg-4 col-md-5 col-xs-12"> |
<section class="col-lg-4 col-md-5 col-xs-12"> |
||||
<div class="esh-identity"> |
<div class="esh-identity"> |
||||
<form asp-area="" asp-controller="Account" asp-action="SignOut" method="post" id="logoutForm" class="navbar-right"> |
<form asp-area="" asp-controller="Account" asp-action="SignOut" method="post" id="logoutForm" class="navbar-right"> |
||||
<section class="esh-identity-section"> |
<section class="esh-identity-section"> |
||||
|
@*<div class="esh-identity-name">@User.FindFirst(x => x.Type == "preferred_username").Value</div>*@ |
||||
@*<div class="esh-identity-name">@User.FindFirst(x => x.Type == "preferred_username").Value</div>*@ |
<img class="esh-identity-image" src="~/images/arrow-down.png"> |
||||
<img class="esh-identity-image" src="~/images/arrow-down.png"> |
</section> |
||||
</section> |
<section class="esh-identity-drop"> |
||||
|
<a class="esh-identity-item" |
||||
<section class="esh-identity-drop"> |
asp-controller="Order" |
||||
|
asp-action="MyOrders"> |
||||
<a class="esh-identity-item" |
<div class="esh-identity-name esh-identity-name--upper">My orders</div> |
||||
asp-controller="Order" |
<img class="esh-identity-image" src="~/images/my_orders.png"> |
||||
asp-action="Index"> |
</a> |
||||
|
<a class="esh-identity-item" |
||||
<div class="esh-identity-name esh-identity-name--upper">My orders</div> |
asp-controller="Manage" |
||||
<img class="esh-identity-image" src="~/images/my_orders.png"> |
asp-action="MyAccount"> |
||||
</a> |
<div class="esh-identity-name esh-identity-name--upper">My account</div> |
||||
|
<img class="esh-identity-image" src="~/images/my_orders.png"> |
||||
<a class="esh-identity-item" |
</a> |
||||
asp-controller="Manage" |
<a class="esh-identity-item" |
||||
asp-action="Index"> |
href="javascript:document.getElementById('logoutForm').submit()"> |
||||
|
<div class="esh-identity-name esh-identity-name--upper">Log Out</div> |
||||
<div class="esh-identity-name esh-identity-name--upper">My account</div> |
<img class="esh-identity-image" src="~/images/logout.png"> |
||||
<img class="esh-identity-image" src="~/images/my_orders.png"> |
</a> |
||||
</a> |
</section> |
||||
|
</form> |
||||
<a class="esh-identity-item" |
</div> |
||||
href="javascript:document.getElementById('logoutForm').submit()"> |
</section> |
||||
|
|
||||
<div class="esh-identity-name esh-identity-name--upper">Log Out</div> |
|
||||
<img class="esh-identity-image" src="~/images/logout.png"> |
|
||||
</a> |
|
||||
</section> |
|
||||
</form> |
|
||||
</div> |
|
||||
</section> |
|
||||
|
|
||||
<section class="col-lg-1 col-xs-12"> |
<section class="col-lg-1 col-xs-12"> |
||||
@await Component.InvokeAsync("Basket", User.Identity.Name) |
@await Component.InvokeAsync("Basket", User.Identity.Name) |
||||
</section> |
</section> |
||||
|
|
||||
} |
} |
||||
else |
else |
||||
{ |
{ |
||||
<section class="col-lg-1 col-lg-offset-3 col-md-3 col-xs-6"> |
<section class="col-lg-1 col-lg-offset-3 col-md-3 col-xs-6"> |
||||
<div class="esh-identity"> |
<div class="esh-identity"> |
||||
<section class="esh-identity-section"> |
<section class="esh-identity-section"> |
||||
<div class="esh-identity-item"> |
<div class="esh-identity-item"> |
||||
|
<a asp-area="" asp-controller="Account" asp-action="SignIn" class="esh-identity-name esh-identity-name--upper"> |
||||
<a asp-area="" asp-controller="Account" asp-action="SignIn" class="esh-identity-name esh-identity-name--upper"> |
Login |
||||
Login |
</a> |
||||
</a> |
</div> |
||||
</div> |
</section> |
||||
</section> |
</div> |
||||
</div> |
</section> |
||||
</section> |
|
||||
|
<section class="col-lg-1 col-xs-12"> |
||||
<section class="col-lg-1 col-xs-12"> |
@await Component.InvokeAsync("Basket") |
||||
@await Component.InvokeAsync("Basket") |
</section> |
||||
</section> |
|
||||
} |
} |
||||
|
|||||
Loading…
Reference in new issue