Re-organise user page so it is easier to find interesting info split it into tabs - Introduce notifications and messages tabs - Stop couting stuff for the user page to speed up rendering - Suppress more information when viewing your own profile
41 lines
888 B
JavaScript
41 lines
888 B
JavaScript
import Draft from 'discourse/models/draft';
|
|
|
|
export default Discourse.Route.extend({
|
|
|
|
renderTemplate() {
|
|
this.render('user/messages');
|
|
},
|
|
|
|
|
|
model() {
|
|
return this.modelFor("user");
|
|
},
|
|
|
|
setupController(controller, user) {
|
|
this._super();
|
|
// Bring up a draft
|
|
const composerController = this.controllerFor("composer");
|
|
controller.set("model", user);
|
|
if (this.currentUser) {
|
|
Draft.get("new_private_message").then(function(data) {
|
|
if (data.draft) {
|
|
composerController.open({
|
|
draft: data.draft,
|
|
draftKey: "new_private_message",
|
|
ignoreIfChanged: true,
|
|
draftSequence: data.draft_sequence
|
|
});
|
|
}
|
|
});
|
|
}
|
|
},
|
|
|
|
actions: {
|
|
willTransition: function() {
|
|
this._super();
|
|
this.controllerFor('user').set('pmView', null);
|
|
return true;
|
|
}
|
|
}
|
|
});
|