Permalink
Browse files

Pivoted the TabCart layout

  • Loading branch information...
avanderhoorn committed Jul 18, 2013
1 parent e1fb2ca commit e6d5eb04b249f63ff8ed7ed0f5497be7012abbd3
Showing with 10 additions and 3 deletions.
  1. +10 −3 source/Glimpse.Mvc3.MusicStore.Sample/Framework/TabCart.cs
@@ -7,7 +7,7 @@
namespace MvcMusicStore.Framework
{
- public class TabCart : AspNetTab, ITabLayout
+ public class TabCart : AspNetTab, ITabLayout, ILayoutControl
{
private static readonly object Layout = TabLayout.Create()
.Cell("items", TabLayout.Create().Row(r =>
@@ -26,6 +26,11 @@ public override string Name
get { return "Cart"; }
}
+ public bool KeysHeadings
+ {
+ get { return true; }
+ }
+
public override object GetData(ITabContext context)
{
var httpContext = context.GetHttpContext();
@@ -35,8 +40,10 @@ public override object GetData(ITabContext context)
var root = new
{
- CartId = ShoppingCart.GetCartId(httpContext),
- Total = items.Any() ? items.Sum(x => x.AlbumPrice).ToString() : "--",
+ Details = new {
+ CartId = ShoppingCart.GetCartId(httpContext),
+ Total = items.Any() ? items.Sum(x => x.AlbumPrice).ToString() : "--"
+ },
Items = items
};

0 comments on commit e6d5eb0

Please sign in to comment.