diff --git a/app/assets/javascripts/app/views/single-post-viewer/single_post_actions.js b/app/assets/javascripts/app/views/single-post-viewer/single_post_actions.js index eebd39327..8dbce4adb 100644 --- a/app/assets/javascripts/app/views/single-post-viewer/single_post_actions.js +++ b/app/assets/javascripts/app/views/single-post-viewer/single_post_actions.js @@ -7,6 +7,12 @@ app.views.SinglePostActions = app.views.Feedback.extend({ }, app.views.Feedback.prototype.events); }, + presenter: function() { + return _.extend(this.defaultPresenter(), { + authorIsNotCurrentUser : this.authorIsNotCurrentUser(), + }) + }, + renderPluginWidgets : function() { app.views.Base.prototype.renderPluginWidgets.apply(this); this.$('a').tooltip({placement: 'bottom'}); @@ -16,6 +22,10 @@ app.views.SinglePostActions = app.views.Feedback.extend({ $('.comment_stream .comment_box').focus(); $('html,body').animate({scrollTop: $('.comment_stream .comment_box').offset().top - ($('.comment_stream .comment_box').height() + 20)}); return false; + }, + + authorIsNotCurrentUser: function() { + return app.currentUser.authenticated() && this.model.get("author").id != app.user().id } }); diff --git a/app/assets/templates/single-post-viewer/single-post-actions_tpl.jst.hbs b/app/assets/templates/single-post-viewer/single-post-actions_tpl.jst.hbs index be1bec2c8..908c2d4ab 100644 --- a/app/assets/templates/single-post-viewer/single-post-actions_tpl.jst.hbs +++ b/app/assets/templates/single-post-viewer/single-post-actions_tpl.jst.hbs @@ -23,9 +23,11 @@ {{/if}} {{/if}} - - - ! - + + {{#if authorIsNotCurrentUser}} + + ! + + {{/if}} {{/if}}