mirror of
https://github.com/discourse/discourse.git
synced 2025-05-23 12:51:24 +08:00
Add ability to give users a title. Show them under usernames beside posts. Needs love from a designer.
This commit is contained in:
@ -6,4 +6,21 @@
|
||||
@namespace Discourse
|
||||
@module Discourse
|
||||
**/
|
||||
Discourse.AdminUserController = Discourse.ObjectController.extend({});
|
||||
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();
|
||||
}
|
||||
});
|
Reference in New Issue
Block a user