UX: Slightly improved reviewable user display, plus link to admin if possible

UX: Slightly improved reviewable user display, plus link to admin if possible

diff --git a/app/assets/javascripts/discourse/templates/components/reviewable-user.hbs b/app/assets/javascripts/discourse/templates/components/reviewable-user.hbs
index a0f6143..f18b38e 100644
--- a/app/assets/javascripts/discourse/templates/components/reviewable-user.hbs
+++ b/app/assets/javascripts/discourse/templates/components/reviewable-user.hbs
@@ -1,7 +1,25 @@
 <div class='reviewable-user-info'>
-  <div class='reviewable-user-details'>
-    {{reviewable.payload.username}}
-    {{reviewable.payload.email}}
+  <div class='reviewable-user-details username'>
+    <div class='name'>{{i18n "review.user.username"}}</div>
+    <div class='value'>
+      {{#if reviewable.link_admin}}
+        <a href={{get-url (concat "/admin/users/" reviewable.user_id "/" reviewable.payload.username)}}>
+          {{reviewable.payload.username}}
+        </a>
+      {{else}}
+        {{reviewable.payload.username}}
+      {{/if}}
+    </div>
+  </div>
+  {{#if reviewable.payload.name}}
+    <div class='reviewable-user-details name'>
+      <div class='name'>{{i18n "review.user.name"}}</div>
+      <div class='value'>{{reviewable.payload.name}}</div>
+    </div>
+  {{/if}}
+  <div class='reviewable-user-details email'>
+    <div class='name'>{{i18n "review.user.email"}}</div>
+    <div class='value'>{{reviewable.payload.email}}</div>
   </div>
 
   {{yield}}
diff --git a/app/assets/stylesheets/common/base/reviewables.scss b/app/assets/stylesheets/common/base/reviewables.scss
index 1860bb6..6427b54 100644
--- a/app/assets/stylesheets/common/base/reviewables.scss
+++ b/app/assets/stylesheets/common/base/reviewables.scss
@@ -44,8 +44,18 @@
   }
 }
 
-.reviewable-user-details {
+.reviewable-user-info {
   margin: 0.5em 0;
+
+  .reviewable-user-details {
+    display: flex;
+    .name {
+      width: 8em;
+      font-weight: bold;
+      margin-right: 1em;
+    }
+    margin-bottom: 0.5em;
+  }
 }
 
 .no-review {
diff --git a/app/serializers/reviewable_user_serializer.rb b/app/serializers/reviewable_user_serializer.rb
index f41320a..494a198 100644
--- a/app/serializers/reviewable_user_serializer.rb
+++ b/app/serializers/reviewable_user_serializer.rb
@@ -1,9 +1,15 @@
 class ReviewableUserSerializer < ReviewableSerializer
 
+  attributes :link_admin
+
   payload_attributes(
     :username,
     :email,
     :name
   )
 
+  def link_admin
+    scope.is_staff? && object.target.present?
+  end
+
 end
diff --git a/app/services/user_destroyer.rb b/app/services/user_destroyer.rb
index dc554f3..f9a9f59 100644
--- a/app/services/user_destroyer.rb
+++ b/app/services/user_destroyer.rb
@@ -29,7 +29,7 @@ class UserDestroyer
       Reviewable.where(created_by_id: user.id).delete_all
 
       if reviewable = Reviewable.find_by(target: user)
-        reviewable.perform(@actor, :reject, skip_delete: true)
+        reviewable.perform(@actor, :reject, skip_delete: true) rescue Reviewable::InvalidAction
       end
 
       if opts[:delete_posts]
diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml
index 16d69af..d8e0be1 100644
--- a/config/locales/client.en.yml
+++ b/config/locales/client.en.yml
@@ -381,6 +381,11 @@ en:
       filtered_user: "User:"
       show_all_topics: "show all topics"
       deleted_user: "(deleted user)"
+      user:
+        username: "Username"
+        email: "Email"
+        name: "Name"
+
       user_percentage:
         summary:
           one: "{{agreed}}, {{disagreed}}, {{ignored}} ({{count}} total flag)"

GitHub sha: a4ff5935

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