Skip to content

Commit

Permalink
Corrected the user signup page (publiclab#5704)
Browse files Browse the repository at this point in the history
* Corrected the user signup page

* Corrected the animals in the verification state of the signup

* Update _create_form.html.erb
  • Loading branch information
Souravirus authored and digitaldina committed May 12, 2019
1 parent a1b834b commit 3fd4e8f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 24 deletions.
35 changes: 17 additions & 18 deletions app/views/users/_create_form.html.erb
Original file line number Diff line number Diff line change
@@ -1,27 +1,26 @@
<div style="padding:10px;">
<%= form_for :user, :as => :user, :url => "/register", :html => {:class => "row"} do |f| %>
<%= form_for :user, :as => :user, :url => "/register", :html => {:class => "container"} do |f| %>
<% if f.error_messages != "" %><div class="alert alert-danger"><%= f.error_messages %></div><% end %>

<input type="hidden" name="return_to" class="login-modal-redirect" value="<%= params[:return_to] || request.fullpath %>" />

<div class="container">

<% cache('feature_signup-notice-top', skip_digest: true) do %>
<%= feature('signup-notice-top') %>
<% end %>

<div class='col-md-12' style="display:flex; justify-content: center;">
<div style="display:flex; justify-content: center;" class="col-12">
<h3> Sign up with </h3>
</div>

<div class='col-md-12' style="display:flex; justify-content: center;">
<div style="display:flex; justify-content: center;" class="col-12">
<%= render :partial => "layouts/social_icons" %>
</div>

<br style="clear:both;"/>
<div class="row">
<div class="col-md-6">
<div class="row">
<div class="form-group col-md-12" id="username_div">
<div class="form-group" id="username_div">
<label for="username"><%= t('user_sessions.new.username') %></label>
<%= f.text_field :username, { tabindex: 1, placeholder: "Username", class: 'form-control', id: 'username-signup' } %>
<label class="username-check"></label>
Expand All @@ -31,7 +30,6 @@
<label for="email"><%= t('users._form.email') %></label>
<%= f.text_field :email, { tabindex: 3, placeholder: "you@email.com", class: 'form-control', id: 'email' } %>
</div>
</div>
</div>

<div class="col-md-6" style="display:flex; justify-content: center;">
Expand All @@ -47,7 +45,7 @@
</div>
</div>

<div class="form-group col-md-12 nopadding">
<div class="form-group row">
<div class="form-group col-md-6">
<label for="password"><%= t('users._form.create_password') %></label>
<%= f.password_field :password, { placeholder: 'Enter your new password',
Expand All @@ -69,23 +67,25 @@
</div>
</div>

<div class="form-group col-md-12">
<label for="user_bio"><%= t('users._form.bio') %></label>
<%= f.text_area :bio, { placeholder: I18n.t('users._form.add_bio'),
rows: 8,
class: 'form-control',
tabindex: 6 }
%>
<div class="form-group row">
<div class="col-md-12">
<label for="user_bio"><%= t('users._form.bio') %></label>
<%= f.text_area :bio, { placeholder: I18n.t('users._form.add_bio'),
rows: 8,
class: 'form-control',
tabindex: 6 }
%>
</div>
</div>

<% if Rails.env == "production" && !params[:spamaway] %>
<div class="col-md-12 recaptcha-container">
<div class="recaptcha-container">
<%= recaptcha_tags %>
<p>If you cannot use the ReCaptcha to verify you are not a bot, <a href="/signup?spamaway=true">use this alternative verification</a>.</p>
</div>
<% else %>

<div class="col-md-12">
<div>
<%= render partial: 'users/spamaway', locals: {caller: caller } %>
</div>

Expand Down Expand Up @@ -118,7 +118,6 @@
</script>
</div>

</div>
<% end %>
<% cache('feature_signup-notice', skip_digest: true) do %>
Expand Down
10 changes: 4 additions & 6 deletions app/views/users/_spamaway.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,11 @@
<% turingtest = Spamaway.get_pairs vars.length %>
<% turingtest.each_index do |i| %>

<div class="btn-group btn-group-justified" role="group">
<div class="btn-group d-flex" role="group">
<% [0,1].each_with_index do |s, j| %><% statement = turingtest[i][s] %>
<div class="btn-group" role="group">
<button type="button" class="col-5 btn btn-outline-secondary" style="font-size:3em;text-align:left;<% if i.odd? %> background:#eef;<% end %>" id="spamaway-<%= caller %>-<%= i.to_s + j.to_s %>">
<%= spam.radio_button vars[i], statement, { id: "spamaway_statement_#{caller}_#{i.to_s}#{j.to_s}" } %> <%= statement %>
</button>
</div>
<button type="button" class="col-5 btn btn-outline-secondary" style="font-size:3em;text-align:left;<% if i.odd? %> background:#eef;<% end %>" id="spamaway-<%= caller %>-<%= i.to_s + j.to_s %>">
<%= spam.radio_button vars[i], statement, { id: "spamaway_statement_#{caller}_#{i.to_s}#{j.to_s}" } %> <%= statement %>
</button>
<% end %>
</div>
<br />
Expand Down

0 comments on commit 3fd4e8f

Please sign in to comment.