UX: Enabled sorting for more columns in admin user list (#7208)

This commit is contained in:
Tim Lange
2019-03-21 10:16:58 +01:00
committed by Guo Xiang Tan
parent 4e594f2b2b
commit d16a0db4e1
7 changed files with 80 additions and 12 deletions

View File

@@ -87,8 +87,8 @@ export default Ember.Controller.extend(CanCheckEmails, {
);
},
showEmails: function() {
this.set("showEmails", true);
toggleEmailVisibility: function() {
this.toggleProperty("showEmails");
this._refreshUsers();
}
}

View File

@@ -18,7 +18,6 @@ export default Discourse.Route.extend({
order: transition.to.queryParams.order,
ascending: transition.to.queryParams.ascending,
query: params.filter,
showEmails: false,
refreshing: false
});

View File

@@ -8,12 +8,16 @@
<div class="admin-title">
<h2>{{title}}</h2>
{{#if canCheckEmails}}
<button {{action "showEmails"}} class="show-emails btn btn-default">{{i18n 'admin.users.show_emails'}}</button>
{{#if showEmails}}
<button {{action "toggleEmailVisibility"}} class="hide-emails btn btn-default">{{i18n 'admin.users.hide_emails'}}</button>
{{else}}
<button {{action "toggleEmailVisibility"}} class="show-emails btn btn-default">{{i18n 'admin.users.show_emails'}}</button>
{{/if}}
{{/if}}
</div>
<div class='username controls'>
{{text-field value=listFilter placeholder=searchHint}}
</div>
{{#conditional-loading-spinner condition=refreshing}}
@@ -23,9 +27,9 @@
{{#if showApproval}}
<th>{{input type="checkbox" checked=selectAll}}</th>
{{/if}}
<th>{{i18n 'username'}}</th>
<th class='email-heading'>{{i18n 'email'}}</th>
<th>{{i18n 'admin.users.last_emailed'}}</th>
{{admin-directory-toggle field="username" i18nKey='username' order=order ascending=ascending}}
{{admin-directory-toggle field="email" i18nKey='email' order=order ascending=ascending}}
{{admin-directory-toggle field="last_emailed" i18nKey='admin.users.last_emailed' order=order ascending=ascending}}
{{admin-directory-toggle field="seen" i18nKey='last_seen' order=order ascending=ascending}}
{{admin-directory-toggle field="topics_viewed" i18nKey="admin.user.topics_entered" order=order ascending=ascending}}
{{admin-directory-toggle field="posts_read" i18nKey="admin.user.posts_read_count" order=order ascending=ascending}}

View File

@@ -435,7 +435,7 @@ $mobile-breakpoint: 700px;
display: flex;
flex-wrap: wrap;
align-items: flex-start;
.show-emails {
.show-emails, .hide-emails {
margin-left: auto;
}
}