FIX: change button to 'remove feature' when a topic is already featured

This commit is contained in:
Régis Hanol 2015-03-16 12:18:30 +01:00
parent df7c38dd51
commit b0abe3a9d6
3 changed files with 7 additions and 1 deletions

View File

@ -4,6 +4,7 @@ import ObjectController from 'discourse/controllers/object';
export default ObjectController.extend({
menuVisible: false,
showRecover: Em.computed.and('deleted', 'details.can_recover'),
isFeatured: Em.computed.or("pinned_at", "isBanner"),
actions: {
show: function() { this.set('menuVisible', true); },

View File

@ -29,7 +29,11 @@
{{#unless isPrivateMessage}}
{{#if visible}}
<li>
{{d-button action="showFeatureTopic" icon="bullhorn" label="topic.actions.feature" class="btn-admin"}}
{{#if isFeatured}}
{{d-button action="showFeatureTopic" icon="bullhorn" label="topic.actions.remove_feature" class="btn-admin"}}
{{else}}
{{d-button action="showFeatureTopic" icon="bullhorn" label="topic.actions.feature" class="btn-admin"}}
{{/if}}
</li>
{{/if}}
{{/unless}}

View File

@ -974,6 +974,7 @@ en:
close: "Close Topic"
auto_close: "Auto Close"
feature: "Feature Topic"
remove_feature: "Remove Feature"
make_banner: "Banner Topic"
remove_banner: "Remove Banner Topic"
pin: "Pin Topic"