mirror of
https://github.com/discourse/discourse.git
synced 2024-11-28 06:43:45 +08:00
FIX: Private Message link was broken
This commit is contained in:
parent
f6afbcfb3a
commit
88476800f8
|
@ -14,6 +14,7 @@ Discourse.UserActivityController = Discourse.ObjectController.extend({
|
|||
(this.get('userActionType') === Discourse.UserAction.TYPES.messages_received);
|
||||
}.property('userActionType'),
|
||||
|
||||
actions: {
|
||||
composePrivateMessage: function() {
|
||||
return this.get('controllers.composer').open({
|
||||
action: Discourse.Composer.PRIVATE_MESSAGE,
|
||||
|
@ -21,6 +22,7 @@ Discourse.UserActivityController = Discourse.ObjectController.extend({
|
|||
archetypeId: 'private_message',
|
||||
draftKey: 'new_private_message'
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
privateMessagesActive: Em.computed.equal('pmView', 'index'),
|
||||
|
|
|
@ -21,6 +21,14 @@ Discourse.TopicRoute = Discourse.Route.extend({
|
|||
});
|
||||
},
|
||||
|
||||
composePrivateMessage: function(user) {
|
||||
var self = this;
|
||||
|
||||
Discourse.URL.routeTo("/users/" + user.get('username_lower') + "/private-messages").then(function () {
|
||||
self.controllerFor('userActivity').send('composePrivateMessage')
|
||||
});
|
||||
},
|
||||
|
||||
showFlags: function(post) {
|
||||
Discourse.Route.showModal(this, 'flag', post);
|
||||
this.controllerFor('flag').setProperties({ selected: null });
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
<div class='bottom'>
|
||||
{{#if bio_cooked}}<div class='bio'>{{{bio_cooked}}}</div>{{/if}}
|
||||
|
||||
<button class='btn'><i class='icon icon-envelope'></i>{{i18n user.private_message}}</button>
|
||||
<button class='btn' {{action composePrivateMessage model}}><i class='icon icon-envelope'></i>{{i18n user.private_message}}</button>
|
||||
|
||||
{{#link-to 'user' model class="btn"}}<i class='icon icon-user'></i>{{i18n user.profile}}{{/link-to}}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user