diff options
author | re4k <re4k@re4k.info> | 2013-03-19 01:47:22 +0900 |
---|---|---|
committer | re4k <re4k@re4k.info> | 2013-03-19 01:48:52 +0900 |
commit | 5227f1b8c7dae086d14a5b6f8251ac63fec93c44 (patch) | |
tree | 726937a8b0cae476ea21943cc57ea7f6fd6db3ea /app/views/shared | |
parent | 98e49ee3308759913477338be95ca07b781355f0 (diff) | |
download | aclog-5227f1b8c7dae086d14a5b6f8251ac63fec93c44.tar.gz |
Minor changes
Diffstat (limited to 'app/views/shared')
-rw-r--r-- | app/views/shared/_tweet.haml | 25 | ||||
-rw-r--r-- | app/views/shared/_tweets.haml | 2 |
2 files changed, 16 insertions, 11 deletions
diff --git a/app/views/shared/_tweet.haml b/app/views/shared/_tweet.haml index d4edec6..8576466 100644 --- a/app/views/shared/_tweet.haml +++ b/app/views/shared/_tweet.haml @@ -1,31 +1,36 @@ .item .tweet .avatar - - user = u(item) - = link_to image_tag(user.profile_image_url), user_url(user), :title => user.name + = link_to image_tag(item.user.profile_image_url, :alt => item.user.screen_name, :title => item.user.name), :controller => "users", :action => "best", :screen_name => item.user.screen_name .tweet_content_fix .tweet_content .user %span.name - = link_to user.name, user_url(user) + = link_to item.user.name, :controller => "users", :action => "best", :screen_name => item.user.screen_name %span.screen_name - = link_to "@#{user.screen_name}", user_url(user) + = link_to "@#{item.user.screen_name}", :controller => "users", :action => "best", :screen_name => item.user.screen_name .text = raw format_tweet_text(item.text) .meta.clearfix - = link_to image_tag("bird_gray_16.png"), twitter_status_url(item), :target => "_blank", :class => "twitter_bird" - = link_to format_tweet_created_at(item.tweeted_at), status_url(item), :class => "created_at" + %span.twitter_bird + = link_to image_tag("bird_gray_16.png", :alt => "Twitter"), twitter_status_url(item), :target => "_blank" + %span.created_at + = link_to format_tweet_created_at(item.tweeted_at), :controller => "i", :action => "show", :id => item.id %span.source = raw format_source_text(item.source) .stats - - [["FAVS", favoriters(item), "favs"], ["RETWEETS", retweeters(item), "retweets"]].each do |type, users, cssclass| + - [["FAVS", item.favorites, "favs"], ["RETWEETS", item.retweets, "retweets"]].select{|m| m[1].size > 0}.each do |type, actions, cssclass| %div{:class => "#{cssclass} clearfix"} .info - %span.count= users.size + %span.count= actions.size %span.type= type .height_fix %ul.favoriters.clearfix - - users.each do |m| + - actions.take(params[:controller] == "i" && params[:action] == "show" ? actions.size : 20).each do |a| | + - m = a.user || User.new %li - = link_to image_tag(m.profile_image_url), user_url(m), :title => m.name + - if m.screen_name + = link_to image_tag(m.profile_image_url, :alt => m.screen_name, :title => m.name), :controller => "users", :action => "best", :screen_name => m.screen_name + - else + = image_tag(m.profile_image_url, :alt => m.name, :title => m.name) diff --git a/app/views/shared/_tweets.haml b/app/views/shared/_tweets.haml index 7dfb14b..681b9cc 100644 --- a/app/views/shared/_tweets.haml +++ b/app/views/shared/_tweets.haml @@ -1,4 +1,4 @@ .items - = render :partial => "shared/tweet", :collection => items, :as => :item + = render :partial => "shared/tweet", :collection => items, :as => :item, :local => {:showallusers => @showallusers} - if items.size > 0 = paginate items |