Add first name

This commit is contained in:
Seth Call 2018-06-14 21:39:52 -05:00
parent cf652ba63a
commit cb0375bc32
4 changed files with 42 additions and 5 deletions

View File

@ -559,9 +559,15 @@ module JamRuby
first_name == 'Anonymous' && last_name == 'Anonymous'
end
def is_last_anonymous?
first_name != 'Anonymous' && last_name == 'Anonymous'
end
def name
if anonymous?
'Anonymous'
elsif is_last_anonymous?
"#{first_name}"
else
"#{first_name} #{last_name}"
end

View File

@ -470,6 +470,19 @@ h2.second-ready {
text-align:center;
}
.email-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;
}
.password-row {
font-size: $standard-font-size;
@ -576,6 +589,12 @@ input[type=submit] {
}
label.first {
width:6rem;
margin-left:-6.5rem;
}
label.email {
width:6rem;
margin-left:-6.5rem;

View File

@ -581,6 +581,14 @@ class LandingsController < ApplicationController
else
@first = params[:first]
if !@first || @first == ''
@error = 'Please specify first name'
render 'amazon_lessons_promo_2', layout: 'basic'
return
end
@instrument = params[:instrument]
if @instrument.nil? || @instrument == ''
@error = 'Please select an instrument'
@ -588,7 +596,6 @@ class LandingsController < ApplicationController
return
end
@email = params[:email]
@password = params[:password]
terms_of_service = params[:terms].nil? || params[:terms] == "0" ? false : true
@ -608,6 +615,7 @@ class LandingsController < ApplicationController
skip_recaptcha: true,
musician: true,
timezone: current_timezone,
first_name: @first,
instruments: [{:instrument_id => @instrument, :proficiency_level => 1, :priority => 1}])
if @user.errors.any?
first = @user.errors.first

View File

@ -33,13 +33,17 @@ form#root method='POST' action='/account/activate/signup'
.code-form.create-account
.text-input
label.code-prompt.email
= 'Email:'
label.code-prompt.first
= 'First Name:'
- if @error
.error = @error
input autofocus='autofocus' type='text' name='first' value=@first
.email-row
.text-input
label.code-prompt.email
= 'Email:'
input type='hidden' name='code' value=@code
input autofocus='autofocus' type='text' name='email' value=@email
input type='text' name='email' value=@email
.password-row
.text-input
label.code-prompt.password