
- provide(:title, 'Jam Track Preview')

.content-wrapper
  h2 Jam Track Preview

  #players


javascript:
  var initialized = false;
  $(document).on('JAMKAZAM_READY', function(e, data) {

    var rest = JK.Rest();

    if(gon.jamTrackPlanCode) {
      rest.getJamTrack({plan_code: gon.jamTrackPlanCode})
              .done(function(jamTrack) {
                var $players = $('#players')

                _.each(jamTrack.tracks, function(track) {

                  var $element = $('<div class="meh"></div>')

                  $players.append($element);

                  new JK.JamTrackPreview(data.app, $element, jamTrack, track, {master_shows_duration: true,color:'black'})
                })
              })
              .fail(function() {
                alert("couldn't fetch jam track")
              })

    }
    else {
      alert("You need to add ?jam_track_plan_code=jamtracks-acdc-backinblack for this to work (or any jamtrack 'plancode')")
    }


    })
