UX: Show tags on flags too

UX: Show tags on flags too

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 9f6fd37..10d1cba 100644
--- a/app/assets/javascripts/discourse/templates/components/reviewable-flagged-post.hbs
+++ b/app/assets/javascripts/discourse/templates/components/reviewable-flagged-post.hbs
@@ -1,11 +1,12 @@
 {{reviewable-topic-link reviewable=reviewable tagName=''}}
+
 <div class='post-contents-wrapper'>
-{{reviewable-created-by user=reviewable.target_created_by tagName=''}}
-<div class='post-contents'>
-  {{reviewable-created-by-name user=reviewable.target_created_by tagName=''}}
-  <div class='post-body'>
-    {{{reviewable.cooked}}}
+  {{reviewable-created-by user=reviewable.target_created_by tagName=''}}
+  <div class='post-contents'>
+    {{reviewable-created-by-name user=reviewable.target_created_by tagName=''}}
+    <div class='post-body'>
+      {{{reviewable.cooked}}}
+    </div>
+    {{yield}}
   </div>
-  {{yield}}
-</div>
 </div>
diff --git a/app/assets/javascripts/discourse/templates/components/reviewable-item.hbs b/app/assets/javascripts/discourse/templates/components/reviewable-item.hbs
index 34c1c66..c8bbb15 100644
--- a/app/assets/javascripts/discourse/templates/components/reviewable-item.hbs
+++ b/app/assets/javascripts/discourse/templates/components/reviewable-item.hbs
@@ -10,11 +10,11 @@
     </span>
     <span class='status'>
       {{#if reviewable.approved}}
-      <span class="approved">  {{d-icon "check"}} {{i18n "review.statuses.approved.title"}} </span>
+        <span class="approved"> {{d-icon "check"}} {{i18n "review.statuses.approved.title"}} </span>
       {{else if reviewable.rejected}}
-      <span class="rejected">   {{d-icon "times"}} {{i18n "review.statuses.rejected.title"}} </span>
+        <span class="rejected"> {{d-icon "times"}} {{i18n "review.statuses.rejected.title"}} </span>
       {{else if reviewable.ignored}}
-      <span class="ignored">   {{d-icon "external-link-alt"}} {{i18n "review.statuses.ignored.title"}} </span>
+        <span class="ignored"> {{d-icon "external-link-alt"}} {{i18n "review.statuses.ignored.title"}} </span>
       {{/if}}
     </span>
   </div>
@@ -36,10 +36,10 @@
       </div>
     {{else}}
       {{#component reviewableComponent reviewable=reviewable tagName=''}}
-      <div class='reviewable-scores-and-history'>
-        {{reviewable-scores scores=reviewable.reviewable_scores tagName=''}}
-        {{reviewable-histories histories=reviewable.reviewable_histories tagName=''}}
-      </div>
+        <div class='reviewable-scores-and-history'>
+          {{reviewable-scores scores=reviewable.reviewable_scores tagName=''}}
+          {{reviewable-histories histories=reviewable.reviewable_histories tagName=''}}
+        </div>
       {{/component}}
     {{/if}}
   </div>
diff --git a/app/assets/javascripts/discourse/templates/components/reviewable-queued-post.hbs b/app/assets/javascripts/discourse/templates/components/reviewable-queued-post.hbs
index ba09137..1a02f4d 100644
--- a/app/assets/javascripts/discourse/templates/components/reviewable-queued-post.hbs
+++ b/app/assets/javascripts/discourse/templates/components/reviewable-queued-post.hbs
@@ -1,29 +1,21 @@
-
-
-  {{#reviewable-topic-link reviewable=reviewable tagName=''}}
-    <div class="title-text">{{i18n "review.new_topic"}}
+{{#reviewable-topic-link reviewable=reviewable tagName=''}}
+  <div class="title-text">{{i18n "review.new_topic"}}
     {{reviewable.payload.title}}
   </div>
   {{category-badge reviewable.category}}
-    {{#if reviewable.payload.tags}}
-      <div class="list-tags">
-        {{#each reviewable.payload.tags as |t|}}
-          {{discourse-tag t}}
-        {{/each}}
-      </div>
-    {{/if}}
-  {{/reviewable-topic-link}}
+  {{reviewable-tags tags=reviewable.payload.tags tagName=''}}
+{{/reviewable-topic-link}}
 
 <div class='post-contents-wrapper'>
   {{reviewable-created-by user=reviewable.created_by tagName=''}}
 
-<div class='post-contents'>
-  {{reviewable-created-by-name user=reviewable.created_by tagName=''}}
+  <div class='post-contents'>
+    {{reviewable-created-by-name user=reviewable.created_by tagName=''}}
 
-  <div class='post-body'>
-    {{cook-text reviewable.payload.raw}}
-  </div>
+    <div class='post-body'>
+      {{cook-text reviewable.payload.raw}}
+    </div>
 
-  {{yield}}
-</div>
+    {{yield}}
+  </div>
 </div>
diff --git a/app/assets/javascripts/discourse/templates/components/reviewable-tags.hbs b/app/assets/javascripts/discourse/templates/components/reviewable-tags.hbs
new file mode 100644
index 0000000..f0d6427
--- /dev/null
+++ b/app/assets/javascripts/discourse/templates/components/reviewable-tags.hbs
@@ -0,0 +1,5 @@
+{{#if tags}}
+  <div class="list-tags">
+    {{#each tags as |t|}} {{discourse-tag t}} {{/each}}
+  </div>
+{{/if}}
diff --git a/app/assets/javascripts/discourse/templates/components/reviewable-topic-link.hbs b/app/assets/javascripts/discourse/templates/components/reviewable-topic-link.hbs
index 2025811..af344e0 100644
--- a/app/assets/javascripts/discourse/templates/components/reviewable-topic-link.hbs
+++ b/app/assets/javascripts/discourse/templates/components/reviewable-topic-link.hbs
@@ -3,6 +3,7 @@
     {{topic-status topic=reviewable.topic}}
     <a href={{reviewable.topic_url}} class='title-text'>{{reviewable.topic.title}}</a>
     {{category-badge reviewable.category}}
+    {{reviewable-tags tags=reviewable.topic_tags tagName=''}}
   {{else if (has-block)}}
     {{yield}}
   {{else}}
diff --git a/app/serializers/reviewable_serializer.rb b/app/serializers/reviewable_serializer.rb
index a47ec79..ba86ea9 100644
--- a/app/serializers/reviewable_serializer.rb
+++ b/app/serializers/reviewable_serializer.rb
@@ -11,11 +11,12 @@ class ReviewableSerializer < ApplicationSerializer
     :type,
     :topic_id,
     :topic_url,
+    :topic_tags,
     :category_id,
     :created_at,
     :can_edit,
     :score,
-    :version
+    :version,
   )
 
   has_one :created_by, serializer: BasicUserSerializer, root: 'users'
@@ -87,6 +88,14 @@ class ReviewableSerializer < ApplicationSerializer
     data
   end
 
+  def topic_tags
+    object.topic.tags.map(&:name)
+  end
+
+  def include_topic_tags?
+    object.topic.present? && SiteSetting.tagging_enabled?
+  end
+
   def topic_url
     return object.target.url if object.target.is_a?(Post)
     return object.topic.url

GitHub sha: a6f283da