diff 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
line wrap: on
line diff
--- 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 @@
     </p>
   <% end %>
 
+  <% if tweet.in_reply_to_status_id.present? %>
+    <p>
+      <small>
+        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}" %>
+      </small>
+    </p>
+  <% end %>
+
   <p>
     <%# FIXME: Twitter gem doesn't support extended mode when writing this %>
     <%= auto_link(expand_url(