mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-12-03 12:27:35 -05:00
26 lines
No EOL
702 B
JavaScript
26 lines
No EOL
702 B
JavaScript
/**
|
|
A controller related to viewing a user in the admin section
|
|
|
|
@class AdminUserController
|
|
@extends Discourse.ObjectController
|
|
@namespace Discourse
|
|
@module Discourse
|
|
**/
|
|
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(Em.String.i18n("generic_error_with_reason", {error: "http: " + e.status + " - " + e.body}));
|
|
});
|
|
|
|
this.toggleTitleEdit();
|
|
}
|
|
}); |