annotate app/views/tweets/_tweet.html.erb @ 115:c712d307e197

Gem updates
author nanaya <me@myconan.net>
date Sun, 12 Feb 2017 16:46:26 +0900
parents 1251b3d6ec5d
children 61414d0a367b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
64
a20bbd1e2dc1 Now with avatar and proper retweet styling and stuff
nanaya <me@myconan.net>
parents: 62
diff changeset
1 <% if tweet.retweeted_status.present? %>
a20bbd1e2dc1 Now with avatar and proper retweet styling and stuff
nanaya <me@myconan.net>
parents: 62
diff changeset
2 <p>
a20bbd1e2dc1 Now with avatar and proper retweet styling and stuff
nanaya <me@myconan.net>
parents: 62
diff changeset
3 <em>Retweeted:</em>
a20bbd1e2dc1 Now with avatar and proper retweet styling and stuff
nanaya <me@myconan.net>
parents: 62
diff changeset
4 </p>
62
9ab79a764434 Sweet tweet media viewer (image only for now)
nanaya <me@myconan.net>
parents:
diff changeset
5
64
a20bbd1e2dc1 Now with avatar and proper retweet styling and stuff
nanaya <me@myconan.net>
parents: 62
diff changeset
6 <%= render "tweet", :tweet => tweet.retweeted_status %>
a20bbd1e2dc1 Now with avatar and proper retweet styling and stuff
nanaya <me@myconan.net>
parents: 62
diff changeset
7 <% else%>
a20bbd1e2dc1 Now with avatar and proper retweet styling and stuff
nanaya <me@myconan.net>
parents: 62
diff changeset
8 <p>
100
c1d5d8be92c6 Add support for extended tweets
nanaya <me@myconan.net>
parents: 98
diff changeset
9 <%# FIXME: Twitter gem doesn't support extended mode when writing this %>
103
1251b3d6ec5d Use included url data instead of expanding using embiggen
nanaya <me@myconan.net>
parents: 100
diff changeset
10 <%= auto_link(expand_url(
1251b3d6ec5d Use included url data instead of expanding using embiggen
nanaya <me@myconan.net>
parents: 100
diff changeset
11 tweet.attrs[:full_text],
1251b3d6ec5d Use included url data instead of expanding using embiggen
nanaya <me@myconan.net>
parents: 100
diff changeset
12 tweet.attrs[:entities][:urls],
1251b3d6ec5d Use included url data instead of expanding using embiggen
nanaya <me@myconan.net>
parents: 100
diff changeset
13 tweet.attrs[:entities][:media]
1251b3d6ec5d Use included url data instead of expanding using embiggen
nanaya <me@myconan.net>
parents: 100
diff changeset
14 ))
1251b3d6ec5d Use included url data instead of expanding using embiggen
nanaya <me@myconan.net>
parents: 100
diff changeset
15 .gsub("\n", "<br>")
1251b3d6ec5d Use included url data instead of expanding using embiggen
nanaya <me@myconan.net>
parents: 100
diff changeset
16 .html_safe
1251b3d6ec5d Use included url data instead of expanding using embiggen
nanaya <me@myconan.net>
parents: 100
diff changeset
17 %>
79
04ccd0632a71 Move user info to bottom
nanaya <me@myconan.net>
parents: 75
diff changeset
18 </p>
04ccd0632a71 Move user info to bottom
nanaya <me@myconan.net>
parents: 75
diff changeset
19
04ccd0632a71 Move user info to bottom
nanaya <me@myconan.net>
parents: 75
diff changeset
20 <p>
64
a20bbd1e2dc1 Now with avatar and proper retweet styling and stuff
nanaya <me@myconan.net>
parents: 62
diff changeset
21 <%= link_to "https://twitter.com/#{tweet.user.screen_name}" do %>
a20bbd1e2dc1 Now with avatar and proper retweet styling and stuff
nanaya <me@myconan.net>
parents: 62
diff changeset
22 <%= image_tag tweet.user.profile_image_url_https %>
a20bbd1e2dc1 Now with avatar and proper retweet styling and stuff
nanaya <me@myconan.net>
parents: 62
diff changeset
23 <%= tweet.user.name -%>
a20bbd1e2dc1 Now with avatar and proper retweet styling and stuff
nanaya <me@myconan.net>
parents: 62
diff changeset
24 <% end %>
75
585952f98978 Put the tweet on different paragraph
nanaya <me@myconan.net>
parents: 65
diff changeset
25 </p>
64
a20bbd1e2dc1 Now with avatar and proper retweet styling and stuff
nanaya <me@myconan.net>
parents: 62
diff changeset
26
75
585952f98978 Put the tweet on different paragraph
nanaya <me@myconan.net>
parents: 65
diff changeset
27 <p>
64
a20bbd1e2dc1 Now with avatar and proper retweet styling and stuff
nanaya <me@myconan.net>
parents: 62
diff changeset
28 <% tweet.media.each do |media| %>
a20bbd1e2dc1 Now with avatar and proper retweet styling and stuff
nanaya <me@myconan.net>
parents: 62
diff changeset
29 <% if media.is_a? Twitter::Media::Photo %>
a20bbd1e2dc1 Now with avatar and proper retweet styling and stuff
nanaya <me@myconan.net>
parents: 62
diff changeset
30 <%= link_to "#{media.media_url_https}:orig" do %>
a20bbd1e2dc1 Now with avatar and proper retweet styling and stuff
nanaya <me@myconan.net>
parents: 62
diff changeset
31 <%= image_tag "#{media.media_url_https}:small" -%>
a20bbd1e2dc1 Now with avatar and proper retweet styling and stuff
nanaya <me@myconan.net>
parents: 62
diff changeset
32 <% end %>
62
9ab79a764434 Sweet tweet media viewer (image only for now)
nanaya <me@myconan.net>
parents:
diff changeset
33 <% end %>
9ab79a764434 Sweet tweet media viewer (image only for now)
nanaya <me@myconan.net>
parents:
diff changeset
34 <% end %>
64
a20bbd1e2dc1 Now with avatar and proper retweet styling and stuff
nanaya <me@myconan.net>
parents: 62
diff changeset
35 </p>
62
9ab79a764434 Sweet tweet media viewer (image only for now)
nanaya <me@myconan.net>
parents:
diff changeset
36
64
a20bbd1e2dc1 Now with avatar and proper retweet styling and stuff
nanaya <me@myconan.net>
parents: 62
diff changeset
37 <% if tweet.quoted_status.present? %>
a20bbd1e2dc1 Now with avatar and proper retweet styling and stuff
nanaya <me@myconan.net>
parents: 62
diff changeset
38 <blockquote>
a20bbd1e2dc1 Now with avatar and proper retweet styling and stuff
nanaya <me@myconan.net>
parents: 62
diff changeset
39 <%= render "tweet", :tweet => tweet.quoted_status %>
a20bbd1e2dc1 Now with avatar and proper retweet styling and stuff
nanaya <me@myconan.net>
parents: 62
diff changeset
40 </blockquote>
a20bbd1e2dc1 Now with avatar and proper retweet styling and stuff
nanaya <me@myconan.net>
parents: 62
diff changeset
41 <% end %>
62
9ab79a764434 Sweet tweet media viewer (image only for now)
nanaya <me@myconan.net>
parents:
diff changeset
42 <% end %>