This commit is contained in:
albert
2010-10-08 18:42:26 -04:00
parent 6bc469b05d
commit f051e04550
88 changed files with 2865 additions and 699 deletions

View File

@@ -0,0 +1,28 @@
<% form_for @advertisement, :html => {:multipart => true} do |f| %>
<table width="100%">
<tfoot>
<tr>
<td></td>
<td><%= submit_tag "Submit" %></td>
</tr>
</tfoot>
<tbody>
<tr>
<th width="15%"><%= f.label :file %></th>
<td width="85%"><%= f.file_field "file" %></td>
</tr>
<tr>
<th><%= f.label :referral_url %></th>
<td><%= f.text_field :referral_url %></td>
</tr>
<tr>
<th><%= f.label :ad_type %></th>
<td><%= f.select :ad_type, ["vertical", "horizontal"] %></td>
</tr>
<tr>
<th><%= f.label :status %></th>
<td><%= f.select :status, ["active", "inactive"] %></td>
</tr>
</tbody>
</table>
<% end %>

View File

@@ -0,0 +1,11 @@
<% content_for(:secondary_nav_links) do %>
<menu>
<li><%= link_to "Listing", advertisements_path %></li>
<li><%= link_to "New", new_advertisement_path %></li>
<% if @advertisement && !@advertisement.new_record? %>
<li>|</li>
<li><%= link_to "Edit", edit_advertisement_path(@advertisement) %></li>
<li><%= link_to "Show", advertisement_path(@advertisement) %></li>
<% end %>
</menu>
<% end %>

View File

@@ -0,0 +1,3 @@
<%= image_tag(@advertisement.image_url) %>
<%= render :partial => "form" %>
<%= render :partial => "secondary_nav_links" %>

View File

@@ -0,0 +1,45 @@
<h4>Advertisements</h4>
<div style="margin-bottom: 1em;">
<% form_tag(advertisements_path, :method => :get) do %>
<table width="100%">
<tfoot>
<tr>
<th></th>
<td><%= submit_tag "Search" %></td>
</tr>
</tfoot>
<tbody>
<tr>
<th width="15%"><label>Start Date</label></th>
<td width="85%"><%= text_field_tag "start_date", @start_date %></td>
</tr>
<tr>
<th width="15%"><label>End Date</label></th>
<td width="85%"><%= text_field_tag "end_date", @end_date %></td>
</tr>
</tbody>
</table>
<% end %>
</div>
<table width="100%" class="highlightable">
<thead>
<tr>
<th width="5%"></th>
<th width="5%" style="text-align: right;">Hits</th>
<th width="90%"></th>
</tr>
</thead>
<tbody>
<% @advertisements.each do |advertisement| %>
<tr>
<td><%= image_tag(advertisement.image_url, :width => advertisement.preview_width, :height => advertisement.preview_height) %></td>
<td style="text-align: right;"><%= advertisement.hits.between(@start_date, @end_date).count %></td>
<td><%= link_to "Edit", edit_advertisement_path(advertisement) %></td>
</tr>
<% end %>
</tbody>
</table>
<%= render :partial => "secondary_nav_links" %>

View File

@@ -0,0 +1,3 @@
<%= error_messages_for :advertisement %>
<%= render :partial => "form" %>
<%= render :partial => "secondary_nav_links" %>

View File

@@ -0,0 +1,7 @@
<div><%= image_tag(@advertisement.image_url, :width => @advertisement.preview_width, :height => @advertisement.preview_height) %></div>
<ul>
<li>Hits: <%= @advertisement.hits.between(@start_date, @end_date).count %></li>
</ul>
<%= render :partial => "secondary_nav_links" %>

View File

@@ -0,0 +1,46 @@
<h4>History for <%= @artist.name %></h4>
<div>
<table width="100%" class="highlightable">
<thead>
<tr>
<th>Name</th>
<th>Other Names</th>
<th>Group</th>
<th>Updated</th>
<th>Updated by</th>
<th>Active</th>
<th>URLs</th>
</tr>
</thead>
<tbody>
<% @artist_versions.each do |artist_version| %>
<tr class="<%= cycle 'even', 'odd' %>">
<td><%= link_to h(artist_version.name), artist_versions_path(:artist_id => @artist.id) %></td>
<td><%= h artist_version.other_names %></td>
<td><%= h artist_version.group_name %></td>
<td><%= time_ago_in_words artist_version.created_at %> ago</td>
<td><%= link_to artist_version.updater_name, user_path(artist_version.user_id) %></td>
<td><%= artist_version.is_active? %></td>
<td><%= artist_version.urls.join(" ") %></td>
</tr>
<% end %>
</tbody>
</table>
</div>
<div id="paginator">
<%= will_paginate(@artist_versions) %>
</div>
<% content_for("footer") do %>
<li>|</li>
<li><%= link_to "Show", artist_path(@artist) %>
<li><%= link_to "Edit", edit_artist_path(@artist) %></li>
<li><%= link_to "Delete", artist_path(@artist, :method => :delete) %></li>
<li><%= link_to "History", artist_versions_path(:artist_id => @artist) %></li>
<li><%= link_to "Posts", posts_path(:tags => @artist.name) %></li>
<% end %>
<%= render :partial => "footer" %>

View File

@@ -0,0 +1,41 @@
<%= form_for(@artist) do |f| %>
<%= error_messages_for "artist" %>
<table class="form">
<tr>
<th width="15%"><%= f.label :name %>
<td width="85%"><%= f.text_field "name", :size => 30 %></td>
</tr>
<tr>
<th>
<%= f.label :other_names %>
</th>
<td>
<%= f.text_field "other_names", :size => 30 %>
<span class="info">Separate with commas</span>
</td>
</tr>
<tr>
<th><%= f.label :group_name %></th>
<td><%= f.text_field "group_name", :size => 30 %></td>
</tr>
<tr>
<th><%= f.label :url_string, "URLs" %></th>
<td><%= f.text_area "url_string", :size => "50x6", :class => "no-block" %></td>
</tr>
<tr>
<th><%= f.label :notes %></th>
<td>
<%= f.text_area "notes", :size => "50x10", :class => "no-block" %>
<span class="info"><%= link_to "Formatting help", wiki_page_path(:id => "help:dtext") %></span>
</td>
</tr>
<tr>
<td></td>
<td>
<%= submit_tag "Save" %>
<%= button_to_function "Cancel", "history.back()" %>
</td>
</tr>
</table>
<% end %>

View File

@@ -0,0 +1,6 @@
<div id="search-form" style="margin-bottom: 1em;">
<% form_tag(artists_path, :method => :get) do %>
<%= text_field_tag "name", params[:name], :size => 40 %>
<%= submit_tag "Search" %>
<% end %>
</div>

View File

@@ -0,0 +1,12 @@
<% content_for(:secondary_nav_links) do %>
<menu>
<li><%= link_to "Listing", artists_path %></li>
<li><%= link_to "New", new_artist_path %></li>
<li><%= link_to "Recent changes", artist_versions_path %></li>
<% if @artist && !@artist.new_record? %>
<li>|</li>
<li><%= link_to "Edit", edit_artist_path(@artist) %></li>
<li><%= link_to "Show", artist_path(@artist) %></li>
<% end %>
</menu>
<% end %>

View File

@@ -0,0 +1,3 @@
<div id="artist-edit">
<%= render :partial => "form" %>
</div>

View File

@@ -0,0 +1,35 @@
<div id="artist-index">
<%= render :partial => "search" %>
<table class="highlightable" width="100%">
<thead>
<tr>
<th width="5%"></th>
<th width="95%">Name</th>
</tr>
</thead>
<tbody>
<% @artists.each do |artist| %>
<% content_tag(:tr, :id => "artist-#{artist.id}") do %>
<td>
<%= link_to "P", posts_path(:tags => artist.name), :title => "Find posts for artist" %>
<%= link_to "E", edit_artist_path(artist), :title => "Edit artist" %>
<%= link_to "D", artist_path(artist, :method => :delete, :confirm => "Do you really want to delete this artist?") %>
</td>
<td>
<%= link_to h(artist.name), artist_path(artist) %>
<% if !artist.group_name.blank? %>
[<%= link_to(artist.group_name, artist_path(artist)) %>]
<% end %>
</td>
<% end %>
<% end %>
</tbody>
</table>
<div id="paginator">
<%= will_paginate(@artists) %>
</div>
<%= render :partial => "secondary_nav_links" %>
</div>

View File

@@ -0,0 +1,5 @@
<div id="artist-new">
<%= render :partial => "form" %>
</div>
<%= render :partial => "secondary_nav_links" %>

View File

@@ -0,0 +1,90 @@
<div id="artists-show">
<h1>Artist: <%= @artist.name.tr("_", " ") %></h1>
<% unless @artist.notes.blank? %>
<div style="margin-bottom: 1em;">
<%= format_text(@artist.notes) %>
</div>
<% end %>
<div style="margin-bottom: 1em;">
<table width="100%">
<tbody>
<tr>
<th width="15%">Status</th>
<td width="85%">
<% if @artist.is_banned? %>
Banned
<% elsif @artist.is_active? %>
Active
<% else %>
Inactive
<% end %>
</td>
</tr>
<% if @artist.has_tag_alias? %>
<tr>
<th>Tag Alias</th>
<td>
<%= @artist.tag_alias_name %>
</td>
</tr>
<% end %>
<% if !@artist.other_names.blank? %>
<tr>
<th>Other Names</th>
<td>
<%= link_to_artists(@artist.other_names.split(/,/)) %>
</td>
</tr>
<% end %>
<% if !@artist.group_name.blank? %>
<tr>
<th>Group</th>
<td>
<%= link_to_artist(@artist.group_name) %>
</td>
</tr>
<% end %>
<% if @artist.members.any? %>
<tr>
<th>Members</th>
<td>
<%= link_to_artists(@artist.members.map(&:name)) %>
</td>
</tr>
<% end %>
<% @artist.urls.each do |url| %>
<tr>
<th>URLs</th>
<td>
<%= link_to h(url.to_s), h(url.to_s) %>
<% if CurrentUser.user.is_moderator? %>
(<%= link_to("mass edit", mass_edit_admin_posts_path(:antecedent => "-#{@artist.name} source:#{ArtistUrl.normalize_for_search(url.to_s)}", :consequent => @artist.name)) %>)
<% end %>
</td>
</tr>
<% end %>
</tbody>
</table>
</div>
<p class="legend"><span class="new-artist">*</span> Indicates new artist</p>
<div style="margin-bottom: 1em;">
<h4>Recent Posts</h4>
<div style="margin: 1em 0;">
<%#= @post_set.presenter.post_previews_html %>
</div>
</div>
<% content_for("footer") do %>
<li>|</li>
<li><%= link_to "Posts", posts_path(:tags => @artist.name) %></li>
<li><%= link_to "Edit", edit_artist_path(@artist) %></li>
<li><%= link_to "Delete", artist_path(@artist, :method => :delete) %></li>
<li><%= link_to "History", artist_versions_path(:artist_id => @artist.id) %></li>
<% end %>
<%= render :partial => "secondary_nav_links" %>
</div>

View File

@@ -8,7 +8,7 @@
<div class="comment-preview"></div>
<% form_tag(comments_path) do %>
<%= form_tag(comments_path) do %>
<%= hidden_field "comment", "post_id", :value => post.id%>
<%= text_area "comment", "body", :size => "60x7" %><br>
<%= submit_tag "Post" %>

View File

@@ -10,7 +10,7 @@
<footer>
<menu>
<li><span class="link">Quote</span></li>
<% if @current_user.is_janitor? || @current_user.id == comment.creator_id %>
<% if CurrentUser.user.is_janitor? || CurrentUser.user.id == comment.creator_id %>
<li><%= link_to "Delete", comment_path(comment.id), :confirm => "Do you really want to delete this comment?", :method => :delete %></li>
<% end %>
<li><%= link_to "Vote up", comment_vote_path(comment.id, :is_positive => true), :method => :post %></li>

View File

@@ -1,19 +1,19 @@
<!doctype html>
<html>
<head>
<title><%= yield(:page_title) %></title>
<title><%= @page_title %></title>
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
<link rel="top" title="<%= Danbooru.config.app_name %>" href="/">
<%= csrf_meta_tag %>
<% unless @current_user.blacklisted_tags.blank? %>
<meta name="blacklisted-tags" content="<%= h @current_user.blacklisted_tags %>">
<% unless CurrentUser.user.blacklisted_tags.blank? %>
<meta name="blacklisted-tags" content="<%= CurrentUser.user.blacklisted_tags %>">
<% end %>
<% if flash[:notice] =~ /error/ %>
<meta name="errors" content="true">
<% end %>
<%= auto_discovery_link_tag :atom, posts_path(:format => "atom", :tags => params[:tags]) %>
<%= stylesheet_link_tag "default" %>
<%#= javascript_include_tag "http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" %>
<%= javascript_include_tag "jquery.min.js" %>
<%= javascript_include_tag "rails" %>
<%= javascript_include_tag "application" %>
<%= stylesheet_link_tag "compiled/default" %>
<%= javascript_include_tag "compiled/default" %>
<%= Danbooru.config.custom_html_header_content %>
<%= yield :html_header %>
</head>
@@ -22,10 +22,10 @@
<h1><%= Danbooru.config.app_name %></h1>
<nav>
<menu>
<% if @current_user.is_anonymous? %>
<% if CurrentUser.user.is_anonymous? %>
<%= nav_link_to("Login", new_session_path) %>
<% else %>
<%= nav_link_to("My Account", user_path(@current_user)) %>
<%= nav_link_to("My Account", user_path(CurrentUser.user)) %>
<% end %>
<%= nav_link_to("Posts", posts_path) %>
<%= nav_link_to("Comments", comments_path) %>
@@ -34,11 +34,11 @@
<%= nav_link_to("Tags", tags_path(:order => "date")) %>
<%= nav_link_to("Pools", pools_path) %>
<%= nav_link_to("Wiki", wiki_page_path(:id => "help:home")) %>
<%= nav_link_to("Forum", forum_topics_path, :class => (@current_user.has_forum_been_updated? ? "forum-updated" : nil)) %>
<%= nav_link_to("Forum", forum_topics_path, :class => (CurrentUser.user.has_forum_been_updated? ? "forum-updated" : nil)) %>
<%= nav_link_to("&raquo;".html_safe, site_map_path) %>
</menu>
<%= yield :secondary_nav_links %>
</nav>
<%= yield :secondary_links %>
</nav>
</header>
<% if flash[:notice] %>

View File

@@ -1,4 +1,4 @@
<% unless @post_set.suggestions.blank? %>
<% if @post_set.suggestions.any? %>
<div class="notice">
Maybe you meant: <%= @post_set.suggestions.map {|x| link_to(x, posts_path(:tags => x), :class => "tag-type-#{Tag.type_name(x)}" )}.to_sentence(:last_word_connector => ", or ", :two_words_connector => " or ") %>
</div>
@@ -13,7 +13,7 @@
<% end %>
</section>
<% if @current_user.is_privileged? %>
<% if CurrentUser.user.is_privileged? %>
<section id="mode-box">
<h1>Mode</h1>
<form action="/">
@@ -31,7 +31,7 @@
<option value="lock-note">Lock notes</option>
<option value="edit-tag-script">Edit tag script</option>
<option value="apply-tag-script">Apply tag script</option>
<% if @current_user.is_janitor? %>
<% if CurrentUser.user.is_janitor? %>
<option value="approve">Approve</option>
<% end %>
<option value="unapprove">Unapprove</option>
@@ -60,7 +60,7 @@
<section id="wiki-box">
<h2>Wiki</h2>
<%= @post_set.presenter.wiki_html %>
<%= @post_set.presenter.wiki_html(self) %>
</section>
</div>
</aside>
@@ -78,4 +78,4 @@
/ <%= @post_set.tags %>
<% end %>
<%= render :partial => "posts/common_secondary_nav_links" %>
<%= render :partial => "posts/partials/common/secondary_links" %>

View File

@@ -1,4 +1,4 @@
<% content_for(:secondary_nav_links) do %>
<% content_for(:secondary_links) do %>
<menu>
<li><%= link_to "Listing", posts_path %></li>
<li><%= link_to "Upload", new_upload_path %></li>

View File

@@ -1,5 +1,5 @@
<div id="edit">
<% unless @current_user.is_contributor? %>
<% unless CurrentUser.user.is_contributor? %>
<div style="margin-bottom: 1em;">
<p>Before editing, read the <%= link_to "how to tag guide", wiki_page_path(:id => "howto:tag") %>.</p>
</div>
@@ -23,7 +23,7 @@
<% end %>
</p>
<% if @current_user.is_privileged? %>
<% if CurrentUser.user.is_privileged? %>
<p>
<%= f.label :is_note_locked, "Lock notes" %>
<%= f.check_box :is_note_locked %>

View File

@@ -1,2 +1,2 @@
<%= render :partial => "posts/partials/show/notes", :locals => {:post => post, :notes => post.notes.active} %>
<%= image_tag(post.file_url_for(@current_user), :alt => post.tag_string, :width => post.image_width_for(@current_user), :height => post.image_height_for(@current_user), :id => "image") %>
<%= image_tag(post.file_url_for(CurrentUser.user), :alt => post.tag_string, :width => post.image_width_for(CurrentUser.user), :height => post.image_height_for(CurrentUser.user), :id => "image") %>

View File

@@ -1,10 +1,10 @@
<ul>
<%= resize_image_links(post, @current_user) %>
<%= resize_image_links(post, CurrentUser.user) %>
<li><%= link_to "Favorite", "#" %></li>
<li><%= link_to "Unfavorite", "#" %></li>
<li><%= link_to "Translate", "#" %></li>
<li><%= link_to "Unapprove", "#" %></li>
<% if @current_user.is_janitor? %>
<% if CurrentUser.user.is_janitor? %>
<li><%= link_to "Approve", "#" %></li>
<li><%= link_to "Undelete", "#" %></li>
<li><%= link_to "Delete", "#" %></li>

View File

@@ -6,7 +6,7 @@
<section>
<h1>Tags</h1>
<%= @post.presenter.tag_list_html(self, @current_user) %>
<%= @post.presenter.tag_list_html(self) %>
</section>
<section>
@@ -25,7 +25,7 @@
<section>
<h2>Image</h2>
<%= @post.presenter.image_html(self, @current_user) %>
<%= @post.presenter.image_html(self) %>
</section>
<section>
@@ -54,4 +54,4 @@
<meta name="pools" content="<%= @post.pool_string %>">
<% end %>
<%= render :partial => "posts/common_secondary_nav_links" %>
<%= render :partial => "posts/partials/common/secondary_links" %>

View File

@@ -1,31 +1,42 @@
<% form_tag(sessions_path) do %>
<fieldset>
<legend>Login</legend>
<p>
<%= label_tag "name", "Name" %>
<%= text_field_tag "name" %>
</p>
<div id="session-new">
<section>
<h2>Login</h2>
<% form_tag(sessions_path) do %>
<table width="100%">
<tfoot>
<tr>
<td></td>
<td><%= submit_tag "Login" %></td>
</tr>
</tfoot>
<tbody>
<tr>
<th width="15%">
<%= label_tag :name %>
</th>
<td width="85%">
<%= text_field_tag :name %>
</td>
</tr>
<tr>
<th><%= label_tag :password %></th>
<td><%= password_field_tag :password %></td>
</tr>
</tbody>
</table>
<% end %>
</section>
<p>
<%= label_tag "password", "Password" %>
<%= password_field_tag "password" %>
</p>
<p>
<%= submit_tag "Submit" %>
</p>
</fieldset>
<% end %>
<aside>
<h2>Help</h2>
<menu>
<li><%= link_to "I don't have an account", new_user_path %></li>
<li><%= link_to "I forgot my password", reset_password_info_path %></li>
<li><%= link_to "I forgot my login", login_reminder_info_path %></li>
<li><%= link_to "I want to delete my account", delete_account_info_path %></li>
</menu>
</aside>
<aside>
<h2>Help</h2>
<ul>
<li><%= link_to "I don't have an account", new_user_path %></li>
<li><%= link_to "I forgot my password", reset_password_info_path %></li>
<li><%= link_to "I forgot my login", login_reminder_info_path %></li>
<li><%= link_to "I want to delete my account", delete_account_info_path %></li>
</ul>
</aside>
</div>
<% content_for(:page_title) do %>
/ login

View File

@@ -14,6 +14,11 @@
<p>An error occurred: <%= @upload.status %></p>
<% end %>
<p>You can <%= link_to "upload another file", new_upload_path %> or <%= link_to "view your current uploads", uploads_path %>.</p>
<p>
You can <%= link_to "upload another file", new_upload_path %> or <%= link_to "view your current uploads", uploads_path %>.
<% if CurrentUser.user.is_moderator? %>
<%= link_to "Force update", upload_path(@upload), :remote => true, :method => :put %>.
<% end %>
</p>
<%= render :partial => "posts/common_secondary_nav_links" %>

View File

@@ -0,0 +1,15 @@
<% content_for(:secondary_nav_links) do %>
<menu>
<li><%= link_to "Listing", users_path %></li>
<li><%= link_to "Register", new_user_path %></li>
<% if @user && !@user.new_record? %>
<li>|</li>
<li><%= link_to "Edit", edit_user_path(@user) %></li>
<li><%= link_to "Profile", user_path(@user) %></li>
<% end %>
<% unless CurrentUser.user.is_anonymous? %>
<li>|</li>
<li><%= link_to "Logout", session_path(0), :method => :delete %></li>
<% end %>
</menu>
<% end %>

View File

@@ -1,96 +1,100 @@
<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="users-new">
<h1>Registration</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>
<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>
<div>
<h1>Basic</h1>
<ul>
<li>Free</li>
<li>Create and edit posts, favorites, forums, comments, wiki pages, pools, artists, and dmails</li>
<li>Search up to 2 tags at once</li>
<li>Some hidden posts</li>
<li>Ads visible</li>
<li>Uploads limited</li>
</ul>
<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>
<footer class="nav-links">
<%= link_to "Continue &raquo;".html_safe, new_user_path(:anchor => "p2") %>
</footer>
</div>
<div>
<h1>Privileged</h1>
<div id="p2">
<p>There are some restrictions on names:</p>
<ul>
<li>One time $20 fee</li>
<li>Search up to 6 tags at once</li>
<li>No hidden posts</li>
<li>No ads</li>
<li>Uploads limited</li>
<li>Tag subscriptions</li>
</ul>
</div>
<div>
<h1>Contributor</h1>
<ul>
<li>No upload limits</li>
<li>By invitation only</li>
<li><strong>Name</strong>: Your name must be at least 2 characters and at most 20 characters long. It cannot contain spaces, commas, colons, or semi-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>
<% form_for(@user) do |f| %>
<%= error_messages_for("user") %>
<table width="100%">
<tbody>
<tr>
<th width="15%"><%= f.label :name %></th>
<td width="85%"><%= f.text_field :name %></td>
</tr>
<tr>
<th><%= f.label :password %></th>
<td><%= f.password_field :password %></td>
</tr>
<tr>
<th><%= f.label :password_confirmation %></th>
<td><%= f.password_field :password_confirmation %></td>
</tr>
<tr>
<th><%= f.label :email %></th>
<td><%= f.text_field :email %></td>
</tr>
<tr>
<td></td>
<td><%= submit_tag "Submit" %></td>
</tr>
</tbody>
</table>
<% end %>
<footer class="nav-links">
<%= link_to "&laquo; Back".html_safe, new_user_path(:anchor => "p1") %>
</footer>
</div>
</div>
<% form_tag(users_path) do %>
<%= error_messages_for(@user) %>
<fieldset>
<legend>Signup</legend>
<p>
<%= label "user", "name" %>
<%= text_field "user", "name" %>
</p>
<p>
<%= label "user", "password" %>
<%= password_field "user", "password" %>
</p>
<p>
<%= label "user", "password_confirmation" %>
<%= password_field "user", "password_confirmation" %>
</p>
<p>
<%= label "user", "email" %>
<%= text_field "user", "email" %>
</p>
<%= submit_tag "Submit" %>
</fieldset>
<% end %>
<aside id="form-help">
<section>
Your name must be at least 2 characters and at most 20 characters long. It cannot contain spaces, commas, colons, or semi-colons.
</section>
<section>
Your password must be at least 5 characters long.
</section>
<section>
<% 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 %>
</section>
</aside>
<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
$("#user_name").focus(function() {
$("#description").append("Your name must be between 2 and 20 characters, and cannot contain whitespace, commas, semicolons, or colons.");
});
$("#user_name").blur(function() {
$("#description").empty();
});
});
</script>

View File

@@ -1,10 +1 @@
<nav>
<ul>
<li><%= link_to "Settings", edit_user_path(@user) %></li>
<li><%= link_to "Log out", session_path(0), :method => :delete %></li>
</ul>
</nav>
<% content_for(:page_title) do %>
/ Users / <%= @user.name %>
<% end %>
<%= render :partial => "secondary_nav_links" %>