# HG changeset patch
# User nanaya
# Date 1649782191 -32400
# Node ID 12287b32fbda4759367b8732609dd68ff2f8aa63
# Parent 2a4ed5b73c73c8fd961836f85c67e8e8825fb254
Show link to parent tweet for replies
diff -r 2a4ed5b73c73 -r 12287b32fbda app/helpers/application_helper.rb
--- a/app/helpers/application_helper.rb Wed Apr 13 01:41:50 2022 +0900
+++ b/app/helpers/application_helper.rb Wed Apr 13 01:49:51 2022 +0900
@@ -22,6 +22,10 @@
end
def status_url(tweet)
- "https://twitter.com/#{tweet.user.screen_name.presence || '_'}/status/#{tweet.id}"
+ status_url_base tweet.user.screen_name, tweet.id
+ end
+
+ def status_url_base(screen_name, tweet_id)
+ "https://twitter.com/#{screen_name.presence || '_'}/status/#{tweet_id}"
end
end
diff -r 2a4ed5b73c73 -r 12287b32fbda app/views/tweets/_tweet.html.erb
--- a/app/views/tweets/_tweet.html.erb Wed Apr 13 01:41:50 2022 +0900
+++ b/app/views/tweets/_tweet.html.erb Wed Apr 13 01:49:51 2022 +0900
@@ -13,6 +13,16 @@
<% end %>
+ <% if tweet.in_reply_to_status_id.present? %>
+
+
+ Replying to
+ <%= link_to 'tweet', status_url_base(tweet.in_reply_to_screen_name, tweet.in_reply_to_status_id) %>
+ by <%= link_to tweet.in_reply_to_screen_name, "https://twitter.com/#{tweet.in_reply_to_screen_name}" %>
+
+
+ <% end %>
+
<%# FIXME: Twitter gem doesn't support extended mode when writing this %>
<%= auto_link(expand_url(