mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Admin flags UI shows when it's loading and when there are no results
This commit is contained in:
parent
870e59883b
commit
f0d4a38433
@ -66,6 +66,7 @@ Discourse.FlaggedPost = Discourse.Post.extend({
|
||||
Discourse.FlaggedPost.reopenClass({
|
||||
findAll: function(filter) {
|
||||
var result = Em.A();
|
||||
result.set('loading', true);
|
||||
Discourse.ajax("/admin/flags/" + filter + ".json").then(function(data) {
|
||||
var userLookup = {};
|
||||
data.users.each(function(u) {
|
||||
@ -76,6 +77,7 @@ Discourse.FlaggedPost.reopenClass({
|
||||
f.userLookup = userLookup;
|
||||
result.pushObject(f);
|
||||
});
|
||||
result.set('loading', false);
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
@ -7,6 +7,10 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{#if model.loading}}
|
||||
<div class='admin-loading'>{{i18n loading}}</div>
|
||||
{{else}}
|
||||
{{#if model.length}}
|
||||
<table class='admin-flags'>
|
||||
<thead>
|
||||
<tr>
|
||||
@ -47,3 +51,7 @@
|
||||
{{/each}}
|
||||
</tbody>
|
||||
</table>
|
||||
{{else}}
|
||||
<p>{{i18n admin.flags.no_results}}</p>
|
||||
{{/if}}
|
||||
{{/if}}
|
@ -1015,6 +1015,7 @@ en:
|
||||
flagged_by: "Flagged by"
|
||||
error: "Something went wrong"
|
||||
view_message: "view message"
|
||||
no_results: "There are no flags."
|
||||
|
||||
groups:
|
||||
title: "Groups"
|
||||
|
Loading…
Reference in New Issue
Block a user