Hide report icon on SPV if author is current user
This commit is contained in:
parent
dec7ef667e
commit
10117b81b3
2 changed files with 16 additions and 4 deletions
|
|
@ -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
|
||||
}
|
||||
|
||||
});
|
||||
|
|
|
|||
|
|
@ -23,9 +23,11 @@
|
|||
</a>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
||||
<a href="#" data-type="post" class="post_report" title="{{t "report.name"}}">
|
||||
<i class="entypo gray large">!</i>
|
||||
</a>
|
||||
|
||||
{{#if authorIsNotCurrentUser}}
|
||||
<a href="#" data-type="post" class="post_report" title="{{t "report.name"}}">
|
||||
<i class="entypo gray large">!</i>
|
||||
</a>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in a new issue