more work

This commit is contained in:
albert
2010-10-19 19:34:31 -04:00
parent cb3d7e9e9b
commit acdce69f20
48 changed files with 2494 additions and 1585 deletions

View File

@@ -0,0 +1,2 @@
- @posts.each do |post|
= @post.id

View File

@@ -13,6 +13,7 @@
<% end %>
<%= auto_discovery_link_tag :atom, posts_path(:format => "atom", :tags => params[:tags]) %>
<%= stylesheet_link_tag "compiled/default" %>
<%= stylesheet_link_tag "smoothness/jquery-ui-1.8.5.custom.css" %>
<%= javascript_include_tag "compiled/default" %>
<%= Danbooru.config.custom_html_header_content %>
<%= yield :html_header %>
@@ -47,7 +48,7 @@
<div id="notice" style="display: none;"></div>
<% end %>
<div id="content">
<div id="page">
<%= yield :layout %>
</div>

View File

@@ -1,81 +1,90 @@
<% 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>
<% end %>
<div class="posts">
<div class="index">
<% 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>
<% end %>
<aside class="sidebar">
<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 CurrentUser.user.is_privileged? %>
<section id="mode-box">
<h1>Mode</h1>
<form action="/">
<select name="mode">
<option value="view">View</option>
<option value="edit">Edit</option>
<option value="add-fav">Favorite</option>
<option value="remove-fav">Unfavorite</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 CurrentUser.user.is_janitor? %>
<option value="approve">Approve</option>
<aside class="sidebar">
<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 CurrentUser.user.is_privileged? %>
<section id="mode-box">
<h1>Mode</h1>
<form action="/">
<select name="mode">
<option value="view">View</option>
<option value="edit">Edit</option>
<option value="add-fav">Favorite</option>
<option value="remove-fav">Unfavorite</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 CurrentUser.user.is_janitor? %>
<option value="approve">Approve</option>
<% end %>
<option value="unapprove">Unapprove</option>
</select>
</form>
</section>
<% end %>
<section id="blacklist-box">
<h1>Blacklisted</h1>
<%= link_to "Hidden", "#" %>
<ul>
</ul>
</section>
<section id="tag-and-wiki-box">
<menu>
<li><h1><a href="#tag-box">Tags</a></h1></li>
<% unless @post_set.tags.blank? %>
<li><h1><a href="#wiki-box">Wiki</a></h1></li>
<% end %>
<option value="unapprove">Unapprove</option>
</select>
</form>
</section>
<% end %>
</menu>
<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>
<div id="tag-box">
<h2>Tags</h2>
<%= @post_set.presenter.tag_list_html(self) %>
</div>
<div id="wiki-box">
<h2>Wiki</h2>
<%= @post_set.presenter.wiki_html(self) %>
</div>
</section>
</aside>
<section class="content">
<h1>Posts</h1>
<%= @post_set.presenter.post_previews_html %>
<div class="clearfix"></div>
<section id="tag-box">
<h2>Tags</h2>
<%= @post_set.presenter.tag_list_html %>
<div class="paginator">
<%= @post_set.presenter.pagination_html(self) %>
</div>
</section>
<section id="wiki-box">
<h2>Wiki</h2>
<%= @post_set.presenter.wiki_html(self) %>
</section>
<% content_for(:page_title) do %>
/ <%= @post_set.tags %>
<% end %>
<%= render :partial => "posts/partials/common/secondary_links" %>
</div>
</aside>
</div>
<section>
<h1>Posts</h1>
<%= @post_set.presenter.post_previews_html %>
</section>
<footer>
<%= @post_set.presenter.pagination_html(self) %>
</footer>
<% content_for(:page_title) do %>
/ <%= @post_set.tags %>
<% end %>
<%= render :partial => "posts/partials/common/secondary_links" %>

View File

@@ -5,46 +5,54 @@
</div>
<% end %>
<% form_for(post) do |f| %>
<% form_for(post, :html => {:class => "simple_form"}) do |f| %>
<%= f.hidden_field :old_tags, :value => post.tag_string %>
<p>
<div class="input">
<% if post.is_rating_locked? %>
This post is rating locked.
<% else %>
<%= f.label :rating_explicit, "Explicit" %>
<%= f.radio_button :rating, :e %>
<%= f.label :rating_questionable, "Questionable" %>
<%= f.radio_button :rating, :q %>
<%= f.label :blank, "Rating" %>
<fieldset class="ratings">
<%= f.radio_button :rating, :e %>
<%= f.label :rating_e, "Explicit" %>
<%= f.label :rating_safe, "Safe" %>
<%= f.radio_button :rating, :s %>
<%= f.radio_button :rating, :q %>
<%= f.label :rating_q, "Questionable" %>
<%= f.radio_button :rating, :s %>
<%= f.label :rating_s, "Safe" %>
</fieldset>
<% end %>
</p>
</div>
<% if CurrentUser.user.is_privileged? %>
<p>
<%= f.label :is_note_locked, "Lock notes" %>
<%= f.check_box :is_note_locked %>
</p>
<p>
<%= f.label :is_rating_locked, "Lock rating" %>
<%= f.check_box :is_rating_locked %>
</p>
<div class="input">
<%= f.label :blank, "Lock" %>
<fieldset class="locks">
<%= f.check_box :is_note_locked %>
<%= f.label :is_note_locked, "Notes" %>
<%= f.check_box :is_rating_locked %>
<%= f.label :is_rating_locked, "Rating" %>
</fieldset>
</div>
<% end %>
<p>
<div class="input">
<%= f.label :source %>
<%= f.text_field :source %>
</p>
</div>
<p>
<div class="input">
<%= f.label :tag_string, "Tags" %>
<%= f.text_area :tag_string , :size => "50x3" %>
</p>
</div>
<%= submit_tag "Submit" %>
<div class="input">
<%= submit_tag "Submit" %>
</div>
<% end %>
</div>

View File

@@ -1,5 +1,4 @@
<ul>
<li>ID: <%= post.id %></li>
<li>Uploader: <%= link_to_unless(post.uploader.nil?, post.uploader_name, user_path(post.uploader)) %></li>
<li>Uploaded: <%= time_ago_in_words(post.created_at).gsub(/about/, "") %> ago</li>
<% if post.approver %>

View File

@@ -1,48 +1,58 @@
<aside class="sidebar">
<section>
<h1>Search</h1>
<%= render :partial => "posts/partials/common/search" %>
</section>
<section>
<h1>Tags</h1>
<%= @post.presenter.tag_list_html(self) %>
</section>
<section>
<h1>Information</h1>
<%= render :partial => "posts/partials/show/information", :locals => {:post => @post} %>
</section>
<div class="posts">
<div class="show">
<aside id="sidebar">
<section>
<h1>Search</h1>
<%= render :partial => "posts/partials/common/search" %>
</section>
<section>
<h1>Options</h1>
<%= render :partial => "posts/partials/show/options", :locals => {:post => @post} %>
</section>
</aside>
<section>
<h1>Tags</h1>
<%= @post.presenter.tag_list_html(self) %>
</section>
<section>
<h1>Post</h1>
<section>
<h2>Image</h2>
<%= @post.presenter.image_html(self) %>
</section>
<section>
<h2>Notes</h2>
<%= render :partial => "notes/note", :collection => @post.notes.active %>
</section>
<section>
<h2>Comments</h2>
<%= render :partial => "comments/partials/index/list", :locals => {:comments => @post.comments, :post => @post} %>
</section>
<section>
<h2>Edit</h2>
<%= render :partial => "posts/partials/show/edit", :locals => {:post => @post} %>
</section>
</section>
<section>
<h1>Information</h1>
<%= render :partial => "posts/partials/show/information", :locals => {:post => @post} %>
</section>
<section>
<h1>Options</h1>
<%= render :partial => "posts/partials/show/options", :locals => {:post => @post} %>
</section>
</aside>
<section id="content">
<h1>Post</h1>
<section id="image">
<h2>Image</h2>
<%= @post.presenter.image_html(self) %>
</section>
<menu id="post-sections">
<li><a href="#comments">Comments</a></li>
<li><a href="#notes">Notes</a></li>
<li><a href="#edit">Edit</a></li>
</menu>
<section id="comments">
<h2>Comments</h2>
<%= render :partial => "comments/partials/index/list", :locals => {:comments => @post.comments, :post => @post} %>
</section>
<section id="notes">
<h2>Notes</h2>
<%= render :partial => "notes/note", :collection => @post.notes.active %>
</section>
<section id="edit">
<h2>Edit</h2>
<%= render :partial => "posts/partials/show/edit", :locals => {:post => @post} %>
</section>
</section>
</div>
</div>
<% content_for(:page_title) do %>
/ <%= @post.tag_string %>

View File

@@ -21,4 +21,4 @@
</tbody>
</table>
<%= render :partial => "posts/common_secondary_nav_links" %>
<%= render :partial => "posts/partials/common/secondary_links" %>

View File

@@ -1,56 +1,60 @@
<div id="upload-guide-notice">
<p>Before uploading, please read the <%= link_to "how to upload guide", wiki_page_path("howto:upload") %>. It explains how to tag and what ratings are.</p>
</div>
<% form_for(@upload, :html => {:multipart => true}) do |f| %>
<% if params[:url] %>
<div id="image-preview">
<%= image_tag(params[:url], :title => "Preview") %>
<p id="scale"></p>
<div class="uploads">
<div class="new">
<div id="upload-guide-notice">
<p>Before uploading, please read the <%= link_to "how to upload guide", wiki_pages_path(:title => "howto:upload") %>.</p>
</div>
<% if @post %>
<p>This post was probably already uploaded (<%= link_to "post ##{@post.id}", posts_path(@post), :target => "_blank" %>).</p>
<% form_for(@upload, :html => {:multipart => true, :class => "simple_form"}) do |f| %>
<% if params[:url] %>
<div id="image-preview">
<%= image_tag(params[:url], :title => "Preview") %>
<p id="scale"></p>
</div>
<% if @post %>
<p>This post was probably already uploaded (<%= link_to "post ##{@post.id}", posts_path(@post), :target => "_blank" %>).</p>
<% end %>
<% end %>
<div class="input">
<%= f.label :file %>
<%= f.file_field :file, :size => 50 %>
</div>
<div class="input">
<%= f.label :source, nil, :title => "You can enter a URL to have #{Danbooru.config.app_name} automatically download and process it" %>
<%= f.text_field :source, :size => 50, :value => params[:url] %>
</div>
<div class="input">
<%= f.label :rating_q, "Rating" %>
<fieldset class="ratings">
<%= f.radio_button :rating, :e %>
<%= f.label :rating_e, "Explicit", :title => "Hardcore porn, visible genitals, gore" %>
<%= f.radio_button :rating, :q %>
<%= f.label :rating_q, "Questionable", :title => "Nudity, anything erotic" %>
<%= f.radio_button :rating, :s %>
<%= f.label :rating_s, "Safe", :title => "Everything else" %>
</fieldset>
</div>
<div class="input">
<%= f.label :tag_string, "Tags" %>
<%= f.text_area :tag_string, :size => "60x4" %>
</div>
<div class="input">
<%= submit_tag "Submit" %>
</div>
<% end %>
<% end %>
<fieldset>
<legend>Upload</legend>
<p>
<%= f.label :file %>
<%= f.file_field :file, :size => 50 %>
</p>
<p>
<%= f.label :source, nil, :title => "You can enter a URL to have #{Danbooru.config.app_name} automatically download and process it" %>
<%= f.text_field :source, :size => 50, :value => params[:url] %>
</p>
<p>
<%= f.label :tag_string, "Tags" %>
<%= f.text_area :tag_string, :size => "60x4" %>
</p>
<p>
<%= f.label :rating_e, "Explicit", :title => "Hardcore porn, visible genitals, gore" %>
<%= f.radio_button :rating, :e %>
<%= f.label :rating_q, "Questionable", :title => "Nudity, anything erotic" %>
<%= f.radio_button :rating, :q %>
<%= f.label :rating_s, "Safe", :title => "Everything else" %>
<%= f.radio_button :rating, :s %>
</p>
<p>
<%= submit_tag "Submit" %>
</p>
</fieldset>
<% end %>
</div>
</div>
<% content_for(:page_title) do %>
/ Upload
<% end %>
<%= render :partial => "posts/common_secondary_nav_links" %>
<%= render :partial => "posts/partials/common/secondary_links" %>

View File

@@ -21,4 +21,4 @@
<% end %>
</p>
<%= render :partial => "posts/common_secondary_nav_links" %>
<%= render :partial => "posts/partials/common/secondary_links" %>