FIX: Show when a post has been deleted in the flag review queue

FIX: Show when a post has been deleted in the flag review queue

diff --git a/app/assets/javascripts/discourse/templates/components/reviewable-flagged-post.hbs b/app/assets/javascripts/discourse/templates/components/reviewable-flagged-post.hbs
index 10d1cba..d79d8a2 100644
--- a/app/assets/javascripts/discourse/templates/components/reviewable-flagged-post.hbs
+++ b/app/assets/javascripts/discourse/templates/components/reviewable-flagged-post.hbs
@@ -5,7 +5,11 @@
   <div class='post-contents'>
     {{reviewable-created-by-name user=reviewable.target_created_by tagName=''}}
     <div class='post-body'>
-      {{{reviewable.cooked}}}
+      {{#if reviewable.blank_post}}
+        <p>{{i18n "review.deleted_post"}}</p>
+      {{else}}
+        {{{reviewable.cooked}}}
+      {{/if}}
     </div>
     {{yield}}
   </div>
diff --git a/app/serializers/reviewable_flagged_post_serializer.rb b/app/serializers/reviewable_flagged_post_serializer.rb
index 3b8e1c7..1a85940 100644
--- a/app/serializers/reviewable_flagged_post_serializer.rb
+++ b/app/serializers/reviewable_flagged_post_serializer.rb
@@ -1,3 +1,12 @@
 class ReviewableFlaggedPostSerializer < ReviewableSerializer
   target_attributes :cooked, :raw, :reply_count
+  attributes :blank_post
+
+  def blank_post
+    true
+  end
+
+  def include_blank_post?
+    object.target.blank?
+  end
 end
diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml
index 5982db5..e4af071 100644
--- a/config/locales/client.en.yml
+++ b/config/locales/client.en.yml
@@ -382,7 +382,8 @@ en:
       filtered_topic: "You have filtered to reviewable content in a single topic."
       filtered_user: "User:"
       show_all_topics: "show all topics"
-      deleted_user: "(deleted user)"
+      deleted_post: "(post deleted)"
+      deleted_user: "(user deleted)"
       user:
         username: "Username"
         email: "Email"

GitHub sha: cd2e93b5

1 Like