fixes #48: Adding email via profile

This commit is contained in:
albert
2011-09-15 18:02:00 -04:00
parent 9f45f0863e
commit 4d1d45d70e
3 changed files with 56 additions and 52 deletions

View File

@@ -28,8 +28,9 @@ class UsersController < ApplicationController
def create
@user = User.create(params[:user])
flash[:notice] = "There were errors" if @user.errors.any?
session[:user_id] = @user.id
if @user.errors.empty?
session[:user_id] = @user.id
end
set_current_user
respond_with(@user)
end

View File

@@ -1,7 +1,6 @@
<% content_for(:secondary_links) do %>
<menu>
<li><%= link_to "Listing", users_path %></li>
<li><%= link_to "Signup", new_user_path %></li>
<% if @user && !@user.new_record? %>
<li>|</li>
<li><%= link_to "Edit", edit_user_path(@user) %></li>

View File

@@ -2,64 +2,68 @@
<div id="a-new">
<h1>Signup</h1>
<div id="p1">
<p><%= Danbooru.config.app_name %> is ad-sponsored and does not require an account to view. But in order to start uploading, editing, or creating content on this site, you will need to register. <em>Make sure you read and agree to the <%= link_to "terms of service", terms_of_service_path %> before registering. <strong>This site is open to web crawlers, therefore any name you choose will be public!</strong></em></p>
<% if @user.errors.empty? %>
<div id="p1">
<p><%= Danbooru.config.app_name %> is ad-sponsored and does not require an account to view. But in order to start uploading, editing, or creating content on this site, you will need to register. <em>Make sure you read and agree to the <%= link_to "terms of service", terms_of_service_path %> before registering. <strong>This site is open to web crawlers, therefore any name you choose will be public!</strong></em></p>
<p>Registration for a basic account is free but comes with some limitations.</p>
<p>Registration for a basic account is free but comes with some limitations.</p>
<div id="account-comparison">
<section>
<h1>Basic</h1>
<ul>
<li>Free</li>
<li>Uploads limited</li>
<li>Search up to 2 tags at once</li>
<li>Some hidden posts</li>
<li>Ads visible</li>
<li>Create and edit posts, favorites, forum posts, comments, wiki pages, pools, artists, and dmails</li>
</ul>
</section>
<div id="account-comparison">
<section>
<h1>Basic</h1>
<ul>
<li>Free</li>
<li>Uploads limited</li>
<li>Search up to 2 tags at once</li>
<li>Some hidden posts</li>
<li>Ads visible</li>
<li>Create and edit posts, favorites, forum posts, comments, wiki pages, pools, artists, and dmails</li>
</ul>
</section>
<section>
<h1>Privileged</h1>
<ul>
<li>One time $20 fee</li>
<li>Uploads limited</li>
<li>Search up to 6 tags at once</li>
<li>No hidden posts</li>
<li>No ads</li>
<li>Tag subscriptions</li>
</ul>
</section>
<section>
<h1>Privileged</h1>
<ul>
<li>One time $20 fee</li>
<li>Uploads limited</li>
<li>Search up to 6 tags at once</li>
<li>No hidden posts</li>
<li>No ads</li>
<li>Tag subscriptions</li>
</ul>
</section>
<section>
<h1>Contributor</h1>
<ul>
<li>Invitation only</li>
<li>No upload limits</li>
</ul>
</section>
<section>
<h1>Contributor</h1>
<ul>
<li>Invitation only</li>
<li>No upload limits</li>
</ul>
</section>
<div class="clearfix"></div>
<div class="clearfix"></div>
</div>
</div>
</div>
<div id="p2">
<p>There are some restrictions on names:</p>
<div id="p2">
<p>There are some restrictions on names:</p>
<ul>
<li><strong>Name</strong>: Your name must be at least 2 characters and at most 20 characters long. It cannot contain spaces or colons. All characters must be US-ASCII.</li>
<li><strong>Password</strong>: Your password must be at least 5 characters long.</li>
<li>
<strong>Email</strong>:
<% if Danbooru.config.enable_email_verification? %>
You must enter a valid email address. You will need to verify your email address after registering.
<% else %>
You can optionally enter an email address. Although optional, you will not be able to reset your password without an email address.
<% end %>
</li>
</ul>
<ul>
<li><strong>Name</strong>: Your name must be at least 2 characters and at most 20 characters long. It cannot contain spaces or colons. All characters must be US-ASCII.</li>
<li><strong>Password</strong>: Your password must be at least 5 characters long.</li>
<li>
<strong>Email</strong>:
<% if Danbooru.config.enable_email_verification? %>
You must enter a valid email address. You will need to verify your email address after registering.
<% else %>
You can optionally enter an email address. Although optional, you will not be able to reset your password without an email address.
<% end %>
</li>
</ul>
</div>
<% end %>
<div id="p3">
<%= simple_form_for(@user) do |f| %>
<%= f.input :name %>
<%= f.input :password %>