mirror of
https://github.com/discourse/discourse.git
synced 2025-05-23 14:41:25 +08:00
Ember Upgrade: 1.0
This commit is contained in:
@ -9,22 +9,25 @@
|
||||
Discourse.AdminUserController = Discourse.ObjectController.extend({
|
||||
editingTitle: false,
|
||||
|
||||
toggleTitleEdit: function() {
|
||||
this.set('editingTitle', !this.editingTitle);
|
||||
},
|
||||
|
||||
saveTitle: function() {
|
||||
Discourse.ajax("/users/" + this.get('username').toLowerCase(), {
|
||||
data: {title: this.get('title')},
|
||||
type: 'PUT'
|
||||
}).then(null, function(e){
|
||||
bootbox.alert(I18n.t("generic_error_with_reason", {error: "http: " + e.status + " - " + e.body}));
|
||||
});
|
||||
|
||||
this.toggleTitleEdit();
|
||||
},
|
||||
|
||||
showApproval: function() {
|
||||
return Discourse.SiteSettings.must_approve_users;
|
||||
}.property()
|
||||
}.property(),
|
||||
|
||||
actions: {
|
||||
toggleTitleEdit: function() {
|
||||
this.toggleProperty('editingTitle');
|
||||
},
|
||||
|
||||
saveTitle: function() {
|
||||
Discourse.ajax("/users/" + this.get('username').toLowerCase(), {
|
||||
data: {title: this.get('title')},
|
||||
type: 'PUT'
|
||||
}).then(null, function(e){
|
||||
bootbox.alert(I18n.t("generic_error_with_reason", {error: "http: " + e.status + " - " + e.body}));
|
||||
});
|
||||
|
||||
this.send('toggleTitleEdit');
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
Reference in New Issue
Block a user