Hide report icon on SPV if author is current user

This commit is contained in:
Lukas Matt 2014-06-17 12:23:54 -04:00
parent dec7ef667e
commit 10117b81b3
2 changed files with 16 additions and 4 deletions

View file

@ -7,6 +7,12 @@ app.views.SinglePostActions = app.views.Feedback.extend({
}, app.views.Feedback.prototype.events); }, app.views.Feedback.prototype.events);
}, },
presenter: function() {
return _.extend(this.defaultPresenter(), {
authorIsNotCurrentUser : this.authorIsNotCurrentUser(),
})
},
renderPluginWidgets : function() { renderPluginWidgets : function() {
app.views.Base.prototype.renderPluginWidgets.apply(this); app.views.Base.prototype.renderPluginWidgets.apply(this);
this.$('a').tooltip({placement: 'bottom'}); this.$('a').tooltip({placement: 'bottom'});
@ -16,6 +22,10 @@ app.views.SinglePostActions = app.views.Feedback.extend({
$('.comment_stream .comment_box').focus(); $('.comment_stream .comment_box').focus();
$('html,body').animate({scrollTop: $('.comment_stream .comment_box').offset().top - ($('.comment_stream .comment_box').height() + 20)}); $('html,body').animate({scrollTop: $('.comment_stream .comment_box').offset().top - ($('.comment_stream .comment_box').height() + 20)});
return false; return false;
},
authorIsNotCurrentUser: function() {
return app.currentUser.authenticated() && this.model.get("author").id != app.user().id
} }
}); });

View file

@ -23,9 +23,11 @@
</a> </a>
{{/if}} {{/if}}
{{/if}} {{/if}}
<a href="#" data-type="post" class="post_report" title="{{t "report.name"}}"> {{#if authorIsNotCurrentUser}}
<i class="entypo gray large">&#x21;</i> <a href="#" data-type="post" class="post_report" title="{{t "report.name"}}">
</a> <i class="entypo gray large">&#x21;</i>
</a>
{{/if}}
{{/if}} {{/if}}
</div> </div>