FIX: add 'show emails' button from moderators in user admin section

This commit is contained in:
Régis Hanol
2014-11-03 12:46:08 +01:00
parent 6080cee874
commit b09ad87098
10 changed files with 73 additions and 10 deletions
@@ -90,11 +90,11 @@ export default Ember.ArrayController.extend(Discourse.Presence, {
@method refreshUsers
**/
refreshUsers: function() {
refreshUsers: function(showEmails) {
var adminUsersListController = this;
adminUsersListController.set('loading', true);
Discourse.AdminUser.findAll(this.get('query'), { filter: this.get('username') }).then(function (result) {
Discourse.AdminUser.findAll(this.get('query'), { filter: this.get('username'), show_emails: showEmails }).then(function (result) {
adminUsersListController.set('content', result);
adminUsersListController.set('loading', false);
});
@@ -140,6 +140,10 @@ export default Ember.ArrayController.extend(Discourse.Presence, {
bootbox.alert(message);
controller.refreshUsers();
});
},
showEmails: function() {
this.refreshUsers(true);
}
});
@@ -28,9 +28,14 @@
</div>
{{/if}}
<h2>{{title}}</h2>
<br/>
<div class="admin-title">
<div class="pull-left">
<h2>{{title}}</h2>
</div>
<div class="pull-right">
<button {{action "showEmails"}} class="btn">{{i18n admin.users.show_emails}}</button>
</div>
</div>
{{#if loading}}
<div class='spinner'></div>
@@ -43,6 +48,7 @@
{{/if}}
<th>&nbsp;</th>
<th>{{i18n username}}</th>
<th>{{i18n email}}</th>
<th>{{i18n admin.users.last_emailed}}</th>
<th>{{i18n last_seen}}</th>
<th>{{i18n admin.user.topics_entered}}</th>
@@ -53,7 +59,6 @@
<th>{{i18n admin.users.approved}}</th>
{{/if}}
<th>&nbsp;</th>
</tr>
{{#each model}}
@@ -67,6 +72,7 @@
{{/if}}
<td>{{#link-to 'adminUser' this}}{{avatar this imageSize="small"}}{{/link-to}}</td>
<td>{{#link-to 'adminUser' this}}{{unbound username}}{{/link-to}}</td>
<td>{{{unbound email}}}</td>
<td>{{{unbound last_emailed_age}}}</td>
<td>{{{unbound last_seen_age}}}</td>
<td>{{{unbound topics_entered}}}</td>