some first traunch of improveents for amazon prom

This commit is contained in:
Seth Call 2018-05-05 12:05:52 -05:00
parent b65d04c384
commit 88c23d3f8a
7 changed files with 85 additions and 58 deletions

View File

@ -81,6 +81,12 @@ ActiveAdmin.register JamRuby::User, :as => 'Users' do
row :image do row :image do
user.photo_url ? image_tag(user.photo_url) : '' user.photo_url ? image_tag(user.photo_url) : ''
end end
row "Instruments" do
table_for user.musician_instruments.order('proficiency_level desc') do
column :instrument_id
end
end
end end
end end

View File

@ -5,6 +5,8 @@ logger = context.JK.logger
@CheckBoxList = React.createClass({ @CheckBoxList = React.createClass({
objects: [] objects: []
inited: false
componentDidMount: () -> componentDidMount: () ->
@root = $(@getDOMNode()) @root = $(@getDOMNode())
@wireICheck() @wireICheck()
@ -15,6 +17,10 @@ logger = context.JK.logger
wireICheck: () -> wireICheck: () ->
checkBoxes = @root.find('input[type="checkbox"]') checkBoxes = @root.find('input[type="checkbox"]')
if checkBoxes.length > 0 if checkBoxes.length > 0
if @inited
# it's expensive to run context.JK.checkbox
return
@inited = true
context.JK.checkbox(checkBoxes, true) context.JK.checkbox(checkBoxes, true)
checkBoxes.on('ifChanged', (e) => @checkIfCanFire(e)) checkBoxes.on('ifChanged', (e) => @checkIfCanFire(e))

View File

@ -63,9 +63,13 @@ html {
.text-input input { .text-input input {
width:$create-account-width; width:$create-account-width;
} }
.select-input select{
width:$create-account-width;
}
.instructions.create-account { .instructions.create-account {
margin-top:1rem; margin-top:1rem;
text-align:justify;
} }
.success-msg { .success-msg {
margin-top: 1rem; margin-top: 1rem;
@ -98,9 +102,15 @@ html {
.text-input input { .text-input input {
width:$create-account-width; width:$create-account-width;
} }
.select-input select {
width:$create-account-width;
}
.success-msg { .success-msg {
margin-top: 2rem; margin-top: 2rem;
} }
.instructions.create-account {
text-align:justify;
}
} }
body { body {
@ -473,6 +483,19 @@ h2.second-ready {
text-align: center; 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 { .terms-row, .under13-row {
font-size: $standard-font-size; font-size: $standard-font-size;
@ -506,6 +529,25 @@ h2.second-ready {
border-radius:3px; border-radius:3px;
border-width:2px; 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] { input[type=submit] {
@ -544,6 +586,11 @@ label.password {
margin-left:-8.5rem; margin-left:-8.5rem;
} }
label.instrument-select {
width:8rem;
margin-left:-8.5rem;
}
.error { .error {
color:red; color:red;
//text-transform: uppercase; //text-transform: uppercase;

View File

@ -517,7 +517,6 @@ class LandingsController < ApplicationController
return return
end end
card = PosaCard.find_by_amazon_code(@code) card = PosaCard.find_by_amazon_code(@code)
if card if card
@ -581,6 +580,15 @@ class LandingsController < ApplicationController
end end
else 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] @email = params[:email]
@password = params[:password] @password = params[:password]
terms_of_service = params[:terms].nil? || params[:terms] == "0" ? false : true terms_of_service = params[:terms].nil? || params[:terms] == "0" ? false : true
@ -600,7 +608,7 @@ class LandingsController < ApplicationController
skip_recaptcha: true, skip_recaptcha: true,
musician: true, musician: true,
timezone: current_timezone, 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? if @user.errors.any?
first = @user.errors.first first = @user.errors.first
@error = "#{first[0].to_s.humanize} #{first[1]}" @error = "#{first[0].to_s.humanize} #{first[1]}"

View File

@ -33,68 +33,15 @@
p p
= 'powered by ' = 'powered by '
= image_tag("web/logo_inverted.png") = 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 students 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 apps 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: javascript:
var submitted = false var submitted = false
$('a.amazon-a-button-text').on('click', function (e) { $('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) { if (!submitted) {
submitted = true submitted = true
$form.submit() $('form.code-form').submit()
} }
}) })

View File

@ -29,7 +29,7 @@ form#root method='POST' action='/account/activate/signup'
= 'Apply Credits' = 'Apply Credits'
-else -else
.instructions.create-account .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 .code-form.create-account
.text-input .text-input
@ -45,6 +45,15 @@ form#root method='POST' action='/account/activate/signup'
label.code-prompt.password label.code-prompt.password
= 'Password:' = 'Password:'
input type='password' name='password' value=@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 .terms-row
label.code-prompt label.code-prompt
.checkbox-input .checkbox-input

View File

@ -27,6 +27,7 @@ describe "Activate Account Card", :js => true, :type => :feature, :capybara_feat
find('.success-msg wbr', 'Your code has been validated!') find('.success-msg wbr', 'Your code has been validated!')
fill_in "email", with: "amzposa1@jamkazam.com" fill_in "email", with: "amzposa1@jamkazam.com"
fill_in "password", with: "jam123" fill_in "password", with: "jam123"
select 'Acoustic Guitar', from: "instrument"
find('.checkbox-input input').trigger(:click) find('.checkbox-input input').trigger(:click)
find('a.amazon-a-button-text', text: 'Create Account').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.reload
user.jamclass_credits.should eq(amazon_2_free_card.credits) user.jamclass_credits.should eq(amazon_2_free_card.credits)
user.timezone.should_not be_nil user.timezone.should_not be_nil
user.instruments.should eq([Instrument.find('acoustic guitar')])
end end
it "validates correctly" do 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('.success-msg wbr', 'Your code has been validated!')
find('a.amazon-a-button-text', text: 'Create Account').trigger(:click) find('a.amazon-a-button-text', text: 'Create Account').trigger(:click)
select 'Acoustic Guitar', from: "instrument"
find('.error', text: "Email can't be blank") find('.error', text: "Email can't be blank")
fill_in "email", with: "amzpos2@jamkazam.com" fill_in "email", with: "amzpos2@jamkazam.com"
fill_in "password", with: "jam123" fill_in "password", with: "jam123"
select 'Acoustic Guitar', from: "instrument"
find('.checkbox-input input').trigger(:click) find('.checkbox-input input').trigger(:click)
find('a.amazon-a-button-text', text: 'Create Account').trigger(:click) find('a.amazon-a-button-text', text: 'Create Account').trigger(:click)