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 def create
@user = User.create(params[:user]) @user = User.create(params[:user])
flash[:notice] = "There were errors" if @user.errors.any? if @user.errors.empty?
session[:user_id] = @user.id session[:user_id] = @user.id
end
set_current_user set_current_user
respond_with(@user) respond_with(@user)
end end

View File

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

View File

@@ -2,64 +2,68 @@
<div id="a-new"> <div id="a-new">
<h1>Signup</h1> <h1>Signup</h1>
<div id="p1"> <% if @user.errors.empty? %>
<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> <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"> <div id="account-comparison">
<section> <section>
<h1>Basic</h1> <h1>Basic</h1>
<ul> <ul>
<li>Free</li> <li>Free</li>
<li>Uploads limited</li> <li>Uploads limited</li>
<li>Search up to 2 tags at once</li> <li>Search up to 2 tags at once</li>
<li>Some hidden posts</li> <li>Some hidden posts</li>
<li>Ads visible</li> <li>Ads visible</li>
<li>Create and edit posts, favorites, forum posts, comments, wiki pages, pools, artists, and dmails</li> <li>Create and edit posts, favorites, forum posts, comments, wiki pages, pools, artists, and dmails</li>
</ul> </ul>
</section> </section>
<section> <section>
<h1>Privileged</h1> <h1>Privileged</h1>
<ul> <ul>
<li>One time $20 fee</li> <li>One time $20 fee</li>
<li>Uploads limited</li> <li>Uploads limited</li>
<li>Search up to 6 tags at once</li> <li>Search up to 6 tags at once</li>
<li>No hidden posts</li> <li>No hidden posts</li>
<li>No ads</li> <li>No ads</li>
<li>Tag subscriptions</li> <li>Tag subscriptions</li>
</ul> </ul>
</section> </section>
<section> <section>
<h1>Contributor</h1> <h1>Contributor</h1>
<ul> <ul>
<li>Invitation only</li> <li>Invitation only</li>
<li>No upload limits</li> <li>No upload limits</li>
</ul> </ul>
</section> </section>
<div class="clearfix"></div> <div class="clearfix"></div>
</div>
</div> </div>
</div>
<div id="p2"> <div id="p2">
<p>There are some restrictions on names:</p> <p>There are some restrictions on names:</p>
<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>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>Password</strong>: Your password must be at least 5 characters long.</li>
<li> <li>
<strong>Email</strong>: <strong>Email</strong>:
<% if Danbooru.config.enable_email_verification? %> <% if Danbooru.config.enable_email_verification? %>
You must enter a valid email address. You will need to verify your email address after registering. You must enter a valid email address. You will need to verify your email address after registering.
<% else %> <% else %>
You can optionally enter an email address. Although optional, you will not be able to reset your password without an email address. You can optionally enter an email address. Although optional, you will not be able to reset your password without an email address.
<% end %> <% end %>
</li> </li>
</ul> </ul>
</div>
<% end %>
<div id="p3">
<%= simple_form_for(@user) do |f| %> <%= simple_form_for(@user) do |f| %>
<%= f.input :name %> <%= f.input :name %>
<%= f.input :password %> <%= f.input :password %>