Mercurial > rsstweet
annotate app/views/tweets/_tweet.html.erb @ 170:05ce14af003a
port can't be part of the id
author | nanaya <me@nanaya.pro> |
---|---|
date | Wed, 08 Aug 2018 20:19:41 +0900 |
parents | 04ca6c4f11d0 |
children | df4be896ab8b |
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 |
131 | 6 <%= render "tweet", :tweet => tweet.retweeted_status, :with_time => true %> |
64
a20bbd1e2dc1
Now with avatar and proper retweet styling and stuff
nanaya <me@myconan.net>
parents:
62
diff
changeset
|
7 <% else%> |
132 | 8 <% if defined?(with_time) && with_time %> |
131 | 9 <p> |
10 <small>Originally tweeted at <%= tweet.created_at.to_s :rfc822 %></small> | |
11 </p> | |
12 <% end %> | |
13 | |
64
a20bbd1e2dc1
Now with avatar and proper retweet styling and stuff
nanaya <me@myconan.net>
parents:
62
diff
changeset
|
14 <p> |
100 | 15 <%# 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
|
16 <%= auto_link(expand_url( |
125 | 17 tweet.attrs[:full_text].printable, |
103
1251b3d6ec5d
Use included url data instead of expanding using embiggen
nanaya <me@myconan.net>
parents:
100
diff
changeset
|
18 tweet.attrs[:entities][:urls], |
1251b3d6ec5d
Use included url data instead of expanding using embiggen
nanaya <me@myconan.net>
parents:
100
diff
changeset
|
19 tweet.attrs[:entities][:media] |
1251b3d6ec5d
Use included url data instead of expanding using embiggen
nanaya <me@myconan.net>
parents:
100
diff
changeset
|
20 )) |
169 | 21 .gsub("\n", "<br />") |
103
1251b3d6ec5d
Use included url data instead of expanding using embiggen
nanaya <me@myconan.net>
parents:
100
diff
changeset
|
22 .html_safe |
1251b3d6ec5d
Use included url data instead of expanding using embiggen
nanaya <me@myconan.net>
parents:
100
diff
changeset
|
23 %> |
79 | 24 </p> |
25 | |
26 <p> | |
64
a20bbd1e2dc1
Now with avatar and proper retweet styling and stuff
nanaya <me@myconan.net>
parents:
62
diff
changeset
|
27 <%= link_to "https://twitter.com/#{tweet.user.screen_name}" do %> |
150
950849c40d42
Update all the things, including rails 5.2
nanaya <me@nanaya.pro>
parents:
132
diff
changeset
|
28 <%= image_tag tweet.user.profile_image_url_https.to_s, :alt => "profile image for #{tweet.user.name.printable}" %> |
125 | 29 <%= tweet.user.name.printable -%> |
64
a20bbd1e2dc1
Now with avatar and proper retweet styling and stuff
nanaya <me@myconan.net>
parents:
62
diff
changeset
|
30 <% end %> |
75
585952f98978
Put the tweet on different paragraph
nanaya <me@myconan.net>
parents:
65
diff
changeset
|
31 </p> |
64
a20bbd1e2dc1
Now with avatar and proper retweet styling and stuff
nanaya <me@myconan.net>
parents:
62
diff
changeset
|
32 |
75
585952f98978
Put the tweet on different paragraph
nanaya <me@myconan.net>
parents:
65
diff
changeset
|
33 <p> |
126 | 34 <% tweet.media.each_with_index do |media, i| %> |
64
a20bbd1e2dc1
Now with avatar and proper retweet styling and stuff
nanaya <me@myconan.net>
parents:
62
diff
changeset
|
35 <% 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
|
36 <%= link_to "#{media.media_url_https}:orig" do %> |
126 | 37 <%= image_tag "#{media.media_url_https}:small", :alt => "attachment #{i + 1}" -%> |
64
a20bbd1e2dc1
Now with avatar and proper retweet styling and stuff
nanaya <me@myconan.net>
parents:
62
diff
changeset
|
38 <% end %> |
154 | 39 <% elsif media.is_a? Twitter::Media::Video %> |
167 | 40 <%= video_tag media.video_info.variants.map(&:url), width: '100%', controls: true %> |
62
9ab79a764434
Sweet tweet media viewer (image only for now)
nanaya <me@myconan.net>
parents:
diff
changeset
|
41 <% end %> |
9ab79a764434
Sweet tweet media viewer (image only for now)
nanaya <me@myconan.net>
parents:
diff
changeset
|
42 <% end %> |
64
a20bbd1e2dc1
Now with avatar and proper retweet styling and stuff
nanaya <me@myconan.net>
parents:
62
diff
changeset
|
43 </p> |
62
9ab79a764434
Sweet tweet media viewer (image only for now)
nanaya <me@myconan.net>
parents:
diff
changeset
|
44 |
64
a20bbd1e2dc1
Now with avatar and proper retweet styling and stuff
nanaya <me@myconan.net>
parents:
62
diff
changeset
|
45 <% if tweet.quoted_status.present? %> |
a20bbd1e2dc1
Now with avatar and proper retweet styling and stuff
nanaya <me@myconan.net>
parents:
62
diff
changeset
|
46 <blockquote> |
131 | 47 <%= render "tweet", :tweet => tweet.quoted_status, :with_time => true %> |
64
a20bbd1e2dc1
Now with avatar and proper retweet styling and stuff
nanaya <me@myconan.net>
parents:
62
diff
changeset
|
48 </blockquote> |
a20bbd1e2dc1
Now with avatar and proper retweet styling and stuff
nanaya <me@myconan.net>
parents:
62
diff
changeset
|
49 <% end %> |
62
9ab79a764434
Sweet tweet media viewer (image only for now)
nanaya <me@myconan.net>
parents:
diff
changeset
|
50 <% end %> |