work on controllers/views started

This commit is contained in:
albert
2010-03-11 19:42:04 -05:00
parent ac98d7db37
commit 15c134b270
34 changed files with 720 additions and 7543 deletions

View File

@@ -1,23 +1,23 @@
<!doctype html>
<html>
<head>
<title><%= yield :page_title %></title>
<title><%= yield(:page_title) || Danbooru.config.app_name %></title>
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
<link rel="top" title="<%= Danbooru.config.app_name %>" href="/">
<%= auto_discovery_link_tag :atom, posts_path(:format => "atom", :tags => params[:tags]) %>
<%= stylesheet_link_tag "default" %>
<%= javascript_include_tag "application" %>
<%= javascript_include_tag "http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" %>
<%= Danbooru.config.custom_html_header_content %>
<%= yield :html_header_content %>
</head>
<body>
<div id="header">
<h2 id="site-title"><%= link_to(Danbooru.config.app_name, "/") %><%= tag_header(params[:tags]) %></h2>
<ul class="flat-list" id="nav">
<% if @current_user.is_member_or_higher? %>
<%= nav_link_to("My Account", user_path(@current_user)) %>
<nav>
<h1><%= link_to(Danbooru.config.app_name, "/") %><%= yield :page_header %></h1>
<ul>
<% if @current_user.is_anonymous? %>
<%= nav_link_to("Login", new_session_path) %>
<% else %>
<%= nav_link_to("Login/Signup", new_session_path) %>
<%= nav_link_to("My Account", user_path(@current_user)) %>
<% end %>
<%= nav_link_to("Posts", posts_path) %>
<%= nav_link_to("Comments", comments_path) %>
@@ -25,15 +25,15 @@
<%= nav_link_to("Artists", artists_path(:order => "date")) %>
<%= nav_link_to("Tags", tags_path(:order => "date")) %>
<%= nav_link_to("Pools", pools_path) %>
<%= nav_link_to("Wiki", wiki_page_path(:title => "help:home")) %>
<%= 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("&raquo;", site_map_help_path) %>
<%= nav_link_to("&raquo;".html_safe, site_map_path) %>
</ul>
<%= yield :secondary_nav_links %>
</div>
</nav>
<% if flash[:notice] %>
<div id="notice"><%= h flash[:notice] %></div>
<div id="notice"><%= flash[:notice] %></div>
<% else %>
<div id="notice" style="display: none;"></div>
<% end %>
@@ -46,8 +46,8 @@
<% if !@current_user.is_privileged? %>
<div id="upgrade-account" style="display: none;">
<%= link_to "Upgrade your account for only $20", users_help_path %>
<%= link_to_function "No thanks", "$('upgrade-account').hide(); Cookie.put('hide-upgrade-account', '1', 7)", :id => "hide-upgrade-account-link" %>
<%= link_to "Upgrade your account for only $20", wiki_page_path(:id => "help:users") %>
<%= link_to "No thanks", "#", :id => "hide-upgrade-account-link" %>
</div>
<% end %>
@@ -55,21 +55,15 @@
<div id="ban-reason">
You have been banned.
<% if @current_user.ban %>
Reason: <%= h @current_user.ban.reason %>.
Reason: <%= @current_user.ban.reason %>.
Expires: <%= @current_user.ban.expires_at.strftime('%Y-%m-%d') %>
<% end %>
</div>
<% end %>
<div id="content">
<section id="content">
<%= yield :layout %>
</div>
<script type="text/javascript">
<%= yield :blacklist %>
Post.init_blacklisted();
Cookie.setup()
</script>
</section>
<%= yield :page_footer_content %>
</body>

View File

View File

View File

@@ -0,0 +1,28 @@
<% form_tag(sessions_path) do %>
<fieldset>
<legend>Login</legend>
<p>
<%= label_tag "name", "Name" %>
<%= text_field_tag "name" %>
</p>
<p>
<%= label_tag "password", "Password" %>
<%= password_field_tag "password" %>
</p>
<p>
<%= submit_tag "Submit" %>
</p>
</fieldset>
<% end %>
<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>

View File

@@ -0,0 +1,5 @@
<h1>Delete My Account</h1>
<p>In order to maintain accountability, accounts cannot be deleted on this site. If you're worried about someone searching for your name, you can rename your account. But any existing dmail, forum post, comment, or post will still be attributed to you.</p>
<p>Exceptions will be made for cases of extreme harassment. This harassment must have occurred on this site, whether through dmails, comments, or forum posts. Please send a dmail to an admin with details and evidence of harassment.</p>

View File

@@ -0,0 +1,5 @@
<h1>I Forgot My Login</h1>
<p>If you supplied an email address when signing up, <%= Danbooru.config.app_name %> can email you your login information. Password details will not be provided and will not be changed.</p>
<p>If you didn't supply a valid email address, you are out of luck.</p>

View File

@@ -0,0 +1,5 @@
<h1>I Forgot My Password</h1>
<p>If you supplied an email address when signing up, <%= Danbooru.config.app_name %> can reset your password and email you the new one. You are strongly advised to change your password once you log on again.</p>
<p>If you didn't supply a valid email address, you are out of luck.</p>

View File

@@ -0,0 +1,3 @@
<% content_for(:page_header) do %>
/ <%= @user.name %> / Settings
<% end %>

View File

@@ -0,0 +1,96 @@
<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>
<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>
<div>
<h1>Privileged</h1>
<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>
</ul>
</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

@@ -0,0 +1,11 @@
<h1><%= @user.name %></h1>
<nav>
<ul>
<li><%= link_to "Settings", edit_user_path(@user) %></li>
</ul>
</nav>
<% content_for(:page_header) do %>
/ <%= @user.name %>
<% end %>