Permalink
Browse files

Updated signup and login pages

  • Loading branch information...
1 parent 2dd5718 commit 9c5a930fdb6c00506dc704c068729927c3b48439 @ariejan ariejan committed Oct 23, 2008
Showing with 52 additions and 23 deletions.
  1. +1 −0 app/controllers/users_controller.rb
  2. +9 −13 app/views/sessions/new.rhtml
  3. +29 −10 app/views/users/new.rhtml
  4. +13 −0 public/stylesheets/dialog.css
@@ -222,6 +222,7 @@ def successful_creation(user)
def failed_creation(message = 'Sorry, there was an error creating your account')
flash[:error] = message
+ @user = User.new
render :action => :new
end
end
@@ -2,15 +2,17 @@
<%= configatron.site_name %> Login
<% end -%>
-<% content_for :sidebar do -%>
-<ul>
- <li><%= link_to("Sign up for a new account", signup_url)%></li>
-</ul>
-<% end -%>
-
<% form_tag session_path do -%>
+ &nbsp;
<fieldset>
- <legend>Your Details</legend>
+ <legend>Login with OpenID</legend>
+
+ <p><label for="openid_url">OpenID URL</label><br/>
+ <%= text_field_tag 'openid_url' %></p>
+ </fieldset>
+
+ <fieldset>
+ <legend>Or Your <%= configatron.site_name %> Account</legend>
<p><label for="login">Login</label><br/>
<%= text_field_tag 'login' %></p>
@@ -21,12 +23,6 @@
<p><label for="remember_me">Remember me:</label>
<%= check_box_tag 'remember_me' %></p>
</fieldset>
- <fieldset>
- <legend>Login with OpenID</legend>
-
- <p><label for="openid_url">OpenID URL</label><br/>
- <%= text_field_tag 'openid_url' %></p>
- </fieldset>
<ul>
<li><%= link_to "Sign up for an account now", signup_url %></li>
View
@@ -5,16 +5,28 @@ Create a new <%= configatron.site_name %> account
<% end -%>
<p>
- You are about to register a new, free <%= configatron.site_name %> account. Please fill out this simple form.
+ To access <%= configatron.site_name %> you may sign up with your OpenID. If you don't have an OpenID yet, we recommend <a href="http://www.myopenid.com">MyOpenID</a>.
</p>
-<p>
- Already have an account? <%= link_to("Login here", login_url)%>
-</p>
<% form_for :user, :url => users_path do |f| -%>
<%= error_messages_for :user %>
- <fieldset>
+ <fieldset id="openid_form">
+ <legend>Signup with OpenID</legend>
+ <p><label for="openid_url">OpenID URL</label><br/>
+ <%= text_field_tag :openid_url, params[:openid_url] || params['openid.identity'] %></p>
+
+ <div class="js_option">
+ <%= link_to_function "... or signup the old-fashioned way.",
+ "Element.hide('openid_form');
+ Element.show('oldfashioned_form');"
+ %>
+ </div>
+ </fieldset>
+
+
+
+ <fieldset id="oldfashioned_form" style="display: none">
<legend>Your Details</legend>
<p><label for="login">Login</label><br/>
<%= f.text_field :login %></p>
@@ -27,12 +39,19 @@ Create a new <%= configatron.site_name %> account
<p><label for="password_confirmation">Confirm Password</label><br/>
<%= f.password_field :password_confirmation %></p>
+
+ <div class="js_option">
+ <%= link_to_function "... or signup with OpenID.",
+ "Element.hide('oldfashioned_form');
+ Element.show('openid_form');"
+ %>
+ </div>
+
</fieldset>
- <fieldset>
- <legend>Signup with OpenID</legend>
- <p><label for="openid_url">OpenID URL</label><br/>
- <%= text_field_tag :openid_url, params[:openid_url] || params['openid.identity'] %></p>
- </fieldset>
+
+ <ul>
+ <li><%= link_to "Already signed up? Login now!", login_url %></li>
+ </ul>
<div id="submitbutton">
<p><%= submit_tag 'Sign up' %></p>
@@ -14,6 +14,19 @@ a:hover {
background-color: #0054ff;
color: #fff;
}
+fieldset {
+ border: none;
+ border-top: 1px solid #999;
+}
+fieldset legend {
+ font-size: 140%;
+ margin: 0 10px 0 15px;
+ padding: 0 5px;
+}
+fieldset div.js_option {
+ text-align: right;
+ font-size: 87%;
+}
input[type="text"], input[type="password"] {
font-size: 1.4em;
width: 92%;

0 comments on commit 9c5a930

Please sign in to comment.