2013-05-28 11:52:31 -04:00
|
|
|
/**
|
|
|
|
A controller related to viewing a user in the admin section
|
|
|
|
|
|
|
|
@class AdminUserController
|
|
|
|
@extends Discourse.ObjectController
|
|
|
|
@namespace Discourse
|
|
|
|
@module Discourse
|
|
|
|
**/
|
2013-06-25 18:39:20 -04:00
|
|
|
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){
|
2013-07-08 19:32:16 -04:00
|
|
|
bootbox.alert(I18n.t("generic_error_with_reason", {error: "http: " + e.status + " - " + e.body}));
|
2013-06-25 18:39:20 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
this.toggleTitleEdit();
|
|
|
|
}
|
2013-07-08 19:32:16 -04:00
|
|
|
});
|