new landing pages
This commit is contained in:
parent
297967ebd7
commit
eff69dd44d
|
|
@ -378,3 +378,4 @@ mobile_recording_support.sql
|
|||
youtube_broadcast.sql
|
||||
amazon_v1.sql
|
||||
sms_index_optimize.sql
|
||||
amazon_signup.sql
|
||||
|
|
@ -0,0 +1 @@
|
|||
ALTER TABLE users ADD COLUMN under_13 BOOLEAN;
|
||||
|
|
@ -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);
|
||||
|
|
@ -212,3 +214,26 @@ $$ LANGUAGE plpgsql;
|
|||
|
||||
-- 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)
|
||||
|
||||
|
||||
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;
|
||||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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?
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
@ -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;
|
||||
}
|
||||
|
|
@ -192,7 +192,6 @@ class LandingsController < ApplicationController
|
|||
end
|
||||
|
||||
|
||||
|
||||
def individual_jamtrack_band
|
||||
enable_olark
|
||||
@no_landing_tag = true
|
||||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
||||
})
|
||||
|
||||
|
|
@ -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()
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
|
|
@ -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")
|
||||
|
|
@ -0,0 +1,76 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title><%= full_title(yield(:title)) %></title>
|
||||
|
||||
<!--[if IE]>
|
||||
<link rel="stylesheet" type="text/css" href="css/ie.css" media="screen, projection"/>
|
||||
<![endif]-->
|
||||
<!--<link href='http://fonts.googleapis.com/css?family=Raleway:100,200,300,400,500,600,700' rel='stylesheet' type='text/css'>-->
|
||||
<%= stylesheet_link_tag "basic/basic", media: "all" %>
|
||||
<%= include_gon(:init => true) %>
|
||||
<%= csrf_meta_tags %>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
||||
<meta name="description" content="<%= meta_description(yield(:description)) %>">
|
||||
<% if content_for?(:social_meta) %>
|
||||
<%= yield(:social_meta) %>
|
||||
<% else %>
|
||||
<%= render "layouts/social_meta" %>
|
||||
<% end %>
|
||||
<%= render "shared/ad_sense" %>
|
||||
</head>
|
||||
<body class="basic <%= yield(:page_name) %>">
|
||||
<div id="basic-container">
|
||||
<%= javascript_include_tag "basic/basic" %>
|
||||
<div class="wrapper">
|
||||
<%= yield %>
|
||||
</div>
|
||||
</div>
|
||||
<%= render "clients/jamServer" %>
|
||||
<%= render "clients/help" %>
|
||||
<%= render 'dialogs/banner' %>
|
||||
<%= render 'dialogs/banners/disconnected' %>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
JK = JK || {};
|
||||
|
||||
JK.root_url = "<%= root_url %>"
|
||||
|
||||
JK.app = JK.JamKazam();
|
||||
|
||||
var jamServer = new JK.JamServer(JK.app, $.noop);
|
||||
jamServer.initialize();
|
||||
|
||||
JK.app.initialize({inClient: false, layoutOpts: {layoutFooter: false, sizeOverlayToContent: true}});
|
||||
|
||||
<% if current_user %>
|
||||
JK.currentUserId = '<%= current_user.id %>';
|
||||
JK.currentUserAvatarUrl = JK.resolveAvatarUrl('<%= current_user.photo_url %>');
|
||||
JK.currentUserName = '<%= current_user.name %>';
|
||||
<% else %>
|
||||
JK.currentUserId = null;
|
||||
JK.currentUserAvatarUrl = null;
|
||||
JK.currentUserName = null;
|
||||
<% end %>
|
||||
|
||||
|
||||
<% if @websocket %>
|
||||
JK.JamServer.connect() // singleton here defined in JamServer.js
|
||||
.done(function() {
|
||||
console.log("websocket connected")
|
||||
})
|
||||
.fail(function() {
|
||||
//console.log("websocket failed to connect")
|
||||
});
|
||||
|
||||
<% end %>
|
||||
})
|
||||
</script>
|
||||
|
||||
<%= render "shared/ga" %>
|
||||
<%= render "shared/olark" %>
|
||||
<!-- version info: <%= version %> -->
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -89,6 +89,7 @@ if defined?(Bundler)
|
|||
config.assets.precompile += %w( web/web.js web/web.css )
|
||||
config.assets.precompile += %w( minimal/minimal.js minimal/minimal.css )
|
||||
config.assets.precompile += %w( modern/modern.js modern/modern.css )
|
||||
config.assets.precompile += %w( basic/basic.js basic/basic.css )
|
||||
|
||||
# where is rabbitmq?
|
||||
config.rabbitmq_host = "127.0.0.1"
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ Resque.redis = Rails.application.config.redis_host
|
|||
|
||||
require 'resque_failed_job_mailer'
|
||||
|
||||
puts "RESQUE INITIALIZER"
|
||||
Resque::Failure::Notifier.configure do |config|
|
||||
config.to = Rails.application.config.email_alerts_alias
|
||||
config.from = Rails.application.config.email_generic_from
|
||||
|
|
|
|||
|
|
@ -1 +0,0 @@
|
|||
puts "DEPRECATED INITILAIZER"
|
||||
|
|
@ -22,7 +22,12 @@ Rails.application.routes.draw do
|
|||
delete '/signout', to: 'sessions#destroy'
|
||||
|
||||
match '/redeem_giftcard', to: 'landings#redeem_giftcard', via: :get
|
||||
match '/account/activate/code', to: 'landings#account_activate', via: :get
|
||||
match '/account/activate/code_old', to: 'landings#account_activate', via: :get
|
||||
match '/account/activate/code', to: 'landings#amazon_lessons_promo_1', via: :get
|
||||
match '/account/activate/code', to: 'landings#amazon_lessons_promo_1_post', via: :post
|
||||
match '/account/activate/signup', to: 'landings#amazon_lessons_promo_2', via: :get
|
||||
match '/account/activate/signup', to: 'landings#amazon_lessons_promo_2_post', via: :post
|
||||
match '/account/activate/done', to: 'landings#amazon_lessons_promo_3', via: :get
|
||||
|
||||
# landing pageslanding
|
||||
get '/jamtracks', to: 'landings#simple_jamtracks', as: 'landing_simple_jamtracks'
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@ class UserManager < BaseManager
|
|||
education_interest = options[:education_interest]
|
||||
origin = options[:origin]
|
||||
test_drive_package = options[:test_drive_package]
|
||||
under_13 = options[:under_13]
|
||||
|
||||
recaptcha_failed = false
|
||||
unless options[:skip_recaptcha] # allow callers to opt-of recaptcha
|
||||
|
|
@ -100,7 +101,8 @@ class UserManager < BaseManager
|
|||
school_interest: school_interest,
|
||||
education_interest: education_interest,
|
||||
origin: origin,
|
||||
test_drive_package: test_drive_package)
|
||||
test_drive_package: test_drive_package,
|
||||
under_13: under_13)
|
||||
user
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue