aboutsummaryrefslogtreecommitdiffstats
path: root/app/views/tweets/_tweet_stats.html.haml
blob: d25367db80b17997393b154616928b7d7cefbaff (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
.status-responses
  - [["Favs", tweet.favorites_count, tweet.favoriters], ["RTs", tweet.retweets_count, tweet.retweeters]].each do |title, count, users|
    - if count > 0
      - if authorized_to_show_user?(tweet.user)
        %dl
          %dt
            = link_to tweet_path(tweet.id, full: true) do
              %span>= count
              = title
          %dd{class: params[:action] != "show" ? "timeline" : ""}
            %ul
              - users.limit(favorites_truncate_count).each do |m|
                %li
                  - if !m.protected? || (logged_in? && (m.id == current_user.id || tweet.user.id == current_user.id))
                    %a{href: user_path(m.screen_name), title: "#{m.name} (@#{m.screen_name})"}
                      %img{alt: "@" + m.screen_name, src: m.profile_image_url}
                  - else
                    %a{href: "#", title: "Protected User"}
                      %img{alt: "Protected User", src: image_path("protected_profile_image.png")}
      - else
        %dl
          %dt
            = link_to "#" do
              %span>= count
              = title
          %dd{class: params[:action] != "show" ? "timeline" : ""}