mirror of
https://github.com/discourse/discourse.git
synced 2025-04-26 17:54:31 +08: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>
|
||||||
<div class='controls'>
|
<div class='controls'>
|
||||||
<b>{{i18n 'admin.user.suspend_reason'}}</b>:
|
<b>{{i18n 'admin.user.suspend_reason'}}</b>:
|
||||||
{{model.suspend_reason}}
|
<div class='full-suspend-reason'>{{model.full_suspend_reason}}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
@ -177,6 +177,10 @@ $mobile-breakpoint: 700px;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.full-suspend-reason {
|
||||||
|
white-space: pre-wrap;
|
||||||
|
}
|
||||||
|
|
||||||
.admin-users .users-list {
|
.admin-users .users-list {
|
||||||
.username .fa {
|
.username .fa {
|
||||||
color: dark-light-choose($primary-medium, $secondary-medium);
|
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
|
UserHistory.for(self, :suspend_user).order('id DESC').first
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def full_suspend_reason
|
||||||
|
return suspend_record.try(:details) if suspended?
|
||||||
|
end
|
||||||
|
|
||||||
def suspend_reason
|
def suspend_reason
|
||||||
suspend_record.try(:details) if suspended?
|
if details = full_suspend_reason
|
||||||
|
return details.split("\n")[0]
|
||||||
|
end
|
||||||
|
|
||||||
|
nil
|
||||||
end
|
end
|
||||||
|
|
||||||
# Use this helper to determine if the user has a particular trust level.
|
# 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_delete_all_posts,
|
||||||
:can_be_deleted,
|
:can_be_deleted,
|
||||||
:can_be_anonymized,
|
:can_be_anonymized,
|
||||||
:suspend_reason,
|
:full_suspend_reason,
|
||||||
:suspended_till,
|
:suspended_till,
|
||||||
:silence_reason,
|
:silence_reason,
|
||||||
:primary_group_id,
|
:primary_group_id,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user