FIX: only show the reply as new topic when user can actually reply as new topic

This commit is contained in:
Régis Hanol 2016-06-14 23:03:34 +02:00
parent af4391bbda
commit 0f809d4993
2 changed files with 6 additions and 3 deletions

View File

@ -6,6 +6,7 @@ export default Ember.Controller.extend({
needs: ['topic'],
title: Ember.computed.alias('controllers.topic.model.title'),
canReplyAsNewTopic: Ember.computed.alias('controllers.topic.model.details.can_reply_as_new_topic'),
@computed('type', 'postNumber')
shareTitle(type, postNumber) {

View File

@ -14,9 +14,11 @@
{{share-source source=s title=title action="share"}}
{{/each}}
<div class='reply-as-new-topic'>
<a href {{action "replyAsNewTopic"}} aria-label='{{i18n 'post.reply_as_new_topic'}}' title='{{i18n 'post.reply_as_new_topic'}}'>{{fa-icon "plus"}}{{i18n 'topic.create'}}</a>
</div>
{{#if canReplyAsNewTopic}}
<div class='reply-as-new-topic'>
<a href {{action "replyAsNewTopic"}} aria-label='{{i18n 'post.reply_as_new_topic'}}' title='{{i18n 'post.reply_as_new_topic'}}'>{{fa-icon "plus"}}{{i18n 'topic.create'}}</a>
</div>
{{/if}}
<div class='link'>
<a href {{action "close"}} aria-label='{{i18n 'share.close'}}' title='{{i18n 'share.close'}}'>{{fa-icon "close"}}</a>