diff --git a/app/assets/javascripts/admin/models/admin-user.js.es6 b/app/assets/javascripts/admin/models/admin-user.js.es6 index b8264264730..0d3edd9675b 100644 --- a/app/assets/javascripts/admin/models/admin-user.js.es6 +++ b/app/assets/javascripts/admin/models/admin-user.js.es6 @@ -240,8 +240,6 @@ const AdminUser = Discourse.User.extend({ return this.get('trust_level') < 4; }.property('trust_level'), - isSuspended: Em.computed.equal('suspended', true), - isSilenced: Ember.computed.equal('silenced', true), canSuspend: Em.computed.not('staff'), suspendDuration: function() { diff --git a/app/assets/javascripts/admin/templates/user-index.hbs b/app/assets/javascripts/admin/templates/user-index.hbs index 4ab9ea859a3..9fd8d35fff7 100644 --- a/app/assets/javascripts/admin/templates/user-index.hbs +++ b/app/assets/javascripts/admin/templates/user-index.hbs @@ -318,18 +318,18 @@ -
-
{{i18n 'admin.user.suspended'}}
-
- {{i18n-yes-no model.isSuspended}} - {{#if model.isSuspended}} - {{#unless model.suspendedForever}} - {{i18n "admin.user.suspended_until" until=model.suspendedTillDate}} - {{/unless}} - {{/if}} -
-
- {{#if model.isSuspended}} +
+
{{i18n 'admin.user.suspended'}}
+
+ {{i18n-yes-no model.suspended}} + {{#if model.suspended}} + {{#unless model.suspendedForever}} + {{i18n "admin.user.suspended_until" until=model.suspendedTillDate}} + {{/unless}} + {{/if}} +
+
+ {{#if model.suspended}} {{d-button class="btn-danger unsuspend-user" action=(action "unsuspend") @@ -349,7 +349,7 @@
- {{#if model.isSuspended}} + {{#if model.suspended}}
{{i18n 'admin.user.suspended_by'}}
@@ -367,7 +367,7 @@
{{i18n 'admin.user.silenced'}}
{{i18n-yes-no model.silenced}} - {{#if model.isSilenced}} + {{#if model.silenced}} {{#unless model.silencedForever}} {{i18n "admin.user.suspended_until" until=model.silencedTillDate}} {{/unless}} @@ -394,7 +394,7 @@
- {{#if model.isSilenced}} + {{#if model.silenced}}
{{i18n 'admin.user.silenced_by'}}
@@ -408,6 +408,7 @@
{{/if}} + {{#if currentUser.admin}} diff --git a/app/assets/javascripts/discourse/components/user-card-contents.js.es6 b/app/assets/javascripts/discourse/components/user-card-contents.js.es6 index 140b69a1b57..d75bab921a0 100644 --- a/app/assets/javascripts/discourse/components/user-card-contents.js.es6 +++ b/app/assets/javascripts/discourse/components/user-card-contents.js.es6 @@ -18,7 +18,6 @@ export default Ember.Component.extend(CardContentsBase, CanCheckEmails, CleansUp showFilter: Ember.computed.and('viewingTopic', 'postStream.hasNoFilters', 'enoughPostsForFiltering'), showName: propertyNotEqual('user.name', 'user.username'), hasUserFilters: Ember.computed.gt('postStream.userFilters.length', 0), - isSuspended: Ember.computed.notEmpty('user.suspend_reason'), showMoreBadges: Ember.computed.gt('moreBadgesCount', 0), showDelete: Ember.computed.and("viewingAdmin", "showName", "user.canBeDeleted"), linkWebsite: Ember.computed.not('user.isBasic'), diff --git a/app/assets/javascripts/discourse/controllers/user.js.es6 b/app/assets/javascripts/discourse/controllers/user.js.es6 index ecde47f23b0..afa32314131 100644 --- a/app/assets/javascripts/discourse/controllers/user.js.es6 +++ b/app/assets/javascripts/discourse/controllers/user.js.es6 @@ -39,9 +39,9 @@ export default Ember.Controller.extend(CanCheckEmails, { showStaffCounters: Ember.computed.or('hasGivenFlags', 'hasFlaggedPosts', 'hasDeletedPosts', 'hasBeenSuspended', 'hasReceivedWarnings'), - @computed('model.isSuspended', 'currentUser.staff') - isNotSuspendedOrIsStaff(isSuspended, isStaff) { - return !isSuspended || isStaff; + @computed('model.suspended', 'currentUser.staff') + isNotSuspendedOrIsStaff(suspended, isStaff) { + return !suspended || isStaff; }, linkWebsite: Em.computed.not('model.isBasic'), diff --git a/app/assets/javascripts/discourse/models/user.js.es6 b/app/assets/javascripts/discourse/models/user.js.es6 index 19e3ebcd142..a76f17be969 100644 --- a/app/assets/javascripts/discourse/models/user.js.es6 +++ b/app/assets/javascripts/discourse/models/user.js.es6 @@ -169,8 +169,6 @@ const User = RestModel.extend({ isElder: Em.computed.equal('trust_level', 4), canManageTopic: Em.computed.or('staff', 'isElder'), - isSuspended: Em.computed.equal('suspended', true), - @computed("previous_visit_at") previousVisitAt(previous_visit_at) { return new Date(previous_visit_at); diff --git a/app/assets/javascripts/discourse/templates/components/user-card-contents.hbs b/app/assets/javascripts/discourse/templates/components/user-card-contents.hbs index 66275c66345..59c1891fb1d 100644 --- a/app/assets/javascripts/discourse/templates/components/user-card-contents.hbs +++ b/app/assets/javascripts/discourse/templates/components/user-card-contents.hbs @@ -84,7 +84,7 @@ args=(hash user=user close=(action "close")) tagName=""}} - {{#if isSuspended}} + {{#if user.suspend_reason}}
{{d-icon "ban"}} {{i18n 'user.suspended_notice' date=user.suspendedTillDate}}
diff --git a/app/assets/javascripts/discourse/templates/user.hbs b/app/assets/javascripts/discourse/templates/user.hbs index 177a8fec056..3b3acc6fa94 100644 --- a/app/assets/javascripts/discourse/templates/user.hbs +++ b/app/assets/javascripts/discourse/templates/user.hbs @@ -107,7 +107,7 @@
- {{#if model.isSuspended}} + {{#if model.suspended}}
{{d-icon "ban"}}