improved copy for account registration/upgrade
This commit is contained in:
@@ -1,15 +1,10 @@
|
||||
$(document).ready(function() {
|
||||
// $("#hide-upgrade-account-link").click(function() {
|
||||
// $("#upgrade-account").hide();
|
||||
// Cookie.put('hide-upgrade-account', '1', 7);
|
||||
// });
|
||||
|
||||
$(function() {
|
||||
// Table striping
|
||||
$("table.striped tbody tr:even").addClass("even");
|
||||
$("table.striped tbody tr:odd").addClass("odd");
|
||||
$(".striped tbody tr:even").addClass("even");
|
||||
$(".striped tbody tr:odd").addClass("odd");
|
||||
|
||||
// More link
|
||||
if ($("#site-map-link").length > 0) {
|
||||
// More link
|
||||
$("#site-map-link").click(function(e) {
|
||||
$("#more-links").toggle();
|
||||
e.preventDefault();
|
||||
@@ -27,6 +22,19 @@ $(document).ready(function() {
|
||||
});
|
||||
}
|
||||
|
||||
// Account notices
|
||||
$("#hide-sign-up-notice").click(function(e) {
|
||||
$("#sign-up-notice").hide();
|
||||
Danbooru.Cookie.put("hide_sign_up_notice", "1", 7);
|
||||
e.preventDefault();
|
||||
});
|
||||
|
||||
$("#hide-upgrade-account-notice").click(function(e) {
|
||||
$("#upgrade-account-notice").hide();
|
||||
Danbooru.Cookie.put('hide_upgrade_account_notice', '1', 7);
|
||||
e.preventDefault();
|
||||
});
|
||||
|
||||
// Ajax links
|
||||
$("a[data-remote=true]").click(function(e) {
|
||||
Danbooru.ajax_start(e.target);
|
||||
@@ -38,7 +46,6 @@ $(document).ready(function() {
|
||||
|
||||
// TOS link
|
||||
if (!location.href.match(/terms_of_service/) && Danbooru.Cookie.get("tos") !== "1") {
|
||||
// Setting location.pathname in Safari doesn't work, so manually extract the domain.
|
||||
var domain = location.href.match(/^(http:\/\/[^\/]+)/)[0];
|
||||
location.href = domain + "/static/terms_of_service?url=" + location.href;
|
||||
}
|
||||
|
||||
@@ -8,6 +8,22 @@ div#page {
|
||||
overflow: visible;
|
||||
margin: 0 30px;
|
||||
|
||||
div#upgrade-account-notice, div#sign-up-notice {
|
||||
margin: 1em 0;
|
||||
padding: 1em;
|
||||
text-align: center;
|
||||
position: relative;
|
||||
|
||||
h1 {
|
||||
font-size: $h2_size;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
p {
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
|
||||
aside#sidebar {
|
||||
width: 20%;
|
||||
float: left;
|
||||
|
||||
@@ -20,34 +20,17 @@ div#c-users {
|
||||
max-width: 50em;
|
||||
|
||||
p {
|
||||
font-size: 1.2em;
|
||||
margin-bottom: 1em;
|
||||
line-height: 1.4em;
|
||||
}
|
||||
|
||||
li {
|
||||
margin-left: 1em;
|
||||
list-style-type: disc;
|
||||
input[type=submit] {
|
||||
padding: 5px 20px;
|
||||
font-size: 20pt;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
div#account-comparison {
|
||||
padding: 0 1em;
|
||||
margin: 1em 0;
|
||||
|
||||
h1 {
|
||||
font-size: $h3_size;
|
||||
}
|
||||
|
||||
li {
|
||||
font-size: 0.8em;
|
||||
line-height: 1.5em;
|
||||
}
|
||||
|
||||
section {
|
||||
width: 15em;
|
||||
float: left;
|
||||
padding-right: 1em;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
footer.nav-links {
|
||||
font-size: 1.4545em;
|
||||
font-weight: bold;
|
||||
@@ -59,4 +42,55 @@ div#c-users {
|
||||
margin-bottom: 2em;
|
||||
}
|
||||
}
|
||||
|
||||
div#a-upgrade-information {
|
||||
max-width: 55em;
|
||||
font-size: 1.2em;
|
||||
|
||||
form {
|
||||
input {
|
||||
font-size: 20pt;
|
||||
}
|
||||
|
||||
input[type=submit] {
|
||||
padding: 5px 20px;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
|
||||
div#feature-comparison {
|
||||
overflow: hidden;
|
||||
margin-bottom: 1em;
|
||||
|
||||
div.column {
|
||||
width: 15em;
|
||||
float: left;
|
||||
border: 1px solid #666;
|
||||
@include border-radius(4px);
|
||||
padding: 0.25em 0.5em;
|
||||
margin: 0.5em;
|
||||
|
||||
h1 {
|
||||
font-size: $h3_size;
|
||||
}
|
||||
|
||||
li {
|
||||
margin-left: 1.5em;
|
||||
list-style-type: disc;
|
||||
}
|
||||
|
||||
&#basic-account {
|
||||
background: rgb(240, 255, 240);
|
||||
}
|
||||
|
||||
&#privileged-account {
|
||||
background: rgb(255, 255, 240);
|
||||
}
|
||||
|
||||
&#contributor-account {
|
||||
background: rgb(240, 240, 240);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,7 @@ class ApplicationController < ActionController::Base
|
||||
after_filter :reset_current_user
|
||||
before_filter :initialize_cookies
|
||||
before_filter :set_title
|
||||
before_filter :set_started_at_session
|
||||
layout "default"
|
||||
|
||||
rescue_from User::PrivilegeError, :with => :access_denied
|
||||
@@ -40,6 +41,12 @@ protected
|
||||
CurrentUser.ip_addr = nil
|
||||
end
|
||||
|
||||
def set_started_at_session
|
||||
if session[:started_at].blank?
|
||||
session[:started_at] = Time.now
|
||||
end
|
||||
end
|
||||
|
||||
%w(member banned privileged contributor janitor moderator admin).each do |level|
|
||||
define_method("#{level}_only") do
|
||||
if CurrentUser.user.__send__("is_#{level}?")
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
<meta name="default-image-size" content="<%= CurrentUser.user.default_image_size %>">
|
||||
<%= auto_discovery_link_tag :atom, posts_path(:format => "atom", :tags => params[:tags]) %>
|
||||
<%= stylesheet_link_tag "application", :media => "screen" %>
|
||||
<%#= stylesheet_link_tag "mobile", :media => "only screen and (max-device-width:480px)" %>
|
||||
<%= javascript_include_tag "application" %>
|
||||
<%= Danbooru.config.custom_html_header_content %>
|
||||
<%= yield :html_header %>
|
||||
@@ -36,6 +35,14 @@
|
||||
</header>
|
||||
|
||||
<div id="page">
|
||||
<% if CurrentUser.is_anonymous? && session[:started_at] && session[:started_at] < 1.minute.ago && cookies[:hide_sign_up_notice].blank? %>
|
||||
<%= render "users/sign_up_notice" %>
|
||||
<% end %>
|
||||
|
||||
<% if !CurrentUser.is_anonymous? && !CurrentUser.is_privileged? && cookies[:hide_upgrade_account_notice].blank? && params[:action] != "upgrade_information" %>
|
||||
<%= render "users/upgrade_notice" %>
|
||||
<% end %>
|
||||
|
||||
<%- if flash[:notice] -%>
|
||||
<div class="ui-corner-all ui-state-highlight" id="notice"><%= flash[:notice] %></div>
|
||||
<%- else -%>
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
<% content_for(:secondary_links) do %>
|
||||
<menu>
|
||||
<li><%= link_to "Listing", users_path %></li>
|
||||
<% if CurrentUser.is_anonymous? %>
|
||||
<li><%= link_to "Sign up", new_user_path %></li>
|
||||
<% end %>
|
||||
<% if @user && !CurrentUser.is_anonymous? %>
|
||||
<li>|</li>
|
||||
<% if @user.id == CurrentUser.id %>
|
||||
@@ -10,6 +13,9 @@
|
||||
<% else %>
|
||||
<li><%= link_to "Send message", new_dmail_path(:dmail => {:to_id => @user.id}) %></li>
|
||||
<% end %>
|
||||
<% if !CurrentUser.is_privileged? %>
|
||||
<li><%= link_to "Upgrade", upgrade_information_users_path %></li>
|
||||
<% end %>
|
||||
<li>|</li>
|
||||
<li><%= link_to "Sign out", session_path, :method => :delete %></li>
|
||||
<% end %>
|
||||
|
||||
4
app/views/users/_sign_up_notice.html.erb
Normal file
4
app/views/users/_sign_up_notice.html.erb
Normal file
@@ -0,0 +1,4 @@
|
||||
<div class="ui-corner-all ui-state-highlight" id="sign-up-notice">
|
||||
<h1>Like the site? <%= link_to "Sign up for a free basic account!", new_user_path %></h1>
|
||||
<p><%= link_to "No thanks", "#", :id => "hide-sign-up-notice" %></p>
|
||||
</div>
|
||||
4
app/views/users/_upgrade_notice.html.erb
Normal file
4
app/views/users/_upgrade_notice.html.erb
Normal file
@@ -0,0 +1,4 @@
|
||||
<div class="ui-corner-all ui-state-highlight" id="upgrade-account-notice">
|
||||
<h1><%= link_to "Upgrade your account for only $10!", upgrade_information_users_path %></h1>
|
||||
<p><%= link_to "No thanks", "#", :id => "hide-upgrade-account-notice" %></p>
|
||||
</div>
|
||||
@@ -1,80 +1,23 @@
|
||||
<div id="c-users">
|
||||
<div id="a-new">
|
||||
<h1>Sign up</h1>
|
||||
<h1>Sign Up</h1>
|
||||
|
||||
<% 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>
|
||||
|
||||
<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>Contributor</h1>
|
||||
<ul>
|
||||
<li>Invitation only</li>
|
||||
<li>No upload limits</li>
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<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>
|
||||
</div>
|
||||
<% end %>
|
||||
<p>A basic account is <strong>free</strong> and lets you keep favorites, upload artwork, and write comments. If you want <%= link_to "more features", wiki_pages_path(:title => "help:accounts") %> you can upgrade your account later.</p>
|
||||
|
||||
<div id="p3">
|
||||
<%= simple_form_for(@user) do |f| %>
|
||||
<%= f.input :name, :as => :string %>
|
||||
<%= f.input :email, :required => false, :as => :email %>
|
||||
<%= f.input :password %>
|
||||
<%= f.input :password_confirmation %>
|
||||
<%= f.input :email, :required => false, :as => :email %>
|
||||
<%= f.button :submit %>
|
||||
<%= f.button :submit, "Sign up" %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%= render "secondary_links" %>
|
||||
|
||||
<% content_for(:page_title) do %>
|
||||
Sign up - <%= Danbooru.config.app_name %>
|
||||
<% end %>
|
||||
|
||||
50
app/views/users/upgrade_information.html.erb
Normal file
50
app/views/users/upgrade_information.html.erb
Normal file
@@ -0,0 +1,50 @@
|
||||
<div id="c-users">
|
||||
<div id="a-upgrade-information">
|
||||
<h1>Upgrade Account</h1>
|
||||
|
||||
<p class="copy">Annoyed by ads? Want more searching power? Upgrade your account for only $10 and become a power user of the best database of anime artwork on the internet.</p>
|
||||
|
||||
<div id="feature-comparison">
|
||||
<div class="column" id="basic-account">
|
||||
<h1>Basic</h1>
|
||||
<ul>
|
||||
<li>Free</li>
|
||||
<li>Ad supported</li>
|
||||
<li>Search 2 tags at a time</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="column" id="privileged-account">
|
||||
<h1>Privileged</h1>
|
||||
<ul>
|
||||
<li>One time $10 fee</li>
|
||||
<li>No ads</li>
|
||||
<li>Search 8 tags at a time</li>
|
||||
<li>Subscribe to tags</li>
|
||||
<li>Warm fuzzy feeling</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="column" id="contributor-account">
|
||||
<h1>Contributor</h1>
|
||||
<ul>
|
||||
<li>Invite only</li>
|
||||
<li>Unlimited uploads</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p>Just provide your email address and details for upgrading your account will be sent to you. If you have any further questions or concerns, feel free to contact me at <%= mail_to Danbooru.config.contact_email, nil, :encode => :javascript %>.</p>
|
||||
|
||||
<%= form_tag(upgrade_user_path(CurrentUser.user)) do %>
|
||||
<%= email_field_tag :email, CurrentUser.email %>
|
||||
<%= submit_tag "Upgrade" %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%= render "secondary_links" %>
|
||||
|
||||
<% content_for(:page_title) do %>
|
||||
Upgrade - <%= Danbooru.config.app_name %>
|
||||
<% end %>
|
||||
@@ -151,7 +151,15 @@ Danbooru::Application.routes.draw do
|
||||
end
|
||||
end
|
||||
resources :uploads
|
||||
resources :users
|
||||
resources :users do
|
||||
collection do
|
||||
get :upgrade_information
|
||||
end
|
||||
|
||||
member do
|
||||
post :upgrade
|
||||
end
|
||||
end
|
||||
resources :user_feedbacks
|
||||
resources :wiki_pages do
|
||||
member do
|
||||
|
||||
Reference in New Issue
Block a user