mirror of
https://github.com/discourse/discourse.git
synced 2025-09-09 22:22:54 +08:00
Discourse Macro Helpers + Minor Fix to Admin User View
This commit is contained in:
parent
89152116c6
commit
5eaae063f0
13 changed files with 136 additions and 69 deletions
|
@ -98,19 +98,14 @@ Discourse.AdminUser = Discourse.User.extend({
|
|||
this.set('trustLevel.id', this.get('originalTrustLevel'));
|
||||
},
|
||||
|
||||
isBanned: (function() {
|
||||
return this.get('is_banned') === true;
|
||||
}).property('is_banned'),
|
||||
isBanned: Em.computed.equal('is_banned', true),
|
||||
canBan: Em.computed.not('staff'),
|
||||
|
||||
canBan: (function() {
|
||||
return !this.get('admin') && !this.get('moderator');
|
||||
}).property('admin', 'moderator'),
|
||||
|
||||
banDuration: (function() {
|
||||
banDuration: function() {
|
||||
var banned_at = moment(this.banned_at);
|
||||
var banned_till = moment(this.banned_till);
|
||||
return banned_at.format('L') + " - " + banned_till.format('L');
|
||||
}).property('banned_till', 'banned_at'),
|
||||
}.property('banned_till', 'banned_at'),
|
||||
|
||||
ban: function() {
|
||||
var duration = parseInt(window.prompt(I18n.t('admin.user.ban_duration')), 10);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue