From db1f8370ee43bb07f12027511387ef238655c387 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Thu, 3 Oct 2013 15:51:12 -0400 Subject: [PATCH] Don't show private message button when not logged in --- app/assets/javascripts/discourse/routes/topic_route.js | 5 ++--- .../discourse/templates/poster_expansion.handlebars | 4 +++- app/assets/stylesheets/desktop/poster_expansion.scss | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/app/assets/javascripts/discourse/routes/topic_route.js b/app/assets/javascripts/discourse/routes/topic_route.js index 94821fc0858..b1f0ac80256 100644 --- a/app/assets/javascripts/discourse/routes/topic_route.js +++ b/app/assets/javascripts/discourse/routes/topic_route.js @@ -23,9 +23,8 @@ 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') + this.transitionTo('userPrivateMessages', user).then(function () { + self.controllerFor('userActivity').send('composePrivateMessage'); }); }, diff --git a/app/assets/javascripts/discourse/templates/poster_expansion.handlebars b/app/assets/javascripts/discourse/templates/poster_expansion.handlebars index 859871fc7d4..0f5a0c7dea5 100644 --- a/app/assets/javascripts/discourse/templates/poster_expansion.handlebars +++ b/app/assets/javascripts/discourse/templates/poster_expansion.handlebars @@ -8,7 +8,9 @@
{{#if bio_cooked}}
{{{bio_cooked}}}
{{/if}} - + {{#if can_send_private_message_to_user}} + + {{/if}} {{#link-to 'user' model class="btn"}}{{i18n user.profile}}{{/link-to}} diff --git a/app/assets/stylesheets/desktop/poster_expansion.scss b/app/assets/stylesheets/desktop/poster_expansion.scss index 8a3a62891a4..5c499a1782b 100644 --- a/app/assets/stylesheets/desktop/poster_expansion.scss +++ b/app/assets/stylesheets/desktop/poster_expansion.scss @@ -45,7 +45,7 @@ margin: 0 0 5px 0; } - button { + .btn { margin: 0 0 7px 0; } }