#jamtrackScreen.screen.secondary.no-login-required layout='screen' layout-id='jamtrackBrowse'
  .content
    .content-head
      .content-icon=image_tag("content/icon_jamtracks.png", height:19,  width:19 )
      h1 jamtracks
      =render "screen_navigation"
    .content-body
      =form_tag('', {:id => 'jamtrack-find-form', :class => 'inner-content'}) do
        =render(:partial => "web_filter", :locals => {:search_type => Search::PARAM_JAMTRACK})
        .filter-body
          .content-body-scroller
            .profile-wrapper
              h2 shop for jamtracks
              table.generaltable.jamtrack-table
                thead
                  tr
                    th.jamtrack-detail JAMTRACK
                    th.jamtrack-tracks TRACKS INCLUDED / PREVIEW
                    th.jamtrack-action SHOP
                tbody.jamtrack-content
              a.btn-next-pager href="/api/jamtracks?page=1" Next
              .end-of-jamtrack-list.end-of-list="No more Jamtracks"

script#template-jamtrack type='text/template' 
  tr.jamtrack-record jamtrack-id="{{data.jamtrack.id}}"     
    td.jamtrack-detail
      .jamtrack-name
        | "{{data.jamtrack.name}}"
      .jamtrack-original-artist
        | by {{data.jamtrack.original_artist}}
      br clear="all"
      .clearall.detail-label.extra.hidden.song-writer
        | Songwriters:
      .detail-value.extra.hidden
        | {{data.jamtrack.songwriter}}
      .clearall.detail-label.extra.hidden
        | Publishers:
      .detail-value.extra.hidden
        | {{data.jamtrack.publisher}}
      .clearall.detail-label.extra.hidden
        | Genre:
      .detail-value.extra.hidden
        | {{data.jamtrack.genres[0]}}
      .clearall.detail-label.extra.hidden
        | Version:
      .detail-value.extra.hidden
        | {{data.jamtrack.recording_type}}
    td.jamtrack-tracks
      .detail-arrow
        .jamtrack-detail-btn
          ="{% if (data.expanded) { %}"
          | hide tracks
          a.details-arrow.arrow-up
          ="{% } else { %}"          
          | show all tracks
          a.details-arrow.arrow-down
          ="{% } %}"
      ="{% _.each(data.jamtrack.tracks, function(track) { %}"
      .jamtrack-track.hidden jamtrack-track-id="{{track.id}}"
        / .instrument-desc
        /   | {{track.instrument_desc}}
        /.track-instrument 
        .jamtrack-preview
          .clearall      
      ="{% }); %}"
    td.jamtrack-action
      .jamtrack-action-container
        .jamtrack-actions
          / a.play-button href="#" data-jamtrack-id="{{data.jamtrack.id}}"
          /   =image_tag "shared/play_button.png"
          .jamtrack-price class="{{data.free_state}}"
            | {{"$ " + data.jamtrack.price}}
          ="{% if (data.is_free) { %}"
          a.jamtrack-add-cart.button-orange.is_free href="#" data-jamtrack-id="{{data.jamtrack.id}}" GET IT FREE!
          ="{% } else if (data.jamtrack.purchased) { %}"
          a.jamtrack-add-cart-disabled.button-grey.button-disabled href="javascript:void(0)"  PURCHASED
          ="{% } else if (data.jamtrack.added_cart) { %}"
          a.jamtrack-add-cart-disabled.button-grey.button-disabled href="client#/shoppingCart"  ALREADY IN CART
          ="{% } else { %}"
          a.jamtrack-add-cart.button-orange href="#" data-jamtrack-id="{{data.jamtrack.id}}"  ADD TO CART
          ="{% }; %}"
          ="{% if (data.jamtrack.sales_region==JK.AVAILABILITY_US) { %}"
          .jamtrack-license
            | This JamTrack available only to US customers. &nbsp;&nbsp;&nbsp;&nbsp;
            a.license-us-why.orange href="#" why?
          ="{% }; %}"
