%div{ layout: 'screen', :'layout-id' => 'shoppingCart', id: 'shoppingCartScreen', :class => 'screen secondary no-login-required'}
  .content
    .content-head
      .content-icon= image_tag("content/icon_shopping_cart.png", {:height => 19, :width => 19})
      %h1 shopping cart
      = render "screen_navigation"
    .content-body
      .content-body-scroller
        .shopping-cart-content

%script{type: 'text/template', id: 'template-shopping-cart-header'}
  .checkout-image= image_tag "content/checkmark.png", {:height => 32}
  .checkout-desc
    %div
      1 item added to shopping cart
    %div
      {{data.product_info.sale_display}}
    = "{% if (data.any_in_us) { %}"
    .note
      Note: You must be in the United States to purchase this {{data.type}} due to licensing constraints.
    = "{% } %}"
  .clearall

%script{type: 'text/template', id: 'template-shopping-cart-body'}
  %table.cart-items
    %thead
      %tr
        %th.cart-item-caption
          YOUR SHOPPING CART NOW CONTAINS
        %th.cart-item-price
          PRICE
        %th.cart-item-quantity
          QUANTITY
    %tbody
      = "{% if (data.carts.length == 0) { %}"
      %tr
        %td.no-cart-items{colspan: 4} Nothing in cart
      = "{% } %}"

      = "{% _.each(data.carts, function(cart, index) { %}"
      %tr.cart-item{"cart-id" => "{{cart.id}}"}
        %td.cart-item-caption
          {{cart.product_info.sale_display}}
        %td.cart-item-price
          %span.cart-price $ {{Number(cart.product_info.real_price).toFixed(2)}}
          = "{% if(index == data.carts.length - 1) { %}"
          .shopping-sub-total
            %span.sub-total-text Subtotal:
            %span.sub-total-value $ {{data.sub_total.toFixed(2)}}
        = "{% } %}"

        %td.cart-item-quantity
          %span.cart-value {{cart.quantity}}
          %a.remove-cart{href: "#", "cart-id" => "{{cart.id}}"} delete
      = "{% }); %}"
  .clearall
  .right.actions
    %a.button-grey{href: "#"} HELP
    %a.button-orange.continue-shopping{href: "/client#/jamtrack/search"} CONTINUE SHOPPING
    %a.button-orange.proceed-checkout{href: "#"} PROCEED TO CHECKOUT
  .clearall