Mercurial > rsstweet
annotate app/views/tweets/_tweet.html.erb @ 229:12287b32fbda
Show link to parent tweet for replies
author | nanaya <me@nanaya.pro> |
---|---|
date | Wed, 13 Apr 2022 01:49:51 +0900 |
parents | ad6264cca788 |
children | 7a773720d81f |
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> |
204 | 3 <%= link_to status_url(tweet.retweeted_status) do %> |
190 | 4 <em>Retweeted:</em> |
5 <% end %> | |
64
a20bbd1e2dc1
Now with avatar and proper retweet styling and stuff
nanaya <me@myconan.net>
parents:
62
diff
changeset
|
6 </p> |
62
9ab79a764434
Sweet tweet media viewer (image only for now)
nanaya <me@myconan.net>
parents:
diff
changeset
|
7 |
131 | 8 <%= 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
|
9 <% else%> |
132 | 10 <% if defined?(with_time) && with_time %> |
131 | 11 <p> |
223 | 12 <small>Originally tweeted at <%= tweet.created_at.rfc822 %></small> |
131 | 13 </p> |
14 <% end %> | |
15 | |
229
12287b32fbda
Show link to parent tweet for replies
nanaya <me@nanaya.pro>
parents:
223
diff
changeset
|
16 <% if tweet.in_reply_to_status_id.present? %> |
12287b32fbda
Show link to parent tweet for replies
nanaya <me@nanaya.pro>
parents:
223
diff
changeset
|
17 <p> |
12287b32fbda
Show link to parent tweet for replies
nanaya <me@nanaya.pro>
parents:
223
diff
changeset
|
18 <small> |
12287b32fbda
Show link to parent tweet for replies
nanaya <me@nanaya.pro>
parents:
223
diff
changeset
|
19 Replying to |
12287b32fbda
Show link to parent tweet for replies
nanaya <me@nanaya.pro>
parents:
223
diff
changeset
|
20 <%= link_to 'tweet', status_url_base(tweet.in_reply_to_screen_name, tweet.in_reply_to_status_id) %> |
12287b32fbda
Show link to parent tweet for replies
nanaya <me@nanaya.pro>
parents:
223
diff
changeset
|
21 by <%= link_to tweet.in_reply_to_screen_name, "https://twitter.com/#{tweet.in_reply_to_screen_name}" %> |
12287b32fbda
Show link to parent tweet for replies
nanaya <me@nanaya.pro>
parents:
223
diff
changeset
|
22 </small> |
12287b32fbda
Show link to parent tweet for replies
nanaya <me@nanaya.pro>
parents:
223
diff
changeset
|
23 </p> |
12287b32fbda
Show link to parent tweet for replies
nanaya <me@nanaya.pro>
parents:
223
diff
changeset
|
24 <% end %> |
12287b32fbda
Show link to parent tweet for replies
nanaya <me@nanaya.pro>
parents:
223
diff
changeset
|
25 |
64
a20bbd1e2dc1
Now with avatar and proper retweet styling and stuff
nanaya <me@myconan.net>
parents:
62
diff
changeset
|
26 <p> |
100 | 27 <%# FIXME: Twitter gem doesn't support extended mode when writing this %> |
174
d35dbc09bd83
Less double escaping for actual content
nanaya <me@nanaya.pro>
parents:
172
diff
changeset
|
28 <%= auto_link(expand_url( |
d35dbc09bd83
Less double escaping for actual content
nanaya <me@nanaya.pro>
parents:
172
diff
changeset
|
29 tweet.full_text_extended, |
103
1251b3d6ec5d
Use included url data instead of expanding using embiggen
nanaya <me@myconan.net>
parents:
100
diff
changeset
|
30 tweet.attrs[:entities][:urls], |
1251b3d6ec5d
Use included url data instead of expanding using embiggen
nanaya <me@myconan.net>
parents:
100
diff
changeset
|
31 tweet.attrs[:entities][:media] |
174
d35dbc09bd83
Less double escaping for actual content
nanaya <me@nanaya.pro>
parents:
172
diff
changeset
|
32 )) |
169 | 33 .gsub("\n", "<br />") |
103
1251b3d6ec5d
Use included url data instead of expanding using embiggen
nanaya <me@myconan.net>
parents:
100
diff
changeset
|
34 .html_safe |
1251b3d6ec5d
Use included url data instead of expanding using embiggen
nanaya <me@myconan.net>
parents:
100
diff
changeset
|
35 %> |
79 | 36 </p> |
37 | |
38 <p> | |
64
a20bbd1e2dc1
Now with avatar and proper retweet styling and stuff
nanaya <me@myconan.net>
parents:
62
diff
changeset
|
39 <%= 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
|
40 <%= image_tag tweet.user.profile_image_url_https.to_s, :alt => "profile image for #{tweet.user.name.printable}" %> |
125 | 41 <%= tweet.user.name.printable -%> |
64
a20bbd1e2dc1
Now with avatar and proper retweet styling and stuff
nanaya <me@myconan.net>
parents:
62
diff
changeset
|
42 <% end %> |
75
585952f98978
Put the tweet on different paragraph
nanaya <me@myconan.net>
parents:
65
diff
changeset
|
43 </p> |
64
a20bbd1e2dc1
Now with avatar and proper retweet styling and stuff
nanaya <me@myconan.net>
parents:
62
diff
changeset
|
44 |
75
585952f98978
Put the tweet on different paragraph
nanaya <me@myconan.net>
parents:
65
diff
changeset
|
45 <p> |
126 | 46 <% 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
|
47 <% if media.is_a? Twitter::Media::Photo %> |
201
40c828f83657
Using query string seems to be a bit more stable now?
nanaya <me@nanaya.pro>
parents:
190
diff
changeset
|
48 <%= link_to "#{media.media_url_https}?name=orig" do %> |
40c828f83657
Using query string seems to be a bit more stable now?
nanaya <me@nanaya.pro>
parents:
190
diff
changeset
|
49 <%= image_tag "#{media.media_url_https}?name=small", :alt => "attachment #{i + 1}" -%> |
64
a20bbd1e2dc1
Now with avatar and proper retweet styling and stuff
nanaya <me@myconan.net>
parents:
62
diff
changeset
|
50 <% end %> |
154 | 51 <% elsif media.is_a? Twitter::Media::Video %> |
178 | 52 <%= video_tag media.video_info.variants |
53 .select { |i| i.bitrate.is_a? Integer } | |
54 .sort_by { |i| -i.bitrate } | |
55 .map(&:url), width: '100%', controls: true | |
56 %> | |
62
9ab79a764434
Sweet tweet media viewer (image only for now)
nanaya <me@myconan.net>
parents:
diff
changeset
|
57 <% end %> |
9ab79a764434
Sweet tweet media viewer (image only for now)
nanaya <me@myconan.net>
parents:
diff
changeset
|
58 <% end %> |
64
a20bbd1e2dc1
Now with avatar and proper retweet styling and stuff
nanaya <me@myconan.net>
parents:
62
diff
changeset
|
59 </p> |
62
9ab79a764434
Sweet tweet media viewer (image only for now)
nanaya <me@myconan.net>
parents:
diff
changeset
|
60 |
64
a20bbd1e2dc1
Now with avatar and proper retweet styling and stuff
nanaya <me@myconan.net>
parents:
62
diff
changeset
|
61 <% if tweet.quoted_status.present? %> |
a20bbd1e2dc1
Now with avatar and proper retweet styling and stuff
nanaya <me@myconan.net>
parents:
62
diff
changeset
|
62 <blockquote> |
131 | 63 <%= 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
|
64 </blockquote> |
a20bbd1e2dc1
Now with avatar and proper retweet styling and stuff
nanaya <me@myconan.net>
parents:
62
diff
changeset
|
65 <% end %> |
62
9ab79a764434
Sweet tweet media viewer (image only for now)
nanaya <me@myconan.net>
parents:
diff
changeset
|
66 <% end %> |