- provide(:page_name, 'landing_page full product_jamblaster')
- provide(:description, 'The JamBlaster enables music lessons over the internet, in real-time')
- provide(:title, "Pre-order your JamBlaster now!")

= react_component 'ProductJamBlasterPage', @page_data.to_json

- content_for :after_black_bar do
  .row.cta-row
    h2 PRE-ORDER YOUR JAMBLASTER NOW!
    p The JamBlaster hit 347% of its Kickstarter goal. Now you can pre-order from our next batch.
    p.cta-text Not sure if JamBlaster is for you? Scroll down to learn more.

- content_for :white_bar do
  = react_component 'ProductJamBlasterBottomPage', @page_data.to_json

- content_for :red_bar do
  .full-row
    a.jamblaster-pre-order data-celery="5675ffb8004f6711002918b6" data-celery-version="v2"
      | Pre-order the JamBlaster today!

javascript:

  function promptConfirmed(app) {
    window.JK.Banner.show({
      title: 'virtual order placed',
      html: '<p>Thank you for signing up for a JamBlaster.</p>  <p>When it becomes available, we will reach back out to you via email.</p>',
      buttons: [
        {
          name: 'CLOSE', click: function () {
        }
        }
      ]
    })
  }
  function confirmOrder(app) {
    app.updateUserModel({want_jamblaster: true})
            .done(function () {
              promptConfirmed(app)
            })
            .fail(function () {
              data.app.layout.notify("Unable to take your virtual order at this time. Please try again later.")
            })
  }

  $(document).on('JAMKAZAM_READY', function (e, data) {
    if($.QueryString['want_jamblaster'] == 'true') {
      data.app.user()
        .done(function() {
          // if we have a user, then mark them as having
          confirmOrder(data.app);
        })
    }
    else if(window.JK.signupData  && window.JK.signupData.want_jamblaster) {
      // if the user has come here as a result of a signup attempt, and if they indicated that they want the jamblaster, tell em it's done
       promptConfirmed(data.app)
    }

    return false;
  })

