work on post views

This commit is contained in:
albert
2010-03-12 12:32:31 -05:00
parent 15c134b270
commit 9f29ffc8c3
18 changed files with 486 additions and 317 deletions

View File

@@ -4,16 +4,21 @@
<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="/">
<%= csrf_meta_tag %>
<% unless @current_user.blacklisted_tags.blank? %>
<meta name="blacklisted-tags" content="<%= h @current_user.blacklisted_tags %>">
<% 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 "rails" %>
<%= Danbooru.config.custom_html_header_content %>
<%= yield :html_header_content %>
</head>
<body>
<nav>
<h1><%= link_to(Danbooru.config.app_name, "/") %><%= yield :page_header %></h1>
<ul>
<menu>
<% if @current_user.is_anonymous? %>
<%= nav_link_to("Login", new_session_path) %>
<% else %>
@@ -28,7 +33,7 @@
<%= 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;".html_safe, site_map_path) %>
</ul>
</menu>
<%= yield :secondary_nav_links %>
</nav>
@@ -61,9 +66,9 @@
</div>
<% end %>
<section id="content">
<div id="content">
<%= yield :layout %>
</section>
</div>
<%= yield :page_footer_content %>
</body>

View File

@@ -0,0 +1,97 @@
<% unless @post_set.suggestions.blank? %>
<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>
<% end %>
<aside>
<section id="search-box">
<h1>Search</h1>
<% form_tag(posts_path, :method => "get") do %>
<%= text_field_tag("tags", params[:tags], :size => 20) %>
<%= submit_tag "Go" %>
<% end %>
</section>
<% if @current_user.is_privileged? %>
<section id="mode-box">
<h1>Mode</h1>
<form action="/">
<select name="mode">
<option value="view">View posts</option>
<option value="edit">Edit posts</option>
<option value="add-fav">Add to favorites</option>
<option value="remove-fav">Remove from favorites</option>
<option value="rating-s">Rate safe</option>
<option value="rating-q">Rate questionable</option>
<option value="rating-e">Rate explicit</option>
<option value="vote-up">Vote up</option>
<option value="vote-down">Vote down</option>
<option value="lock-rating">Lock rating</option>
<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? %>
<option value="approve">Approve post</option>
<% end %>
<option value="flag">Flag post</option>
</select>
</form>
</section>
<% end %>
<section id="blacklist-box">
<h1>Blacklisted</h1>
<%= link_to "Hidden", "#" %>
<ul>
</ul>
</section>
<div id="tag-and-wiki-box">
<menu>
<li><h1>Tags</h1></li>
<li><h1>Wiki</h1></li>
</menu>
<section id="tag-box">
<h2>Tags</h2>
<%= @post_set.presenter.tag_list_html %>
</section>
<section id="wiki-box">
<h2>Wiki</h2>
<%= @post_set.presenter.wiki_html %>
</section>
</div>
</aside>
<section>
<h1>Posts</h1>
<%= @post_set.presenter.post_previews_html %>
</section>
<footer>
<%= @post_set.presenter.pagination_html %>
</footer>
<% content_for(:page_title) do %>
/<%= @post_set.tags %>
<% end %>
<% content_for(:page_header) do %>
/ <%= @post_set.tags %>
<% end %>
<% content_for(:secondary_nav_links) do %>
<menu>
<li>Listing</li>
<li>Upload</li>
<li>Popular</li>
<li>Favorites</li>
<li>Subscriptions</li>
<li>Changes</li>
<li>Approvals</li>
<li>Moderate</li>
<li>Help</li>
</menu>
<% end %>

View File

@@ -19,10 +19,18 @@
<aside>
<h2>Help</h2>
<ul>
<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>
</ul>
</menu>
</aside>
<% content_for(:page_title) do %>
login
<% end %>
<% content_for(:page_header) do %>
/ login
<% end %>

View File

@@ -1,3 +1,70 @@
<% form_for @user do |f| %>
<fieldset>
<legend>Basic</legend>
<p>
<%= f.label :email %>
<%= f.text_field :email %>
</p>
<p>
<%= f.label :receive_email_notifications, "Email notifications" %>
<%= f.check_box :receive_email_notifications %>
</p>
<p>
<%= f.label :comment_threshold %>
<%= f.text_field :comment_threshold, :size => 2 %>
</p>
<p>
<%= f.label :always_resize_images %>
<%= f.check_box :always_resize_images %>
</p>
<p>
<%= f.label :default_image_size %>
<%= f.select :default_image_size, %w(Medium Large Original) %>
</p>
<p>
<%= f.label :favorite_tags %>
<%= f.text_area :favorite_tags, :rows => 5 %>
</p>
<p>
<%= f.label :blacklisted_tags %>
<%= f.text_area :blacklisted_tags, :rows => 5 %>
</p>
</fieldset>
<fieldset>
<legend>Special</legend
<p>For security purposes, changing the following settings requires you to re-enter your password. You can leave the new password field blank to keep your current one.</p>
<p>
<%= f.label :name %>
<%= f.text_field :name %>
</p>
<p>
<%= f.label :password, "New password" %>
<%= f.text_field :password %>
</p>
<p>
<%= f.label :old_password %>
<%= f.text_field :old_password %>
</p>
</fieldset>
<%= submit_tag "Submit" %>
<% end %>
<% content_for(:page_title) do %>
/<%= @user.name %>/Settings
<% end %>
<% content_for(:page_header) do %>
/ <%= @user.name %> / Settings
<% end %>

View File

@@ -1,11 +1,14 @@
<h1><%= @user.name %></h1>
<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 %>
<% content_for(:page_header) do %>
/ <%= @user.name %>
<% end %>
<% end %>