mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Add filter by action to staff logs page
This commit is contained in:
@@ -8,11 +8,12 @@
|
||||
**/
|
||||
Discourse.AdminLogsStaffActionLogsController = Ember.ArrayController.extend(Discourse.Presence, {
|
||||
loading: false,
|
||||
filters: null,
|
||||
|
||||
show: function() {
|
||||
show: function(filters) {
|
||||
var self = this;
|
||||
this.set('loading', true);
|
||||
Discourse.StaffActionLog.findAll().then(function(result) {
|
||||
Discourse.StaffActionLog.findAll(this.get('filters')).then(function(result) {
|
||||
self.set('content', result);
|
||||
self.set('loading', false);
|
||||
});
|
||||
@@ -20,5 +21,23 @@ Discourse.AdminLogsStaffActionLogsController = Ember.ArrayController.extend(Disc
|
||||
|
||||
toggleFullDetails: function(target) {
|
||||
target.set('showFullDetails', !target.get('showFullDetails'));
|
||||
},
|
||||
|
||||
clearFiltersClass: function() {
|
||||
if (this.get('filters') === null) {
|
||||
return 'invisible';
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
}.property('filters'),
|
||||
|
||||
clearFilters: function() {
|
||||
this.set('filters', null);
|
||||
this.show();
|
||||
},
|
||||
|
||||
filterByAction: function(action) {
|
||||
this.set('filters', {action_name: action});
|
||||
this.show();
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user