Signup steps with validation
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
<%= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' %>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<body class="layout-signup">
|
||||
<div id="wrapper">
|
||||
<header>
|
||||
<h1>
|
||||
|
||||
2
app/views/shared/status_not_found.html.erb
Normal file
2
app/views/shared/status_not_found.html.erb
Normal file
@@ -0,0 +1,2 @@
|
||||
<h2>Not found</h2>
|
||||
<p>Sorry, this page does not exist.</p>
|
||||
@@ -8,5 +8,5 @@
|
||||
by invitation. Seems like you have good friends!
|
||||
</p>
|
||||
<p>
|
||||
<%= link_to "Get started", signup_path, class: "next-step" %>
|
||||
<%= link_to "Get started", signup_steps_path(1), class: "next-step" %>
|
||||
</p>
|
||||
|
||||
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