UX: Add post action text in non-JS topic view

UX: Add post action text in non-JS topic view

diff --git a/app/views/topics/show.html.erb b/app/views/topics/show.html.erb
index 138646b..456135d 100644
--- a/app/views/topics/show.html.erb
+++ b/app/views/topics/show.html.erb
@@ -47,10 +47,16 @@
       <div class='creator'>
         <span>
           <a href='<%= Discourse.base_uri %>/u/<%= u.username %>'><b itemprop='author'><%= u.username %></b></a>
-           <%= "(#{u.name})" if (SiteSetting.display_name_on_posts && SiteSetting.enable_names? && !u.name.blank?) %>
-           <time datetime='<%= post.created_at.to_formatted_s(:iso8601) %>' itemprop='datePublished'>
-             <%= post.created_at %>
-           </time>
+          <%= "(#{u.name})" if (SiteSetting.display_name_on_posts && SiteSetting.enable_names? && !u.name.blank?) %>
+          <%
+            who_username = post.custom_fields["action_code_who"] || ""
+            if post.action_code
+          %>
+            <%= t("js.action_codes.#{post.action_code}", when: "", who: who_username).html_safe %>
+          <% end %>
+          <time datetime='<%= post.created_at.to_formatted_s(:iso8601) %>' itemprop='datePublished'>
+            <%= post.created_at %>
+          </time>
         </span>
         <span itemprop='position'>#<%= post.post_number %></span>
       </div>

GitHub sha: 3d52f690

This commit has been mentioned on Discourse Meta. There might be relevant details there:

@ZogStriP / @vinothkannans,

for me this is causing a n+1 query in Meta. Is it expected?

3 Likes

Oh, I will check that.

2 Likes

This is fixed in

1 Like