Add ability to give users a title. Show them under usernames beside posts. Needs love from a designer.

This commit is contained in:
Neil Lalonde
2013-06-25 18:39:20 -04:00
parent a86b35c873
commit b2d300fe0b
12 changed files with 93 additions and 2 deletions

View File

@ -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();
}
});