mirror of
https://github.com/discourse/discourse.git
synced 2025-04-08 21:35:08 +08:00
Public user profile page shows if the user is suspended and why.
This commit is contained in:
parent
ac9a763ab3
commit
dbd2332b74
@ -2,9 +2,9 @@
|
|||||||
<form>
|
<form>
|
||||||
{{i18n admin.user.suspend_duration}}
|
{{i18n admin.user.suspend_duration}}
|
||||||
{{textField value=duration maxlength="5" autofocus="autofocus" class="span2"}}
|
{{textField value=duration maxlength="5" autofocus="autofocus" class="span2"}}
|
||||||
{{i18n admin.user.suspend_duration_units}}
|
{{i18n admin.user.suspend_duration_units}}<br/>
|
||||||
<br/>
|
<br/>
|
||||||
{{i18n admin.user.suspend_reason_label}}
|
{{{i18n admin.user.suspend_reason_label}}}<br/>
|
||||||
<br/>
|
<br/>
|
||||||
{{textField value=reason class="span8"}}
|
{{textField value=reason class="span8"}}
|
||||||
</form>
|
</form>
|
||||||
|
@ -97,6 +97,12 @@ Discourse.User = Discourse.Model.extend({
|
|||||||
return Discourse.Site.currentProp('trustLevels').findProperty('id', parseInt(this.get('trust_level'), 10));
|
return Discourse.Site.currentProp('trustLevels').findProperty('id', parseInt(this.get('trust_level'), 10));
|
||||||
}.property('trust_level'),
|
}.property('trust_level'),
|
||||||
|
|
||||||
|
isSuspended: Em.computed.equal('suspended', true),
|
||||||
|
|
||||||
|
suspendedTillDate: function() {
|
||||||
|
return Discourse.Formatter.longDate(this.get('suspended_till'));
|
||||||
|
}.property('suspended_till'),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Changes this user's username.
|
Changes this user's username.
|
||||||
|
|
||||||
|
@ -42,6 +42,14 @@
|
|||||||
<h2>{{name}}</h2>
|
<h2>{{name}}</h2>
|
||||||
|
|
||||||
<div class='bio'>{{{bio_excerpt}}}</div>
|
<div class='bio'>{{{bio_excerpt}}}</div>
|
||||||
|
|
||||||
|
{{#if isSuspended}}
|
||||||
|
<div class='suspended'>
|
||||||
|
<i class='icon icon-ban-circle'></i>
|
||||||
|
<b>{{i18n user.suspended_notice date="suspendedTillDate"}}</b><br/>
|
||||||
|
<b>{{i18n user.suspended_reason}}</b> {{suspend_reason}}
|
||||||
|
</div>
|
||||||
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class='secondary'>
|
<div class='secondary'>
|
||||||
|
@ -166,6 +166,10 @@
|
|||||||
background-color: white;
|
background-color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.suspended {
|
||||||
|
color: #f77;
|
||||||
|
}
|
||||||
|
|
||||||
.primary {
|
.primary {
|
||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
float: left;
|
float: left;
|
||||||
|
@ -17,7 +17,10 @@ class UserSerializer < BasicUserSerializer
|
|||||||
:trust_level,
|
:trust_level,
|
||||||
:moderator,
|
:moderator,
|
||||||
:admin,
|
:admin,
|
||||||
:title
|
:title,
|
||||||
|
:suspended,
|
||||||
|
:suspend_reason,
|
||||||
|
:suspended_till
|
||||||
|
|
||||||
has_one :invited_by, embed: :object, serializer: BasicUserSerializer
|
has_one :invited_by, embed: :object, serializer: BasicUserSerializer
|
||||||
|
|
||||||
@ -96,4 +99,18 @@ class UserSerializer < BasicUserSerializer
|
|||||||
SiteSetting.enable_names?
|
SiteSetting.enable_names?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def suspended
|
||||||
|
object.suspended?
|
||||||
|
end
|
||||||
|
|
||||||
|
def include_suspended?
|
||||||
|
object.suspended?
|
||||||
|
end
|
||||||
|
def include_suspend_reason?
|
||||||
|
object.suspended?
|
||||||
|
end
|
||||||
|
def include_suspended_till?
|
||||||
|
object.suspended?
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
@ -216,6 +216,8 @@ en:
|
|||||||
moderator: "{{user}} is a moderator"
|
moderator: "{{user}} is a moderator"
|
||||||
admin: "{{user}} is an admin"
|
admin: "{{user}} is an admin"
|
||||||
deleted: "(deleted)"
|
deleted: "(deleted)"
|
||||||
|
suspended_notice: "This user is suspended until {{date}}."
|
||||||
|
suspended_reason: "Reason: "
|
||||||
|
|
||||||
messages:
|
messages:
|
||||||
all: "All"
|
all: "All"
|
||||||
@ -1339,9 +1341,9 @@ en:
|
|||||||
user:
|
user:
|
||||||
suspend_failed: "Something went wrong suspending this user {{error}}"
|
suspend_failed: "Something went wrong suspending this user {{error}}"
|
||||||
unsuspend_failed: "Something went wrong unsuspending this user {{error}}"
|
unsuspend_failed: "Something went wrong unsuspending this user {{error}}"
|
||||||
suspend_duration: "How long would you like to suspend the user for?"
|
suspend_duration: "How long will the user be suspended for?"
|
||||||
suspend_duration_units: "(days)"
|
suspend_duration_units: "(days)"
|
||||||
suspend_reason_label: "Why are you suspending? When the user tries to log in, they will see this text. Keep it short."
|
suspend_reason_label: "Why are you suspending? This text <b>will be visible to everyone</b> on this user's profile page, and will be shown to the user when they try to log in. Keep it short."
|
||||||
suspend_reason: "Reason"
|
suspend_reason: "Reason"
|
||||||
suspended_by: "Suspended by"
|
suspended_by: "Suspended by"
|
||||||
delete_all_posts: "Delete all posts"
|
delete_all_posts: "Delete all posts"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user