FEATURE: Link to the user profile if possible when reviewing AkismetFlaggedUsers (#42)

FEATURE: Link to the user profile if possible when reviewing AkismetFlaggedUsers (#42)

diff --git a/assets/javascripts/discourse/templates/components/reviewable-akismet-user.hbs b/assets/javascripts/discourse/templates/components/reviewable-akismet-user.hbs
index e4576a6..cb47ba3 100644
--- a/assets/javascripts/discourse/templates/components/reviewable-akismet-user.hbs
+++ b/assets/javascripts/discourse/templates/components/reviewable-akismet-user.hbs
@@ -3,9 +3,16 @@
     <div class='reviewable-user-details username'>
       <div class='name'>{{i18n "review.user.username"}}</div>
       <div class='value'>
-        {{reviewable.payload.username}}
+        {{#if reviewable.user_deleted}}
+          {{reviewable.payload.username}}
+        {{else}}
+          <a href={{get-url (concat "/u/" reviewable.payload.username "/summary")}}>
+            {{reviewable.payload.username}}
+          </a>
+        {{/if}}
       </div>
     </div>
+    
     {{reviewable-field classes='reviewable-user-details name'
                                name=(i18n 'review.user.name')
                                value=reviewable.payload.name}}
diff --git a/serializers/reviewable_akismet_user_serializer.rb b/serializers/reviewable_akismet_user_serializer.rb
index ee7fa5f..00580a3 100644
--- a/serializers/reviewable_akismet_user_serializer.rb
+++ b/serializers/reviewable_akismet_user_serializer.rb
@@ -4,4 +4,10 @@ require_dependency 'reviewable_serializer'
 
 class ReviewableAkismetUserSerializer < ReviewableSerializer
   payload_attributes :username, :name, :email, :bio
+
+  attributes :user_deleted
+
+  def user_deleted
+    object.target.nil?
+  end
 end

GitHub sha: 33aefd84