fixed jrails, fixed deprecation warnings

This commit is contained in:
albert
2010-10-27 13:40:50 -04:00
parent a9da0f1059
commit 484ff696e2
16 changed files with 119 additions and 99 deletions

View File

@@ -83,7 +83,7 @@ class PixivProxy
mech = WWW::Mechanize.new
mech.get("http://www.pixiv.net") do |page|
page.form_with(:action => "index.php") do |form|
page.form_with(:action => "login.php") do |form|
form.pixiv_id = "uroobnad"
form.pass = "uroobnad556"
end.click_button

View File

@@ -1,7 +1,8 @@
%div{:class => "comments"}
%div{:class => "index"}
- @posts.each do |post|
%div{:class => "preview"}
= image_tag(post.medium_file_url)
= render :partial => "comments/partials/index/list", :locals => {:post => post, :comments => post.comments}
%div{:class => "clearfix"}
%div{:class => "post"}
%div{:class => "preview"}
= image_tag(post.preview_file_url)
= render :partial => "comments/partials/index/list", :locals => {:post => post, :comments => post.comments.recent.reverse}
%div{:class => "clearfix"}

View File

@@ -0,0 +1,43 @@
%div{:class => "header"}
%div{:class => "row"}
%span{:class => "info"}
%time Date
= compact_time(post.created_at)
%span{:class => "info"}
%strong User
= link_to(post.uploader_name, user_path(post.uploader_id))
%span{:class => "info"}
%strong Rating
= post.rating
%span{:class => "info"}
%strong Score
%span{:id => "score-for-post-#{post.id}"}
= post.score
<div class="header">
<div>
<span class="info"><strong>Date</strong> <%= compact_time(post.created_at) %></span>
<span class="info"><strong>User</strong> <%= fast_link_to h(post.author), :controller => "user", :action => "show", :id => post.user_id %></span>
<span class="info"><strong>Rating</strong> <%= post.pretty_rating %></span>
<span class="info">
<strong>Score</strong> <span id="post-score-<%= post.id %>"><%= post.score %></span>
<% if @current_user.is_privileged_or_higher? %>
(vote <%= link_to_function "up", "Post.vote(1, #{post.id})" %>/<%= link_to_function "down", "Post.vote(-1, #{post.id})" %>)
<% end %>
</span>
</div>
<div class="tags">
<strong>Tags</strong>
<% post.cached_tags.split(/ /).each do |name| %>
<span class="tag-type-<%= Tag.type_name(name) %>">
<%= fast_link_to h(name.tr("_", " ")), :controller => "post", :action => "index", :tags => name %>
</span>
<% end %>
</div>
<div style="margin-top: 1em;">
<% if post.comments.count > 6 %>
<span class="info" id="hidden-comments-notice-for-<%= post.id %>"><%= link_to_remote "#{pluralize post.comments.size - 6, 'comment'} hidden", :url => {:controller => "comment", :action => "index_hidden", :post_id => post.id} %>.</span>
<% end %>
<%= render :partial => "threshold_notice", :locals => {:post => post} %>

View File

@@ -1,6 +1,7 @@
%div{:class => "comments-for-post", "data-post-id" => post.id}
%div{:class => "list-of-comments"}
= render :partial => "comments/partials/show/comment", :collection => comments
%div{:class => "clearfix"}
%div{:class => "new-comment"}
%p= link_to "Post comment", new_comment_path, :class => "expand-comment-response"
= render :partial => "comments/partials/new/form", :locals => {:post => post}

View File

@@ -0,0 +1,3 @@
<% if post.hidden_comment_count(@current_user) > 0 %>
<span class="info" id="threshold-comments-notice-for-<%= post.id %>"><%= link_to_remote "#{pluralize post.hidden_comment_count(@current_user), 'comment'} below threshold", :url => {:controller => "comment", :action => "index_all", :post_id => post.id} %>.</span>
<% end %>