Signup steps with validation
This commit is contained in:
55
app/views/signup/steps.html.erb
Normal file
55
app/views/signup/steps.html.erb
Normal file
@@ -0,0 +1,55 @@
|
||||
<% case @step %>
|
||||
<% when 1 %>
|
||||
<h2>Choose a username</h2>
|
||||
<%= form_for @user, :url => signup_validate_url do |f| %>
|
||||
<div class="field">
|
||||
<p>
|
||||
<%= f.label :cn, 'Username' %><br />
|
||||
<%= f.text_field :cn, autofocus: true, autocomplete: "username" %>
|
||||
<span class="at-sign">@</span>
|
||||
<span class="domain">kosmos.org</span>
|
||||
</p>
|
||||
<% if @validation_error.present? %>
|
||||
<p class="error-msg">Username <%= @validation_error %></p>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<p><%= f.submit "Continue" %></p>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% when 2 %>
|
||||
<h2>What's your email?</h2>
|
||||
<%= form_for @user, :url => signup_validate_url do |f| %>
|
||||
<div class="field">
|
||||
<p>
|
||||
<%= f.label :email, 'Email address' %><br />
|
||||
<%= f.email_field :email, autofocus: true, autocomplete: "email" %>
|
||||
</p>
|
||||
<% if @validation_error.present? %>
|
||||
<p class="error-msg">Email <%= @validation_error %></p>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<p><%= f.submit "Continue" %></p>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% when 3 %>
|
||||
<h2>Choose a password</h2>
|
||||
|
||||
<%= form_for @user, :url => signup_validate_url do |f| %>
|
||||
<div class="field">
|
||||
<p>
|
||||
<%= f.label :password, 'Password' %><br />
|
||||
<%= f.password_field :password, autofocus: true %>
|
||||
</p>
|
||||
<% if @validation_error.present? %>
|
||||
<p class="error-msg">Password <%= @validation_error %></p>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<p><%= f.submit "Continue" %></p>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
Reference in New Issue
Block a user