mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 10:20:58 -06:00
FIX: Only show the full suspension reason on the admin side
This commit is contained in:
parent
02431d4af1
commit
4ae1bbaeba
@ -342,7 +342,7 @@
|
||||
</div>
|
||||
<div class='controls'>
|
||||
<b>{{i18n 'admin.user.suspend_reason'}}</b>:
|
||||
{{model.suspend_reason}}
|
||||
<div class='full-suspend-reason'>{{model.full_suspend_reason}}</div>
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
@ -177,6 +177,10 @@ $mobile-breakpoint: 700px;
|
||||
}
|
||||
}
|
||||
|
||||
.full-suspend-reason {
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
||||
.admin-users .users-list {
|
||||
.username .fa {
|
||||
color: dark-light-choose($primary-medium, $secondary-medium);
|
||||
|
@ -684,8 +684,16 @@ class User < ActiveRecord::Base
|
||||
UserHistory.for(self, :suspend_user).order('id DESC').first
|
||||
end
|
||||
|
||||
def full_suspend_reason
|
||||
return suspend_record.try(:details) if suspended?
|
||||
end
|
||||
|
||||
def suspend_reason
|
||||
suspend_record.try(:details) if suspended?
|
||||
if details = full_suspend_reason
|
||||
return details.split("\n")[0]
|
||||
end
|
||||
|
||||
nil
|
||||
end
|
||||
|
||||
# Use this helper to determine if the user has a particular trust level.
|
||||
|
@ -16,7 +16,7 @@ class AdminDetailedUserSerializer < AdminUserSerializer
|
||||
:can_delete_all_posts,
|
||||
:can_be_deleted,
|
||||
:can_be_anonymized,
|
||||
:suspend_reason,
|
||||
:full_suspend_reason,
|
||||
:suspended_till,
|
||||
:silence_reason,
|
||||
:primary_group_id,
|
||||
|
Loading…
Reference in New Issue
Block a user