FEATURE: user card shows staff if a user is staged and lets them check the email address

This commit is contained in:
Neil Lalonde
2017-11-23 16:38:11 -05:00
parent e0dc4ea4fc
commit 3f58b18dab
5 changed files with 36 additions and 3 deletions
@@ -7,12 +7,13 @@ import DiscourseURL from 'discourse/lib/url';
import User from 'discourse/models/user';
import { userPath } from 'discourse/lib/url';
import { durationTiny } from 'discourse/lib/formatter';
import CanCheckEmails from 'discourse/mixins/can-check-emails';
const clickOutsideEventName = "mousedown.outside-user-card";
const clickDataExpand = "click.discourse-user-card";
const clickMention = "click.discourse-user-mention";
export default Ember.Component.extend(CleansUp, {
export default Ember.Component.extend(CleansUp, CanCheckEmails, {
elementId: 'user-card',
classNameBindings: ['visible:show', 'showBadges', 'hasCardBadgeImage', 'user.card_background::no-bg'],
allowBackgrounds: setting('allow_profile_backgrounds'),
@@ -30,6 +31,7 @@ export default Ember.Component.extend(CleansUp, {
showDelete: Ember.computed.and("viewingAdmin", "showName", "user.canBeDeleted"),
linkWebsite: Ember.computed.not('user.isBasic'),
hasLocationOrWebsite: Ember.computed.or('user.location', 'user.website_name'),
showCheckEmail: Ember.computed.and('user.staged', 'canCheckEmails'),
visible: false,
user: null,
@@ -291,6 +293,10 @@ export default Ember.Component.extend(CleansUp, {
showUser() {
this.sendAction('showUser', this.get('user'));
this._close();
},
checkEmail(user) {
user.checkEmail();
}
}
});