242 lines
9.1 KiB
Plaintext
242 lines
9.1 KiB
Plaintext
<% provide(:title, 'Sign up') %>
|
|
<%= javascript_include_tag "jquery" %>
|
|
<%= javascript_include_tag "signup" %>
|
|
|
|
<div class="signin-overlay">
|
|
<!-- ftue header -->
|
|
<% unless @invited_user.nil? %>
|
|
<% if @invited_user.sender.nil? %>
|
|
<div class="content-head">
|
|
<h1>you've been invited to join jamkazam</h1>
|
|
</div>
|
|
|
|
<div class="ftue-invited">
|
|
Signup and you can starting jamming, too.
|
|
</div>
|
|
|
|
<% else %>
|
|
<div class="content-head">
|
|
<h1>you've been invited by <%= @invited_user.sender_display_name %> to join jamkazam</h1>
|
|
</div>
|
|
|
|
<div class="ftue-invited">
|
|
Signup and you can starting jamming, too.
|
|
</div>
|
|
<% end %>
|
|
<% end %>
|
|
|
|
<div class="content-head">
|
|
<h1>create a jamkazam account</h1>
|
|
</div>
|
|
|
|
<!-- inner wrapper -->
|
|
<div class="ftue-inner">
|
|
<%= form_for(@user, :url => @signup_postback) do |f| %>
|
|
|
|
<!-- register left column -->
|
|
<div class="ftue-left">
|
|
<table height="330" cellpadding="0" cellspacing="10">
|
|
<tr>
|
|
<td><%= f.label :first_name, "First Name" %>
|
|
<br/>
|
|
<%= f.text_field :first_name %></td>
|
|
<td><%= f.label :last_name, "Last Name" %>
|
|
<br/>
|
|
<%= f.text_field :last_name %></td>
|
|
</tr>
|
|
<tr>
|
|
<td><%= f.label :email %>
|
|
<br/>
|
|
<%= f.text_field :email %></td>
|
|
<td>Country:<br/>
|
|
<select id="country_select" name="jam_ruby_user[country]" autocomplete="off">
|
|
<option value="">Select Country</option>
|
|
<% @countries.each do |country| %>
|
|
<option value="<%= country %>" <%= @location[:country] == "US" ? "selected" : "" %>><%= country %></option>
|
|
<% end %>
|
|
|
|
</select>
|
|
</td>
|
|
|
|
</tr>
|
|
<tr>
|
|
<td>State/Province:<br/>
|
|
<select id="region_select" name="jam_ruby_user[state]" autocomplete="off">
|
|
<option value="">Select State/Province</option>
|
|
<% @regions.each do |region| %>
|
|
<option value="<%= region %>" <%= @location[:state] == region ? "selected" : "" %>><%= region %></option>
|
|
<% end %>
|
|
|
|
</select></td>
|
|
<td>City:<br/>
|
|
<select id="city_select" name="jam_ruby_user[city]" autocomplete="off">
|
|
<option value="">Select City</option>
|
|
<% @cities.each do |city| %>
|
|
<option value="<%= city %>" <%= @location[:city] == city ? "selected" : "" %>><%= city %></option>
|
|
<% end %>
|
|
|
|
</select></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td><%= f.label :password %>
|
|
<br/>
|
|
<%= f.password_field :password %></td>
|
|
<td><%= f.label :password_confirmation, "Verify Password" %>
|
|
<br/>
|
|
<%= f.password_field :password_confirmation %></td>
|
|
</tr>
|
|
|
|
<!--
|
|
<tr>
|
|
<td colspan="2">
|
|
<%= f.label :birth_date %>
|
|
<%= f.date_select :birth_date,
|
|
:start_year => 1900,
|
|
:prompt => {:day => 'Select day', :month => 'Select month', :year => 'Select year'},
|
|
:order => [:month, :day, :year] %></td>
|
|
</tr>
|
|
-->
|
|
|
|
<tr>
|
|
<td colspan=2>
|
|
<small><input id="jam_ruby_user_subscribe_email" name="jam_ruby_user[subscribe_email]" type="checkbox"/>
|
|
<span>I will accept email from JamKazam about this service.</span><br/>
|
|
</small>
|
|
<br/>
|
|
<small>
|
|
<input id="jam_ruby_user_terms_of_service" name="jam_ruby_user[terms_of_service]" type="checkbox"/>
|
|
<span>I have read and agree to the JamKazam <a href="#">terms of service</a>.</span>
|
|
</small>
|
|
|
|
</table>
|
|
|
|
|
|
</div>
|
|
<!-- end left column -->
|
|
|
|
<!-- sign in right column -->
|
|
<div class="ftue-right"><br/>
|
|
|
|
<div class="ftue-instrumentlist-wrapper">
|
|
What instruments can you play?
|
|
|
|
<div class="ftue-instrumentlist">
|
|
<table id="instrument_selector" class="instrument_selector" width="100%" cellpadding="0" cellspacing="6">
|
|
<% Instrument.standard_list.each do |instrument| %>
|
|
<tr>
|
|
<td><input id="<%= instrument.id.gsub(" ", "") %>_checkbox" name="jam_ruby_user[instruments][<%= instrument.id %>][selected]" type="checkbox" /><%= instrument.description %></td>
|
|
<td align="right" width="50%"><select id="<%= instrument.id.gsub(" ", "") %>_proficiency" name="jam_ruby_user[instruments][<%= instrument.id %>][proficiency]" class='proficiency_selector'><option value="1">Beginner</option><option value="2">Intermediate</option><option value="3">Expert</option></select></td>
|
|
</tr>
|
|
<% end %>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<br/>
|
|
<% if Rails.application.config.recaptcha_enable %>
|
|
<%= recaptcha_tags %>
|
|
<% end %>
|
|
|
|
<!--
|
|
<img src="images/content/captcha.png" width="152" height="50" align="left" class="mr10" /><small>Enter the characters from the box to the left:<br />
|
|
<input type="text" /> <br clear="all" /><br />
|
|
-->
|
|
|
|
<%= f.submit "CREATE ACCOUNT", class: "right button-orange" %>
|
|
<br/ style="clear:both;"><br/>
|
|
<a href="/auth/facebook" class="right"><img src="/fb-signup-button.png"></a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
<!-- end right column -->
|
|
|
|
<% end %>
|
|
</div>
|
|
<!-- end inner -->
|
|
|
|
</div>
|
|
<!-- end overlay content -->
|
|
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
window.signup.handle_location_changes()
|
|
|
|
function get_first_error(field) {
|
|
if(errors[field] && errors[field].length > 0) {
|
|
return errors[field][0]
|
|
}
|
|
else {
|
|
return null;
|
|
}
|
|
}
|
|
|
|
// populate musician instruments from previous submit, if applicable
|
|
if(window.gon && gon.musician_instruments) {
|
|
$(gon.musician_instruments).each(function(index, value) {
|
|
$('#' + value.instrument_id.replace(" ", "") + "_checkbox").attr("checked", true);
|
|
$('#' + value.instrument_id.replace(" ", "") + "_proficiency").val(value.proficiency_level.toString())
|
|
})
|
|
}
|
|
|
|
// show signup errors, if any
|
|
if(window.gon && gon.signup_errors) {
|
|
var errors = <%= @user.errors.to_json.html_safe %>
|
|
|
|
var email = get_first_error("email")
|
|
var first_name = get_first_error("first_name")
|
|
var last_name = get_first_error("last_name")
|
|
var musician_instruments = get_first_error("musician_instruments")
|
|
var password = get_first_error("password")
|
|
var password_confirmation = get_first_error("password_confirmation")
|
|
var terms_of_service = get_first_error("terms_of_service")
|
|
|
|
|
|
if(email) {
|
|
var emailInput = $('#jam_ruby_user_email');
|
|
emailInput.closest('td').addClass('error')
|
|
emailInput.after("<div class='error-text'>" + email + "</div>")
|
|
}
|
|
|
|
if(first_name) {
|
|
var firstNameInput = $('#jam_ruby_user_first_name');
|
|
firstNameInput.closest('td').addClass('error')
|
|
firstNameInput.after("<div class='error-text'>" + first_name + "</div>")
|
|
}
|
|
|
|
if(last_name) {
|
|
var lastNameInput = $('#jam_ruby_user_last_name');
|
|
lastNameInput.closest('td').addClass('error')
|
|
lastNameInput.after("<div class='error-text'>" + last_name + "</div>")
|
|
}
|
|
|
|
if(musician_instruments) {
|
|
var musicianInstrumentsInput = $('#instrument_selector');
|
|
musicianInstrumentsInput.closest('div.ftue-instrumentlist-wrapper').addClass('error')
|
|
musicianInstrumentsInput.closest('div.ftue-instrumentlist').after("<div class='error-text'>" + musician_instruments + "</div>")
|
|
}
|
|
|
|
if(password) {
|
|
var passwordInput = $('#jam_ruby_user_password');
|
|
passwordInput.closest('td').addClass('error')
|
|
passwordInput.after("<div class='error-text'>" + password+ "</div>")
|
|
}
|
|
|
|
if(password_confirmation) {
|
|
var passwordConfirmationInput = $('#jam_ruby_user_password_confirmation');
|
|
passwordConfirmationInput.closest('td').addClass('error')
|
|
passwordConfirmationInput.after("<div class='error-text'>" + password_confirmation + "</div>")
|
|
}
|
|
|
|
if(terms_of_service) {
|
|
var termsOfServiceInput = $('#jam_ruby_user_terms_of_service');
|
|
termsOfServiceInput.closest('small').addClass('error')
|
|
// termsOfServiceInput.closest('small').after("<div class='error-text'>" + terms_of_service + "</div>")
|
|
}
|
|
}
|
|
|
|
</script>
|
|
|