VRFS-2540 : Recaptcha UI components

This commit is contained in:
Steven Miers 2015-01-05 16:57:49 -06:00
parent d901c3a498
commit 13e6f226ea
4 changed files with 17 additions and 7 deletions

View File

@ -67,7 +67,7 @@ body.web {
.landing-content {
background-color:black;
width:100%;
min-height: 366px;
min-height: 460px;
position:relative;
padding-bottom:30px;

View File

@ -132,6 +132,7 @@
<%= render "shared/ga" %>
<%= render "shared/twttr" %>
<%= render "shared/facebook_sdk" %>
<%= render "shared/google_nocaptcha" %>
<!-- version: <%= version %> -->
</body>
</html>

View File

@ -0,0 +1 @@
script src="https://www.google.com/recaptcha/api.js" async defer

View File

@ -6,7 +6,6 @@
<%= form_for(@user, :url => @signup_postback, :method => :post) do |f| %>
<!-- register left column -->
<div class="register-left left w45">
<div class="register-container">
<div class="register-as">
@ -38,7 +37,7 @@
<div class="field country right-side">
<%= f.label :country, "Country:" %>
<select id="country_select" name="jam_ruby_user[country]" autocomplete="off" class="easydropdown">
<option class="label" value="" <%= @location[:country].blank? ? "selected" : "" %>>Select Country</option>
<option class="label" value="" <%= (@location.nil? || @location[:country].nil? || @location[:country].blank?) ? "selected" : "" %>>Select Country</option>
<% @countriesx.each do |country| %>
<% unless country[:countrycode].blank? %>
<option value="<%= country[:countrycode] %>" <%= @location[:country] == country[:countrycode] ? "selected" : "" %>><%= country[:countryname] %></option>
@ -125,9 +124,12 @@
</small>
</div>
<% if Rails.application.config.recaptcha_enable %>
<%= recaptcha_tags %>
<% end %>
<div class="field recaptcha">
<% if Rails.application.config.recaptcha_enable %>
<div id="recaptcha_select" name="recaptcha_response_field" class="g-recaptcha" data-sitekey="<%=Rails.application.config.recaptcha_public_key%>">
</div>
<% end %>
</div>
<!--
<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 />
@ -192,6 +194,7 @@
var country = get_first_error("country")
var state = get_first_error("state")
var city = get_first_error("city")
var recaptcha = get_first_error("recaptcha")
if (email) {
@ -230,7 +233,12 @@
cityInput.after("<div class='error-text'>" + city + "</div>")
}
if (recaptcha) {
var recaptchaInput = $('#recaptcha_select');
recaptchaInput.closest('div.field').addClass('error')
recaptchaInput.after("<div class='error-text'>" + recaptcha + "</div>")
}
if (musician_instruments) {
var musicianInstrumentsInput = $('#instrument_selector');
musicianInstrumentsInput.closest('div.ftue-instrumentlist-wrapper').addClass('error')