mirror of
https://github.com/discourse/discourse.git
synced 2024-12-03 11:23:40 +08:00
34 lines
834 B
JavaScript
34 lines
834 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,
|
|
|
|
showApproval: function() {
|
|
return Discourse.SiteSettings.must_approve_users;
|
|
}.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');
|
|
}
|
|
}
|
|
|
|
});
|