REFACTOR: support booting discourse with DISCOURSE_NO_CONSTANTS

This change is discussed here: https://meta.discourse.org/t/deprecating-es6-compatibility-layer/35821

Prior to this change we were not booting correctly with DISCOURSE_NO_CONSTANTS
This commit is contained in:
Sam
2015-11-21 00:14:50 +11:00
parent f5b34d5f53
commit c0b277d273
98 changed files with 380 additions and 379 deletions

View File

@ -1,5 +1,6 @@
import debounce from 'discourse/lib/debounce';
import { i18n } from 'discourse/lib/computed';
import AdminUser from 'admin/models/admin-user';
export default Ember.ArrayController.extend({
query: null,
@ -42,7 +43,7 @@ export default Ember.ArrayController.extend({
var self = this;
this.set('refreshing', true);
Discourse.AdminUser.findAll(this.get('query'), { filter: this.get('listFilter'), show_emails: this.get('showEmails') }).then(function (result) {
AdminUser.findAll(this.get('query'), { filter: this.get('listFilter'), show_emails: this.get('showEmails') }).then(function (result) {
self.set('model', result);
}).finally(function() {
self.set('refreshing', false);
@ -51,14 +52,14 @@ export default Ember.ArrayController.extend({
actions: {
approveUsers: function() {
Discourse.AdminUser.bulkApprove(this.get('model').filterProperty('selected'));
AdminUser.bulkApprove(this.get('model').filterProperty('selected'));
this._refreshUsers();
},
rejectUsers: function() {
var maxPostAge = this.siteSettings.delete_user_max_post_age;
var controller = this;
Discourse.AdminUser.bulkReject(this.get('model').filterProperty('selected')).then(function(result){
AdminUser.bulkReject(this.get('model').filterProperty('selected')).then(function(result){
var message = I18n.t("admin.users.reject_successful", {count: result.success});
if (result.failed > 0) {
message += ' ' + I18n.t("admin.users.reject_failures", {count: result.failed});