mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Use far fewer admin user list routes, instead pass the query as a
parameter.
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
{{#if currentUser.admin}}
|
||||
<li>{{#link-to 'adminSiteSettings'}}{{i18n admin.site_settings.title}}{{/link-to}}</li>
|
||||
{{/if}}
|
||||
<li>{{#link-to 'adminUsersList'}}{{i18n admin.users.title}}{{/link-to}}</li>
|
||||
<li>{{#link-to 'adminUsersList.show' 'active'}}{{i18n admin.users.title}}{{/link-to}}</li>
|
||||
{{#if showBadges}}
|
||||
<li>{{#link-to 'adminBadges.index'}}{{i18n admin.badges.title}}{{/link-to}}</li>
|
||||
{{/if}}
|
||||
|
||||
@@ -25,15 +25,15 @@
|
||||
<table>
|
||||
<tr>
|
||||
<td class="title"><i class='fa fa-shield'></i> {{i18n admin.dashboard.admins}}</td>
|
||||
<td class="value">{{#link-to 'adminUsersList.admins'}}{{admins}}{{/link-to}}</td>
|
||||
<td class="value">{{#link-to 'adminUsersList.show' 'admins'}}{{admins}}{{/link-to}}</td>
|
||||
<td class="title"><i class='fa fa-ban'></i> {{i18n admin.dashboard.suspended}}</td>
|
||||
<td class="value">{{#link-to 'adminUsersList.suspended'}}{{suspended}}{{/link-to}}</td>
|
||||
<td class="value">{{#link-to 'adminUsersList.show' 'suspended'}}{{suspended}}{{/link-to}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="title"><i class='fa fa-shield'></i> {{i18n admin.dashboard.moderators}}</td>
|
||||
<td class="value">{{#link-to 'adminUsersList.moderators'}}{{moderators}}{{/link-to}}</td>
|
||||
<td class="value">{{#link-to 'adminUsersList.show' 'moderators'}}{{moderators}}{{/link-to}}</td>
|
||||
<td class="title"><i class='fa fa-ban'></i> {{i18n admin.dashboard.blocked}}</td>
|
||||
<td class="value">{{#link-to 'adminUsersList.blocked'}}{{blocked}}{{/link-to}}</td>
|
||||
<td class="value">{{#link-to 'adminUsersList.show' 'blocked'}}{{blocked}}{{/link-to}}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<tr>
|
||||
<td class="title">{{title}}</td>
|
||||
<td class="value">{{#link-to 'adminUsersList.newuser'}}{{valueAtTrustLevel data 0}}{{/link-to}}</td>
|
||||
<td class="value">{{#link-to 'adminUsersList.basicuser'}}{{valueAtTrustLevel data 1}}{{/link-to}}</td>
|
||||
<td class="value">{{#link-to 'adminUsersList.regular'}}{{valueAtTrustLevel data 2}}{{/link-to}}</td>
|
||||
<td class="value">{{#link-to 'adminUsersList.leaders'}}{{valueAtTrustLevel data 3}}{{/link-to}}</td>
|
||||
<td class="value">{{#link-to 'adminUsersList.elders'}}{{valueAtTrustLevel data 4}}{{/link-to}}</td>
|
||||
<td class="value">{{#link-to 'adminUsersList.show' 'newuser'}}{{valueAtTrustLevel data 0}}{{/link-to}}</td>
|
||||
<td class="value">{{#link-to 'adminUsersList.show' 'basic'}}{{valueAtTrustLevel data 1}}{{/link-to}}</td>
|
||||
<td class="value">{{#link-to 'adminUsersList.show' 'regular'}}{{valueAtTrustLevel data 2}}{{/link-to}}</td>
|
||||
<td class="value">{{#link-to 'adminUsersList.show' 'leader'}}{{valueAtTrustLevel data 3}}{{/link-to}}</td>
|
||||
<td class="value">{{#link-to 'adminUsersList.show' 'elder'}}{{valueAtTrustLevel data 4}}{{/link-to}}</td>
|
||||
</tr>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<div class='span15'>
|
||||
<ul class="nav nav-pills">
|
||||
<li>{{#link-to 'adminUser' this}}<i class="fa fa-caret-left"></i> {{username}}{{/link-to}}</li>
|
||||
<li>{{#link-to 'adminUsersList.regular'}}{{i18n admin.user.trust_level_2_users}}{{/link-to}}</li>
|
||||
<li>{{#link-to 'adminUsersList.show' 'regular'}}{{i18n admin.user.trust_level_2_users}}{{/link-to}}</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
84
app/assets/javascripts/admin/templates/users-list-show.hbs
Normal file
84
app/assets/javascripts/admin/templates/users-list-show.hbs
Normal file
@@ -0,0 +1,84 @@
|
||||
{{#if hasSelection}}
|
||||
<div id='selected-controls'>
|
||||
<button {{action "approveUsers"}} class='btn'>{{countI18n admin.users.approved_selected count=selectedCount}}</button>
|
||||
<button {{action "rejectUsers"}} class='btn btn-danger'>{{countI18n admin.users.reject_selected count=selectedCount}}</button>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
<div class="admin-title">
|
||||
<div class="pull-left">
|
||||
<h2>{{title}}</h2>
|
||||
</div>
|
||||
</div>
|
||||
<div class='username controls'>
|
||||
{{text-field value=listFilter placeholder=searchHint}}
|
||||
{{#unless showEmails}}
|
||||
<div class="pull-right">
|
||||
<button {{action "showEmails"}} class="btn">{{i18n admin.users.show_emails}}</button>
|
||||
</div>
|
||||
{{/unless}}
|
||||
</div>
|
||||
|
||||
{{#loading-spinner condition=refreshing}}
|
||||
{{#if model}}
|
||||
<table class='table'>
|
||||
<tr>
|
||||
{{#if showApproval}}
|
||||
<th>{{input type="checkbox" checked=selectAll}}</th>
|
||||
{{/if}}
|
||||
<th> </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>
|
||||
<th>{{i18n admin.user.posts_read_count}}</th>
|
||||
<th>{{i18n admin.user.time_read}}</th>
|
||||
<th>{{i18n created}}</th>
|
||||
{{#if showApproval}}
|
||||
<th>{{i18n admin.users.approved}}</th>
|
||||
{{/if}}
|
||||
<th> </th>
|
||||
</tr>
|
||||
|
||||
{{#each model}}
|
||||
<tr {{bind-attr class="selected active::not-activated"}}>
|
||||
{{#if controller.showApproval}}
|
||||
<td>
|
||||
{{#if can_approve}}
|
||||
{{input type="checkbox" checked=selected}}
|
||||
{{/if}}
|
||||
</td>
|
||||
{{/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>
|
||||
<td>{{{unbound posts_read_count}}}</td>
|
||||
<td>{{{unbound time_read}}}</td>
|
||||
|
||||
<td>{{{unbound created_at_age}}}</td>
|
||||
|
||||
{{#if showApproval}}
|
||||
<td>
|
||||
{{#if approved}}
|
||||
{{i18n yes_value}}
|
||||
{{else}}
|
||||
{{i18n no_value}}
|
||||
{{/if}}
|
||||
</td>
|
||||
{{/if}}
|
||||
<td>
|
||||
{{#if admin}}<i class="fa fa-shield" title="{{i18n admin.title}}"></i>{{/if}}
|
||||
{{#if moderator}}<i class="fa fa-shield" title="{{i18n admin.moderator}}"></i>{{/if}}
|
||||
<td>
|
||||
</tr>
|
||||
{{/each}}
|
||||
|
||||
</table>
|
||||
{{else}}
|
||||
<p>{{i18n search.no_results}}</p>
|
||||
{{/if}}
|
||||
{{/loading-spinner}}
|
||||
@@ -1,103 +1,22 @@
|
||||
<div class='admin-controls'>
|
||||
<div class='span15'>
|
||||
<ul class="nav nav-pills">
|
||||
<li>{{#link-to 'adminUsersList.active'}}{{i18n admin.users.nav.active}}{{/link-to}}</li>
|
||||
<li>{{#link-to 'adminUsersList.new'}}{{i18n admin.users.nav.new}}{{/link-to}}</li>
|
||||
{{#if mustApproveUsers}}
|
||||
<li>{{#link-to 'adminUsersList.pending'}}{{i18n admin.users.nav.pending}}{{/link-to}}</li>
|
||||
<li>{{#link-to 'adminUsersList.show' 'active'}}{{i18n admin.users.nav.active}}{{/link-to}}</li>
|
||||
<li>{{#link-to 'adminUsersList.show' 'new'}}{{i18n admin.users.nav.new}}{{/link-to}}</li>
|
||||
{{#if siteSettings.must_approve_users}}
|
||||
<li>{{#link-to 'adminUsersList.show' 'pending'}}{{i18n admin.users.nav.pending}}{{/link-to}}</li>
|
||||
{{/if}}
|
||||
<li>{{#link-to 'adminUsersList.admins'}}{{i18n admin.users.nav.admins}}{{/link-to}}</li>
|
||||
<li>{{#link-to 'adminUsersList.moderators'}}{{i18n admin.users.nav.moderators}}{{/link-to}}</li>
|
||||
<li>{{#link-to 'adminUsersList.suspended'}}{{i18n admin.users.nav.suspended}}{{/link-to}}</li>
|
||||
<li>{{#link-to 'adminUsersList.blocked'}}{{i18n admin.users.nav.blocked}}{{/link-to}}</li>
|
||||
<li>{{#link-to 'adminUsersList.show' 'admins'}}{{i18n admin.users.nav.admins}}{{/link-to}}</li>
|
||||
<li>{{#link-to 'adminUsersList.show' 'moderators'}}{{i18n admin.users.nav.moderators}}{{/link-to}}</li>
|
||||
<li>{{#link-to 'adminUsersList.show' 'suspended'}}{{i18n admin.users.nav.suspended}}{{/link-to}}</li>
|
||||
<li>{{#link-to 'adminUsersList.show' 'blocked'}}{{i18n admin.users.nav.blocked}}{{/link-to}}</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class='username controls'>
|
||||
{{text-field value=username placeholder=searchHint}}
|
||||
</div>
|
||||
<div class="pull-right">
|
||||
<button {{action "exportUsers"}} class="btn" title="{{i18n admin.export_csv.users.title}}"><i class="fa fa-download"></i>{{i18n admin.export_csv.users.text}}</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="admin-container">
|
||||
{{#if hasSelection}}
|
||||
<div id='selected-controls'>
|
||||
<button {{action "approveUsers"}} class='btn'>{{countI18n admin.users.approved_selected countBinding="selectedCount"}}</button>
|
||||
<button {{action "rejectUsers"}} class='btn btn-danger'>{{countI18n admin.users.reject_selected countBinding="selectedCount"}}</button>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
<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>
|
||||
|
||||
{{#loading-spinner condition=loading}}
|
||||
{{#if model.length}}
|
||||
<table class='table'>
|
||||
<tr>
|
||||
{{#if showApproval}}
|
||||
<th>{{view Ember.Checkbox checkedBinding="selectAll"}}</th>
|
||||
{{/if}}
|
||||
<th> </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>
|
||||
<th>{{i18n admin.user.posts_read_count}}</th>
|
||||
<th>{{i18n admin.user.time_read}}</th>
|
||||
<th>{{i18n created}}</th>
|
||||
{{#if showApproval}}
|
||||
<th>{{i18n admin.users.approved}}</th>
|
||||
{{/if}}
|
||||
<th> </th>
|
||||
</tr>
|
||||
|
||||
{{#each model}}
|
||||
<tr {{bind-attr class="selected active::not-activated"}}>
|
||||
{{#if controller.showApproval}}
|
||||
<td>
|
||||
{{#if can_approve}}
|
||||
{{view Ember.Checkbox checkedBinding="selected"}}
|
||||
{{/if}}
|
||||
</td>
|
||||
{{/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>
|
||||
<td>{{{unbound posts_read_count}}}</td>
|
||||
<td>{{{unbound time_read}}}</td>
|
||||
|
||||
<td>{{{unbound created_at_age}}}</td>
|
||||
|
||||
{{#if showApproval}}
|
||||
<td>
|
||||
{{#if approved}}
|
||||
{{i18n yes_value}}
|
||||
{{else}}
|
||||
{{i18n no_value}}
|
||||
{{/if}}
|
||||
</td>
|
||||
{{/if}}
|
||||
<td>
|
||||
{{#if admin}}<i class="fa fa-shield" title="{{i18n admin.title}}"></i>{{/if}}
|
||||
{{#if moderator}}<i class="fa fa-shield" title="{{i18n admin.moderator}}"></i>{{/if}}
|
||||
<td>
|
||||
</tr>
|
||||
{{/each}}
|
||||
|
||||
</table>
|
||||
{{else}}
|
||||
<p>{{i18n search.no_results}}</p>
|
||||
{{/if}}
|
||||
{{/loading-spinner}}
|
||||
{{outlet}}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user