diff --git a/admin/app/admin/jam_ruby_users.rb b/admin/app/admin/jam_ruby_users.rb index 60f1dda4f..38c61b7da 100644 --- a/admin/app/admin/jam_ruby_users.rb +++ b/admin/app/admin/jam_ruby_users.rb @@ -81,6 +81,12 @@ ActiveAdmin.register JamRuby::User, :as => 'Users' do row :image do user.photo_url ? image_tag(user.photo_url) : '' end + row "Instruments" do + table_for user.musician_instruments.order('proficiency_level desc') do + column :instrument_id + end + + end end end diff --git a/web/app/assets/javascripts/react-components/CheckBoxList.js.jsx.coffee b/web/app/assets/javascripts/react-components/CheckBoxList.js.jsx.coffee index 3f9e62b31..466edf9e8 100644 --- a/web/app/assets/javascripts/react-components/CheckBoxList.js.jsx.coffee +++ b/web/app/assets/javascripts/react-components/CheckBoxList.js.jsx.coffee @@ -5,6 +5,8 @@ logger = context.JK.logger @CheckBoxList = React.createClass({ objects: [] + inited: false + componentDidMount: () -> @root = $(@getDOMNode()) @wireICheck() @@ -15,6 +17,10 @@ logger = context.JK.logger wireICheck: () -> checkBoxes = @root.find('input[type="checkbox"]') if checkBoxes.length > 0 + if @inited + # it's expensive to run context.JK.checkbox + return + @inited = true context.JK.checkbox(checkBoxes, true) checkBoxes.on('ifChanged', (e) => @checkIfCanFire(e)) diff --git a/web/app/assets/stylesheets/basic/basic.scss b/web/app/assets/stylesheets/basic/basic.scss index 52224f327..a4e271de2 100644 --- a/web/app/assets/stylesheets/basic/basic.scss +++ b/web/app/assets/stylesheets/basic/basic.scss @@ -63,9 +63,13 @@ html { .text-input input { width:$create-account-width; } + .select-input select{ + width:$create-account-width; + } .instructions.create-account { margin-top:1rem; + text-align:justify; } .success-msg { margin-top: 1rem; @@ -98,9 +102,15 @@ html { .text-input input { width:$create-account-width; } + .select-input select { + width:$create-account-width; + } .success-msg { margin-top: 2rem; } + .instructions.create-account { + text-align:justify; + } } body { @@ -473,6 +483,19 @@ h2.second-ready { text-align: center; } +.instrument-row { + font-size: $standard-font-size; + + margin-top: 1rem; + display: flex; + align-items: center; + flex-direction: column; + + width: 100%; + max-width: 1200px; + text-align: center; +} + .terms-row, .under13-row { font-size: $standard-font-size; @@ -506,6 +529,25 @@ h2.second-ready { border-radius:3px; border-width:2px; } + +} + +.select-input { + width:$create-account-width; + max-width: 400px; + position:relative; + + + select { + + font-size: $input-font-size; + padding: 6px 3px; + box-sizing: border-box; + text-align: left; + border-radius:3px; + border-width:2px; + } + } input[type=submit] { @@ -544,6 +586,11 @@ label.password { margin-left:-8.5rem; } +label.instrument-select { + width:8rem; + margin-left:-8.5rem; +} + .error { color:red; //text-transform: uppercase; diff --git a/web/app/controllers/landings_controller.rb b/web/app/controllers/landings_controller.rb index 6bc8987cd..15084ebe0 100644 --- a/web/app/controllers/landings_controller.rb +++ b/web/app/controllers/landings_controller.rb @@ -517,7 +517,6 @@ class LandingsController < ApplicationController return end - card = PosaCard.find_by_amazon_code(@code) if card @@ -581,6 +580,15 @@ class LandingsController < ApplicationController end else + + @instrument = params[:instrument] + if @instrument.nil? || @instrument == '' + @error = 'Please select an instrument' + render 'amazon_lessons_promo_2', layout: 'basic' + return + end + + @email = params[:email] @password = params[:password] terms_of_service = params[:terms].nil? || params[:terms] == "0" ? false : true @@ -600,7 +608,7 @@ class LandingsController < ApplicationController skip_recaptcha: true, musician: true, timezone: current_timezone, - instruments: [{:instrument_id => 'other', :proficiency_level => 1, :priority => 1}]) + instruments: [{:instrument_id => @instrument, :proficiency_level => 1, :priority => 1}]) if @user.errors.any? first = @user.errors.first @error = "#{first[0].to_s.humanize} #{first[1]}" diff --git a/web/app/views/landings/amazon_lessons_promo_1.slim b/web/app/views/landings/amazon_lessons_promo_1.slim index 38fc29de0..5c85a9afd 100644 --- a/web/app/views/landings/amazon_lessons_promo_1.slim +++ b/web/app/views/landings/amazon_lessons_promo_1.slim @@ -33,68 +33,15 @@ p = 'powered by ' = image_tag("web/logo_inverted.png") - .learn-more - h2 Learn More - p Recorded lessons available on YouTube and other apps are OK as supplementary resources, but a live instructor is still a must if you really want to learn and master an instrument. - ul - li Great instructors make sure the student is doing things properly – both physically and mentally – so that practice makes perfect, rather than building bad habits and a flawed foundation. - li Great instructors customize curriculum and methods to the student’s goals and capabilities at each step of the path, rather than blindly repeating a one-size-fits-all method. - li Great instructors answer the myriad of questions that inevitably arise along the way. - li Great instructors inspire and guide the student to break through frustrating obstacles to continue the journey. - p Connecting with the right instructor is by far the most important factor in the learning process, yet with traditional lessons you have to settle for a teacher who lives close to you rather than selecting the best teacher for you. Our instructors are both amazing musicians and teachers, and we have an incredibly deep pool of instructors from whom you may select your ideal match. Our teachers have been hired by and have shared the stage with a list of artists much too long to list, such as Michael Jackson, B.B. King, and Journey. Most have touring experience and music degrees, and all are background checked. - p In addition to the strength of our community of instructors, the JamKazam app for online music lessons is unique and delivers a truly amazing student experience, unlike Skype and other apps that were built for voice chat. As a student, you will enjoy studio quality audio, latency so low you can play in sync with your instructor, the ability to record key demonstrations in lessons to refer back to them later, and much more. - p Watch the video below to get a sense of how our unique app works for online music lessons: - .video-wrapper - .video-container - iframe src="//www.youtube.com/embed/6lICn4g5X-Q" frameborder="0" allowfullscreen="allowfullscreen" - p Watch the video below to see multiple bands playing together live using our app for an even more impressive understanding of the app’s unique capabilities: - .video-wrapper - .video-container - iframe src="//www.youtube.com/embed/I2reeNKtRjg" frameborder="0" allowfullscreen="allowfullscreen" - p And if you are going to want to learn how to play along with some of your favorite songs as you take lessons, watch the video below to see how our unique JamTracks feature helps you do this: - .video-wrapper - .video-container - iframe src="//www.youtube.com/embed/-rHfJggbgqk" frameborder="0" allowfullscreen="allowfullscreen" - - h2.second-ready Ready to sign up for your free lessons? - - .instructions.second - = 'Paste or enter your promotional code so we can validate it and credit you with 2 free lessons.' - - form.code-form method='POST' action='/account/activate/code' - .code-input - label.code-prompt.promo-code - = 'Promo Code:' - - if @error - .error = @error - input autofocus='autofocus' type='text' name='code' value=@code - - .code-hint-row - .code-instructions - = 'Your promo code is in the Amazon email notifying you of this award.' - .submit-row.second - .submit.submit-code - .amazon-button-stack - span.amazon-button - span.amazon-button-inner - a.amazon-a-button-text - = 'Submit Code' javascript: var submitted = false $('a.amazon-a-button-text').on('click', function (e) { - var $this = $(this); - console.log("THIS", $this) - var $closest = $this.closest('.submit-row') - console.log("$closest", $closest) - var $form = $closest.siblings('form.code-form') - console.log("$FORM", $form) if (!submitted) { submitted = true - $form.submit() + $('form.code-form').submit() } - }) - + }) \ No newline at end of file diff --git a/web/app/views/landings/amazon_lessons_promo_2.slim b/web/app/views/landings/amazon_lessons_promo_2.slim index a9e509b0f..10a81b51c 100644 --- a/web/app/views/landings/amazon_lessons_promo_2.slim +++ b/web/app/views/landings/amazon_lessons_promo_2.slim @@ -29,7 +29,7 @@ form#root method='POST' action='/account/activate/signup' = 'Apply Credits' -else .instructions.create-account - = 'Enter your email address and password so we can create a JamKazam account for you and credit your account with your 2 free lessons.' + = 'Please let us know what kind of instrument you bought from Amazon, and enter your email address and a password so we can create a JamKazam account for you and credit your account with 2 free lessons.' .code-form.create-account .text-input @@ -45,6 +45,15 @@ form#root method='POST' action='/account/activate/signup' label.code-prompt.password = 'Password:' input type='password' name='password' value=@password + .instrument-row + .select-input + label.code-prompt.instrument-select + = 'Instrument:' + select name='instrument' value='' + option value='' Please Select One + option value='acoustic guitar' Acoustic Guitar + option value='electric guitar' Electric Guitar + option value='other' Other .terms-row label.code-prompt .checkbox-input diff --git a/web/spec/features/activate_account_spec.rb b/web/spec/features/activate_account_spec.rb index 9e6032ac8..39a4d92ea 100644 --- a/web/spec/features/activate_account_spec.rb +++ b/web/spec/features/activate_account_spec.rb @@ -27,6 +27,7 @@ describe "Activate Account Card", :js => true, :type => :feature, :capybara_feat find('.success-msg wbr', 'Your code has been validated!') fill_in "email", with: "amzposa1@jamkazam.com" fill_in "password", with: "jam123" + select 'Acoustic Guitar', from: "instrument" find('.checkbox-input input').trigger(:click) find('a.amazon-a-button-text', text: 'Create Account').trigger(:click) @@ -42,6 +43,7 @@ describe "Activate Account Card", :js => true, :type => :feature, :capybara_feat user.reload user.jamclass_credits.should eq(amazon_2_free_card.credits) user.timezone.should_not be_nil + user.instruments.should eq([Instrument.find('acoustic guitar')]) end it "validates correctly" do @@ -55,10 +57,12 @@ describe "Activate Account Card", :js => true, :type => :feature, :capybara_feat find('.success-msg wbr', 'Your code has been validated!') find('a.amazon-a-button-text', text: 'Create Account').trigger(:click) + select 'Acoustic Guitar', from: "instrument" find('.error', text: "Email can't be blank") fill_in "email", with: "amzpos2@jamkazam.com" fill_in "password", with: "jam123" + select 'Acoustic Guitar', from: "instrument" find('.checkbox-input input').trigger(:click) find('a.amazon-a-button-text', text: 'Create Account').trigger(:click)