mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Fix javascript regression with quoting
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
(function() {
|
||||
|
||||
window.Discourse.AdminCustomizeController = Ember.Controller.extend({
|
||||
|
||||
newCustomization: function() {
|
||||
var item;
|
||||
item = Discourse.SiteCustomization.create({
|
||||
@@ -9,12 +10,15 @@
|
||||
this.get('content').pushObject(item);
|
||||
return this.set('content.selectedItem', item);
|
||||
},
|
||||
|
||||
selectStyle: function(style) {
|
||||
return this.set('content.selectedItem', style);
|
||||
},
|
||||
|
||||
save: function() {
|
||||
return this.get('content.selectedItem').save();
|
||||
},
|
||||
|
||||
"delete": function() {
|
||||
var _this = this;
|
||||
return bootbox.confirm(Em.String.i18n("admin.customize.delete_confirm"), Em.String.i18n("no_value"), Em.String.i18n("yes_value"), function(result) {
|
||||
@@ -27,6 +31,7 @@
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}).call(this);
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
window.Discourse.AdminDashboardController = Ember.Controller.extend({
|
||||
loading: true,
|
||||
versionCheck: null,
|
||||
|
||||
upToDate: (function() {
|
||||
if (this.versionCheck) {
|
||||
return this.versionCheck.latest_version === this.versionCheck.installed_version;
|
||||
@@ -10,6 +11,7 @@
|
||||
return true;
|
||||
}
|
||||
}).property('versionCheck'),
|
||||
|
||||
updateIconClasses: (function() {
|
||||
var classes;
|
||||
classes = "icon icon-warning-sign ";
|
||||
@@ -20,6 +22,7 @@
|
||||
}
|
||||
return classes;
|
||||
}).property('versionCheck'),
|
||||
|
||||
priorityClass: (function() {
|
||||
if (this.get('versionCheck.critical_updates')) {
|
||||
return 'version-check critical';
|
||||
@@ -27,6 +30,7 @@
|
||||
return 'version-check normal';
|
||||
}
|
||||
}).property('versionCheck')
|
||||
|
||||
});
|
||||
|
||||
}).call(this);
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
(function() {
|
||||
|
||||
window.Discourse.AdminEmailLogsController = Ember.ArrayController.extend(Discourse.Presence, {
|
||||
|
||||
sendTestEmailDisabled: (function() {
|
||||
return this.blank('testEmailAddress');
|
||||
}).property('testEmailAddress'),
|
||||
|
||||
sendTestEmail: function() {
|
||||
var _this = this;
|
||||
this.set('sentTestEmail', false);
|
||||
@@ -19,6 +21,7 @@
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}).call(this);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
(function() {
|
||||
|
||||
window.Discourse.AdminFlagsController = Ember.Controller.extend({
|
||||
|
||||
clearFlags: function(item) {
|
||||
var _this = this;
|
||||
return item.clearFlags().then((function() {
|
||||
@@ -9,6 +10,7 @@
|
||||
return bootbox.alert("something went wrong");
|
||||
}));
|
||||
},
|
||||
|
||||
deletePost: function(item) {
|
||||
var _this = this;
|
||||
return item.deletePost().then((function() {
|
||||
@@ -17,12 +19,15 @@
|
||||
return bootbox.alert("something went wrong");
|
||||
}));
|
||||
},
|
||||
|
||||
adminOldFlagsView: (function() {
|
||||
return this.query === 'old';
|
||||
}).property('query'),
|
||||
|
||||
adminActiveFlagsView: (function() {
|
||||
return this.query === 'active';
|
||||
}).property('query')
|
||||
|
||||
});
|
||||
|
||||
}).call(this);
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
window.Discourse.AdminSiteSettingsController = Ember.ArrayController.extend(Discourse.Presence, {
|
||||
filter: null,
|
||||
onlyOverridden: false,
|
||||
|
||||
filteredContent: (function() {
|
||||
var filter,
|
||||
_this = this;
|
||||
@@ -32,16 +33,20 @@
|
||||
}
|
||||
});
|
||||
}).property('filter', 'content.@each', 'onlyOverridden'),
|
||||
|
||||
resetDefault: function(setting) {
|
||||
setting.set('value', setting.get('default'));
|
||||
return setting.save();
|
||||
},
|
||||
|
||||
save: function(setting) {
|
||||
return setting.save();
|
||||
},
|
||||
|
||||
cancel: function(setting) {
|
||||
return setting.resetValue();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}).call(this);
|
||||
|
||||
@@ -5,18 +5,22 @@
|
||||
query: null,
|
||||
selectAll: false,
|
||||
content: null,
|
||||
|
||||
selectAllChanged: (function() {
|
||||
var _this = this;
|
||||
return this.get('content').each(function(user) {
|
||||
return user.set('selected', _this.get('selectAll'));
|
||||
});
|
||||
}).observes('selectAll'),
|
||||
|
||||
filterUsers: Discourse.debounce(function() {
|
||||
return this.refreshUsers();
|
||||
}, 250).observes('username'),
|
||||
|
||||
orderChanged: (function() {
|
||||
return this.refreshUsers();
|
||||
}).observes('query'),
|
||||
|
||||
showApproval: (function() {
|
||||
if (!Discourse.SiteSettings.must_approve_users) {
|
||||
return false;
|
||||
@@ -28,18 +32,22 @@
|
||||
return true;
|
||||
}
|
||||
}).property('query'),
|
||||
|
||||
selectedCount: (function() {
|
||||
if (this.blank('content')) {
|
||||
return 0;
|
||||
}
|
||||
return this.get('content').filterProperty('selected').length;
|
||||
}).property('content.@each.selected'),
|
||||
|
||||
hasSelection: (function() {
|
||||
return this.get('selectedCount') > 0;
|
||||
}).property('selectedCount'),
|
||||
|
||||
refreshUsers: function() {
|
||||
return this.set('content', Discourse.AdminUser.findAll(this.get('query'), this.get('username')));
|
||||
},
|
||||
|
||||
show: function(term) {
|
||||
if (this.get('query') === term) {
|
||||
return this.refreshUsers();
|
||||
@@ -47,9 +55,11 @@
|
||||
return this.set('query', term);
|
||||
}
|
||||
},
|
||||
|
||||
approveUsers: function() {
|
||||
return Discourse.AdminUser.bulkApprove(this.get('content').filterProperty('selected'));
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}).call(this);
|
||||
|
||||
Reference in New Issue
Block a user