diff --git a/db/manifest b/db/manifest index 08b38d4d1..3eefec9fa 100755 --- a/db/manifest +++ b/db/manifest @@ -377,4 +377,5 @@ guitar_center_integration_v1.sql mobile_recording_support.sql youtube_broadcast.sql amazon_v1.sql -sms_index_optimize.sql \ No newline at end of file +sms_index_optimize.sql +amazon_signup.sql \ No newline at end of file diff --git a/db/up/amazon_signup.sql b/db/up/amazon_signup.sql new file mode 100644 index 000000000..471c7783a --- /dev/null +++ b/db/up/amazon_signup.sql @@ -0,0 +1 @@ +ALTER TABLE users ADD COLUMN under_13 BOOLEAN; \ No newline at end of file diff --git a/db/up/sms_index_optimize.sql b/db/up/sms_index_optimize.sql index 13b0bb204..715bb9f36 100644 --- a/db/up/sms_index_optimize.sql +++ b/db/up/sms_index_optimize.sql @@ -202,6 +202,8 @@ $$ LANGUAGE plpgsql; -- CREATE INDEX index_music_sessions_on_create_type ON music_sessions USING btree(create_type); -- CREATE INDEX index_music_sessions_on_scheduled_start ON music_sessions USING btree(scheduled_start); -- CREATE INDEX index_music_sessions_on_canceled ON music_sessions USING btree(canceled); +-- CREATE INDEX index_music_sessions_on_session_removed_at ON music_sessions USING btree(session_removed_at); +-- CREATE INDEX index_music_sessions_on_started_at ON music_sessions USING btree(started_at); -- update music_sessions set canceled = true WHERE (scheduled_start IS NULL OR scheduled_start > (NOW() - (interval '15 minute'))) AND canceled = FALSE AND description != 'Jam Track Session' AND id NOT IN (SELECT id FROM active_music_sessions) AND id NOT IN (select distinct on(name, user_id) id FROM music_sessions WHERE (scheduled_start IS NULL OR scheduled_start > (NOW() - (interval '15 minute'))) AND canceled = FALSE AND description != 'Jam Track Session' AND id NOT IN (SELECT id FROM active_music_sessions) order by name, user_id); @@ -211,4 +213,27 @@ $$ LANGUAGE plpgsql; -- select distinct on(name, user_id) name, description, scheduled_start FROM music_sessions WHERE (scheduled_start IS NULL OR scheduled_start > (NOW() - (interval '15 minute'))) AND canceled = FALSE AND description != 'Jam Track Session' AND id NOT IN (SELECT id FROM active_music_sessions) order by name, user_id; -- get count --- SELECT count(id) FROM music_sessions WHERE (scheduled_start IS NULL OR scheduled_start > (NOW() - (interval '15 minute'))) AND canceled = FALSE AND description != 'Jam Track Session' AND id NOT IN (SELECT id FROM active_music_sessions) \ No newline at end of file +-- SELECT count(id) FROM music_sessions WHERE (scheduled_start IS NULL OR scheduled_start > (NOW() - (interval '15 minute'))) AND canceled = FALSE AND description != 'Jam Track Session' AND id NOT IN (SELECT id FROM active_music_sessions) + + +SELECT distinct music_sessions.* FROM "music_sessions" LEFT OUTER JOIN + rsvp_slots + ON + music_sessions.id = rsvp_slots.music_session_id AND (music_sessions.canceled = FALSE) + + LEFT OUTER JOIN + rsvp_requests_rsvp_slots + ON + rsvp_requests_rsvp_slots.rsvp_slot_id = rsvp_slots.id + LEFT OUTER JOIN + rsvp_requests + ON rsvp_requests.id = rsvp_requests_rsvp_slots.rsvp_request_id + LEFT OUTER JOIN + invitations + ON + music_sessions.id = invitations.music_session_id AND invitations.receiver_id = 'aedab51a-14cd-46d1-9828-29eadddd1f53' + + + WHERE + (music_sessions.scheduled_start IS NULL OR (music_sessions.scheduled_start > NOW() - '12 hour'::INTERVAL AND music_sessions.started_at IS NULL) OR (music_sessions.session_removed_at > NOW() - '2 hour'::INTERVAL) OR (music_sessions.started_at IS NOT NULL AND music_sessions.session_removed_at IS NULL)) AND (music_sessions.create_type IS NULL OR (music_sessions.create_type != 'quick-start' AND music_sessions.create_type != 'quick-public')) AND + ((rsvp_requests.id IS NOT NULL AND rsvp_requests_rsvp_slots.id IS NOT NULL AND rsvp_requests.user_id = 'aedab51a-14cd-46d1-9828-29eadddd1f53' AND rsvp_requests_rsvp_slots.chosen = true) OR (invitations.id IS NOT NULL) OR (music_sessions.user_id = 'aedab51a-14cd-46d1-9828-29eadddd1f53') ) ORDER BY music_sessions.scheduled_start ASC; \ No newline at end of file diff --git a/ruby/lib/jam_ruby/models/lesson_package_type.rb b/ruby/lib/jam_ruby/models/lesson_package_type.rb index 7c93e3d98..c41cd3363 100644 --- a/ruby/lib/jam_ruby/models/lesson_package_type.rb +++ b/ruby/lib/jam_ruby/models/lesson_package_type.rb @@ -17,6 +17,7 @@ module JamRuby AMAZON_TEST_DRIVE_FREE_2_ID = 'amazon-test-drive-free-2' AMAZON_TEST_DRIVE_FREE_4_ID = 'amazon-test-drive-free-4' + AMAZON_PACKAGES = [AMAZON_TEST_DRIVE_4_PAID_ID, AMAZON_TEST_DRIVE_FREE_2_ID, AMAZON_TEST_DRIVE_FREE_4_ID] LESSON_PACKAGE_TYPES = [ SINGLE_FREE, diff --git a/ruby/lib/jam_ruby/models/posa_card.rb b/ruby/lib/jam_ruby/models/posa_card.rb index 604dee8fe..8574c9961 100644 --- a/ruby/lib/jam_ruby/models/posa_card.rb +++ b/ruby/lib/jam_ruby/models/posa_card.rb @@ -42,6 +42,9 @@ module JamRuby self.is_lesson end + def self.find_by_amazon_code(code) + PosaCard.where('code ilike ?', code).where('lesson_package_type_id in (?)', LessonPackageType::AMAZON_PACKAGES).first + end def already_activated if activated_at && activated_at_was && activated_at_changed? diff --git a/ruby/lib/jam_ruby/models/user.rb b/ruby/lib/jam_ruby/models/user.rb index 6db0617d0..2109eae41 100644 --- a/ruby/lib/jam_ruby/models/user.rb +++ b/ruby/lib/jam_ruby/models/user.rb @@ -1166,6 +1166,7 @@ module JamRuby education_interest = options[:education_interest] origin = options[:origin] test_drive_package_details = options[:test_drive_package] + under_13 = options[:under_13] test_drive_package = TestDrivePackage.find_by_name(test_drive_package_details[:name]) if test_drive_package_details @@ -1204,6 +1205,7 @@ module JamRuby user.gifted_jamtracks = 0 user.jamclass_credits = 0 user.has_redeemable_jamtrack = true + user.under_13 = under_13 user.is_a_student = !!student user.is_a_teacher = !!teacher user.retailer_interest = !!retailer_interest @@ -1464,7 +1466,7 @@ module JamRuby body << " Code: #{posa_card.code}\n" end - AdminMailer.jamclass_alerts({subject: "#{user.name} just signed up as a student", body: body}).deliver_now + AdminMailer.jamclass_alerts({subject: "#{user.email} just signed up as a student", body: body}).deliver_now UserMailer.student_welcome_message(user).deliver_now #end elsif user.is_a_teacher diff --git a/web/app/assets/javascripts/JamServer.js b/web/app/assets/javascripts/JamServer.js index 06cd1b905..d57d1ff37 100644 --- a/web/app/assets/javascripts/JamServer.js +++ b/web/app/assets/javascripts/JamServer.js @@ -292,10 +292,15 @@ }, 0) } + function setActive(active) { + if(context.UserActivityActions) { + context.UserActivityActions.setActive(active) + } + } function markAway() { logger.debug("sleep again!") active = false; - context.UserActivityActions.setActive(active) + setActive(active) var userStatus = msg_factory.userStatus(false, null); server.send(userStatus); } @@ -303,7 +308,7 @@ function activityCheck() { var timeoutTime = 300000; // 5 * 1000 * 60 , 5 minutes active = true; - context.UserActivityActions.setActive(active) + setActive(active) activityTimeout = setTimeout(markAway, timeoutTime); $(document).ready(function() { $('body').bind('mousedown keydown touchstart focus', function(event) { @@ -320,7 +325,7 @@ } } active = true; - context.UserActivityActions.setActive(active) + setActive(active) activityTimeout = setTimeout(markAway, timeoutTime); }); }); diff --git a/web/app/assets/javascripts/basic/basic.js b/web/app/assets/javascripts/basic/basic.js new file mode 100644 index 000000000..331325c3c --- /dev/null +++ b/web/app/assets/javascripts/basic/basic.js @@ -0,0 +1,19 @@ +//= require bluebird +//= require babel/polyfill +//= require bugsnag +//= require bind-polyfill +//= require jquery +//= require jquery.monkeypatch +//= require jquery_ujs +//= require jquery.cookie +//= require AAC_underscore +//= require AAA_Log +//= require globals +//= require AAB_message_factory +//= require jam_rest +//= require ga +//= require layout +//= require jamkazam +//= require utils +//= require JamServer +//= require everywhere/everywhere \ No newline at end of file diff --git a/web/app/assets/stylesheets/basic/basic.scss b/web/app/assets/stylesheets/basic/basic.scss new file mode 100644 index 000000000..a30817f3d --- /dev/null +++ b/web/app/assets/stylesheets/basic/basic.scss @@ -0,0 +1,459 @@ +/** +*= require client/jamServer +*= require client/jamServer +*= require dialogs/banner +*/ + +$base-font-family: 'arial', sans-serif; + +$standard-font-size: 1rem; +$smaller-font-size: .8rem; +$small-font-size: .7rem; +$input-font-size: 1.0rem; +$amazon-btn-line-height:160%; +$submit-button-width:9rem; +$checkbox-label-width:14rem; +$create-account-width:10rem; + +html, +body { + min-height: 100%; + overflow:auto; +} + +body { + min-height: 100%; + margin: 0; + padding: 0; + + font-size: 16px; + line-height: 1.2; +} + + +#basic-container { + width: 100%; + min-height: 100%; +} + +.wrapper { + width: 100%; + min-height: 100%; +} + +html { + font-size: 100%; +} + +@media (min-width:1px) and (max-width: 1199px) { + html { + font-size: 100%; + } + .code-input { + max-width:$submit-button-width; + } + .code-input input { + font-size: $standard-font-size; + } + .code-instructions { + width:$submit-button-width; + } + + .text-input input { + width:$create-account-width; + } + + .instructions.create-account { + margin-top:1rem; + } + .success-msg { + margin-top: 1rem; + } + .logo-holder.create-account { + margin-top:2rem; + } + .code-form.create-account { + margin-top:1rem; + } + .powered-by.create-account { + margin-top:0.5rem; + } +} + +@media (min-width: 1200px) { + html { + font-size: 100%; + } + .code-input { + max-width:$submit-button-width; + } + .code-input input { + font-size: $standard-font-size; + } + .code-instructions { + width: 35%; + } + + .text-input input { + width:$create-account-width; + } + .success-msg { + margin-top: 2rem; + } +} + +body { + font-family: $base-font-family; +} + +p { + margin:.5rem 0; +} +p:first-child { + margin-top:0; +} +p.last-child { + margin-bottom:0; +} +#root { + min-height: 100%; + + align-items: center; + //justify-content: center; + min-width: 50%; + display: flex; + flex-direction: column; +} + +div.root { + flex-grow: 1; + overflow: auto; +} + +.logo-holder { + margin-top:3rem; + display: flex; + align-items: center; + flex-direction: column; + width: 50%; + max-width: 300px; + min-width:0; + min-height:0; + img { + width: 100%; + } + +} + +.steps { + margin-top: 1rem; + display: flex; + align-items: center; + flex-direction: column; + width: 35%; + max-width: 200px; + img { + width: 100%; + } +} + +.instructions { + font-size: $standard-font-size; + margin-top: 2rem; + display: flex; + align-items: center; + flex-direction: column; + width: 90%; + max-width: 400px; + text-align: center; +} + +.code-form { + font-size: $standard-font-size; + margin-top: 2rem; + display: flex; + align-items: center; + flex-direction: column; + width: 100%; + max-width: 1200px; + text-align: center; +} + +.code-prompt { + position: absolute; + text-align: right; + font-size: $smaller-font-size; + height:$standard-font-size * 2; + line-height:$standard-font-size * 2; +} + +label.promo-code { + width: 6rem; + margin-left:-6.5rem; +} + +.code-input { + + width: 100%; + position:relative; + + input { + font-size: $input-font-size; + text-transform: uppercase; + padding: 6px 3px; + box-sizing: border-box; + text-align: center; + border-radius:3px; + border-width:2px; + min-width:$submit-button-width; + color:#555; + font-weight:bold; + width:100%; + } +} + +.code-hint-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; +} + +.code-instructions { + font-size: $small-font-size; +} + +.submit-row { + font-size: $standard-font-size; + + margin-top: 2rem; + display: flex; + align-items: center; + flex-direction: column; + + width: 100%; + max-width: 1200px; + text-align: center; + + &.create-account { + margin-top:1rem; + } +} + +.submit { + color: #111; + text-decoration: none; + background-color: transparent; + border: 0; + display: block; + font-size: $standard-font-size; + line-height: $amazon-btn-line-height; + outline: 0; + text-align: center; + white-space: nowrap; + + &.submit-code { + width:$submit-button-width; + } + &.create-account { + width: $create-account-width; + } +} + +.amazon-a-button-text { + width: 100%; + height: 100%; + background-color: transparent; + border: 0; + display: block; + font-size: $standard-font-size; + line-height: $amazon-btn-line-height; + margin: 0; + outline: 0; + padding: 0 10px 0 11px; + text-align: center; + white-space: nowrap; + box-sizing: border-box; +} + +.amazon-button-stack { + +} + +.amazon-button { + width: 100%; + background: #f0c14b; + border-color: #a88734 #9c7e31 #846a29; + color: #111; + border-radius: 3px; + border-style: solid; + border-width: 1px; + cursor: pointer; + display: inline-block; + padding: 0; + text-align: center; + text-decoration: none !important; + vertical-align: middle; + box-sizing: border-box;; + &:hover { + border-color: darken(#a88734, 10%) darken(#9c7e31, 10%) darken(#846a29, 10%) ; + } + &:active { + border-color: #e77600; + box-shadow: 0 0 3px 2px rgba(2281, 121, 17, .5); + } +} + +.amazon-button-inner { + display: block; + position: relative; + overflow: hidden; + height: $amazon-btn-line-height; + box-shadow: 0 1px 0 rgba(255, 255, 255, .4) inset; + border-radius: 2px; + background: linear-gradient(to bottom, #f7dfa5, #f0c14b); + + &:hover { + background: linear-gradient(to bottom, darken(#f7dfa5, 7%), #f0c14b); + } + + &:active { + background: #f0c14b; + } +} + +.powered-by { + font-size: $smaller-font-size; + margin-top: 1.5rem; + display: flex; + align-items: center; + flex-direction: column; + width: 100%; + max-width: 1200px; + text-align: center; + + .code-prompt { + width:24%; + } + p { + width: 55%; + max-width: 600px; + } + + img { + width: 6rem; + margin-left: 1px; + vertical-align: middle; + + } +} + + +/** step 2 */ + +.success-msg { + display: flex; + align-items: center; + flex-direction: column; + width: 85%; + font-weight:bold; + white-space: nowrap; + text-align:center; +} + +.password-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; + + margin-top: 1rem; + display: flex; + align-items: center; + flex-direction: column; + + width: 100%; + max-width: 1200px; + text-align: center; +} + +.under13-row { + margin-top:.5rem; +} + +.text-input { + width:$create-account-width; + max-width: 400px; + position:relative; + + + input { + + font-size: $input-font-size; + padding: 6px 3px; + box-sizing: border-box; + text-align: left; + border-radius:3px; + border-width:2px; + } +} + +input[type=submit] { + display:none; +} + +.checkbox-input { + font-size:$small-font-size; + width:$create-account-width; + /**display:flex; + align-items: flex-start; + flex-direction: row; + */ + input { + float:left; + margin-bottom:1rem; + } + label { + min-width:$checkbox-label-width; + display:block; + text-align:left; + a{ + white-space: nowrap; + } + } +} + + +label.email { + width:6rem; + margin-left:-6.5rem; +} + +label.password { + width:8rem; + margin-left:-8.5rem; +} + +.error { + color:red; + //text-transform: uppercase; + width:100%; + position:absolute; + margin-top:-$standard-font-size * 1.2; + white-space: nowrap; +} \ No newline at end of file diff --git a/web/app/controllers/landings_controller.rb b/web/app/controllers/landings_controller.rb index 94e64728b..0b0f89f51 100644 --- a/web/app/controllers/landings_controller.rb +++ b/web/app/controllers/landings_controller.rb @@ -89,7 +89,7 @@ class LandingsController < ApplicationController teachers = [] package.test_drive_package_teachers.each do |package_teacher| teacher = package_teacher.user - teachers.push({id: teacher.id, name: teacher.name, first_name: teacher.first_name,last_name: teacher.last_name, biography: teacher.teacher.short_bio, photo_url: teacher.photo_url}) + teachers.push({id: teacher.id, name: teacher.name, first_name: teacher.first_name, last_name: teacher.last_name, biography: teacher.teacher.short_bio, photo_url: teacher.photo_url}) end package_data[:teachers] = teachers @@ -168,7 +168,7 @@ class LandingsController < ApplicationController instrument = params[:instrument].downcase.sub('-', ' ') instrument = Instrument.find_by_id(instrument) instrument_id = instrument.id if instrument - instrument_name = instrument .description + instrument_name = instrument.description query, next_ptr, instrument_count = JamTrack.index({instrument: instrument_id}, current_user) end @jam_track = JamTrack.find_by_slug(params[:plan_code]) @@ -192,7 +192,6 @@ class LandingsController < ApplicationController end - def individual_jamtrack_band enable_olark @no_landing_tag = true @@ -387,7 +386,7 @@ class LandingsController < ApplicationController end - @page_data = {school: @school, invitation_code: params[:invitation_code], defaultEmail: defaultEmail, preview: @preview} + @page_data = {school: @school, invitation_code: params[:invitation_code], defaultEmail: defaultEmail, preview: @preview} render 'school_teacher_register', layout: 'web' end @@ -438,7 +437,7 @@ class LandingsController < ApplicationController end - @page_data = {retailer: @retailer, invitation_code: params[:invitation_code], defaultEmail: defaultEmail, preview: @preview} + @page_data = {retailer: @retailer, invitation_code: params[:invitation_code], defaultEmail: defaultEmail, preview: @preview} render 'retailer_teacher_register', layout: 'web' end @@ -453,7 +452,6 @@ class LandingsController < ApplicationController end - @page_data = {retailer: @retailer, has_teachers: @retailer.teachers.count > 0} render 'posa_activation', layout: 'web' end @@ -475,5 +473,150 @@ class LandingsController < ApplicationController render 'simple_jamclass', layout: 'web' end + + + def amazon_lessons_promo_1 + @error = params[:error] + @code = params[:code] + @description = 'Redeem Your Lessons Code From Amazon' + @responsive = true + + render 'amazon_lessons_promo_1', layout: 'basic' + end + + def amazon_lessons_promo_1_post + + code = params[:code] + @code = code + + card = PosaCard.find_by_amazon_code(code) + + if card + if card.claimed_at + @error = 'Code already claimed' + render 'amazon_lessons_promo_1', layout: 'basic' + return + else + redirect_to '/account/activate/signup?code=' + code + return + end + + else + @error = 'Code not valid' + render 'amazon_lessons_promo_1', layout: 'basic' + end + end + + def amazon_lessons_promo_2 + @description = 'Redeem Your Lessons Code From Amazon' + @responsive = true + @code = params[:code] + + if @code.nil? || @code == '' + redirect_to action: :amazon_lessons_promo_1 + return + end + + + card = PosaCard.find_by_amazon_code(@code) + + if card + if card.claimed_at + @error = 'Code already claimed' + redirect_to action: :amazon_lessons_promo_1, error: @error + return + else + + end + else + @error = 'Code not valid' + redirect_to action: :amazon_lessons_promo_1, error: @error + return + end + + + render 'amazon_lessons_promo_2', layout: 'basic' + end + + def amazon_lessons_promo_2_post + + code = params[:code] + + @code = code + card = PosaCard.find_by_amazon_code(code) + + if card.nil? + @error = 'Code not valid' + redirect_to action: :amazon_lessons_promo_1, error: @error + return + end + + if card.claimed_at + @error = 'Code already claimed' + redirect_to action: :amazon_lessons_promo_1, error: @error + return + end + + if @current_user + + card.claim(current_user) + + if card.errors.any? + first = card.errors.first + @error = "#{first[0].to_s.humanize} #{first[1]}" + render 'amazon_lessons_promo_2', layout: 'basic' + else + + body = "Name: #{@current_user.name}\n" + body << "Email: #{@current_user.email}\n" + body << "Admin: #{@current_user.admin_student_url}\n" + body << "Package Details: \n" + body << " Package: #{card.lesson_package_type.id}\n" + body << " Credits: #{card.credits}\n" + body << " Code: #{card.code}\n" + + AdminMailer.jamclass_alerts({subject: "#{@current_user.email} just applied lesson credits to their account", body: body}).deliver_now + redirect_to '/account/activate/done' + end + + else + @email = params[:email] + @password = params[:password] + terms_of_service = params[:terms].nil? || params[:terms] == "0" ? false : true + under_13 = params[:under_13].nil? || params[:under_13] == "0" ? false : true + + @terms = terms_of_service ? "checked" : nil + @under13 = under_13 ? "checked" : nil + + + # try to signup now + @user = UserManager.new.signup(remote_ip: request.remote_ip, + email: params[:email], + password: params[:password], + password_confirmation: params[:password], + gift_card: @code, + terms_of_service: terms_of_service, + under_13: under_13) + if @user.errors.any? + first = @user.errors.first + @error = "#{first[0].to_s.humanize} #{first[1]}" + render 'amazon_lessons_promo_2', layout: 'basic' + return + else + sign_in @user + + new_user(@user, nil) # sets a cookie used for GA analytics (one-time new user stuff in JavaScript) + redirect_to '/account/activate/done' + return + end + end + end + + def amazon_lessons_promo_3 + @description = 'Redeem Your Lessons Code From Amazon - Done!' + @responsive = true + + render 'amazon_lessons_promo_3', layout: 'basic' + end end diff --git a/web/app/helpers/sessions_helper.rb b/web/app/helpers/sessions_helper.rb index 6301e08a0..eef5af241 100644 --- a/web/app/helpers/sessions_helper.rb +++ b/web/app/helpers/sessions_helper.rb @@ -99,7 +99,6 @@ module SessionsHelper redirect_location = signup_hint.redirect_location end - cookies[:new_user] = { musician: user.musician, registrationType: user.user_authorization('facebook') ? 'Facebook' : 'Native', want_jamblaster: want_jamblaster, redirect_location: redirect_location }.to_json end diff --git a/web/app/views/landings/amazon_lessons_promo_1.slim b/web/app/views/landings/amazon_lessons_promo_1.slim new file mode 100644 index 000000000..665b2bbf3 --- /dev/null +++ b/web/app/views/landings/amazon_lessons_promo_1.slim @@ -0,0 +1,43 @@ +- provide(:page_name, 'amazon_lessons_promo_1') +- provide(:description, @description) +- provide(:title, @title) + +#root + .logo-holder + = image_tag("content/amazon_logo.jpg") + + .steps + = image_tag("content/1-2-with-1-Bold.png") + + .instructions + = '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 + .submit.submit-code + .amazon-button-stack + span.amazon-button + span.amazon-button-inner + a.amazon-a-button-text + = 'Submit Code' + .powered-by + p + = 'powered by ' + = image_tag("web/logo_inverted.png") + + +javascript: + $('a.amazon-a-button-text').on('click', function(e) { + $('form.code-form').submit() + + }) + diff --git a/web/app/views/landings/amazon_lessons_promo_2.slim b/web/app/views/landings/amazon_lessons_promo_2.slim new file mode 100644 index 000000000..c250d316f --- /dev/null +++ b/web/app/views/landings/amazon_lessons_promo_2.slim @@ -0,0 +1,87 @@ +- provide(:page_name, 'amazon_lessons_promo_2') +- provide(:description, @description) +- provide(:title, @title) + +form#root method='POST' action='/account/activate/signup' + .logo-holder.create-account + = image_tag("content/amazon_logo.jpg") + + .steps + = image_tag("content/1-2-with-2-Bold.png") + + .success-msg + | Success! + wbr + | Your code has been validated! + + -if @current_user + .instructions.create-account + input type='hidden' name='code' value=@code + - if @error + .error = @error + = 'Click the button below to credit your account with your 2 free lessons.' + .submit-row.create-account + .submit.create-account + .amazon-button-stack + span.amazon-button + span.amazon-button-inner + a.amazon-a-button-text + = '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.' + + .code-form.create-account + .text-input + label.code-prompt.email + = 'Email:' + - if @error + .error = @error + + input type='hidden' name='code' value=@code + input autofocus='autofocus' type='text' name='email' value=@email + .password-row + .text-input + label.code-prompt.password + = 'Password:' + input type='password' name='password' value=@password + .terms-row + label.code-prompt + .checkbox-input + input type='checkbox' name='terms' checked=@terms + label + | I have read and agree to the JamKazam + = link_to 'terms of service', '/corp/terms', target: '_blank' + .under13-row + .checkbox-input + input type='checkbox' name='under_13' checked=@under13 + label + | I am creating this account for a child under 13 years old ( + = link_to 'why do we ask?', 'https://jamkazam.desk.com/customer/portal/articles/2887343-coppa-explanation', target: '_blank' + | ) + .submit-row.create-account + .submit.create-account + .amazon-button-stack + span.amazon-button + span.amazon-button-inner + a.amazon-a-button-text + = 'Create Account' + .powered-by.create-account + .code-prompt + p + = 'powered by ' + = image_tag("web/logo_inverted.png") + + +javascript: + var submitted = false + $('a.amazon-a-button-text').on('click', function(e) { + + if(!submitted) { + submitted = true + console.log("submit button clicked") + $('form#root').submit() + } + + }) + diff --git a/web/app/views/landings/amazon_lessons_promo_3.slim b/web/app/views/landings/amazon_lessons_promo_3.slim new file mode 100644 index 000000000..7ca3b7eb6 --- /dev/null +++ b/web/app/views/landings/amazon_lessons_promo_3.slim @@ -0,0 +1,22 @@ +- provide(:page_name, 'amazon_lessons_promo_3') +- provide(:description, @description) +- provide(:title, @title) + +#root + .logo-holder + = image_tag("content/amazon_logo.jpg") + + .success-msg + = "You're all set!" + + .instructions + p Within the next day or two, someone from JamKazam will reach out to you via email to help guide you through getting ready for your first lesson and picking a great teacher for you. + p + | If you have any questions at any time, feel free to contact us at + a href="mailto:support@jamkazam.com" support@jamkazam + | . + + .powered-by + p + = 'powered by ' + = image_tag("web/logo_inverted.png") \ No newline at end of file diff --git a/web/app/views/layouts/basic.html.erb b/web/app/views/layouts/basic.html.erb new file mode 100644 index 000000000..02307d3b7 --- /dev/null +++ b/web/app/views/layouts/basic.html.erb @@ -0,0 +1,76 @@ + + +
+