aboutsummaryrefslogtreecommitdiffstats
path: root/app/views/shared/_tweet.html.haml
blob: 3f76f1a901f35582a314c5de9194b64f94b0b934 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
.item
  .tweet
    .avatar
      = 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 item.user.name, :controller => "users", :action => "best", :screen_name => item.user.screen_name
        %span.screen_name
          = 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
        %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 => "users", :action => "show", :id => item.id
        %span.source
          = raw format_source_text(item.source)
  .stats
    - [["favs", item.favorites.order("id")], ["retweets", item.retweets.order("id")]].select{|m| m[1].count > 0}.each do |type, actions|
      %dl.dl-horizontal
        %dt
          %span.count= actions.count
          %span.type= type
        %dd
          %ul.inline
            - actions.take(params[:action] == "show" ? actions.count : 20).each do |a|
            - m = a.user
              %li
                - if m
                  = 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 asset_path("missing_profile_image.png"), :alt => "Missing User: #{a.user_id}", :title => "Missing User: #{a.user_id}"