diff --git a/assets/javascripts/discourse/components/codefund-ad.js.es6 b/assets/javascripts/discourse/components/codefund-ad.js.es6 index 666a0e3..b45ffba 100644 --- a/assets/javascripts/discourse/components/codefund-ad.js.es6 +++ b/assets/javascripts/discourse/components/codefund-ad.js.es6 @@ -26,7 +26,7 @@ function loadCodeFund() { function handler() { if (this.readyState === this.DONE) { _loaded = true; - + if (this.status === 200) { resolve(this.response); } else { @@ -95,6 +95,10 @@ export default Ember.Component.extend({ displayTopicListTop: function() { return this.get('placement') === 'topic-list-top'; - }.property('placement') + }.property('placement'), + + hasAd: function() { + return ((this.get('adDetails.description') || '').length > 0); + }.property('adDetails') }); diff --git a/assets/javascripts/discourse/templates/components/codefund-ad.hbs b/assets/javascripts/discourse/templates/components/codefund-ad.hbs index e89aac2..3902d2b 100644 --- a/assets/javascripts/discourse/templates/components/codefund-ad.hbs +++ b/assets/javascripts/discourse/templates/components/codefund-ad.hbs @@ -1,29 +1,31 @@ {{#if showAd}} - {{#if site.mobileView}} - {{#if displayPostBottom}} - {{partial "components/codefund/post-bottom"}} - {{/if}} - {{#if displayTopicAbovePostStream}} - {{partial "components/codefund/topic-above-post-stream"}} - {{/if}} - {{#if displayTopicAboveSuggested}} - {{partial "components/codefund/topic-above-suggested"}} - {{/if}} - {{#if displayTopicListTop}} - {{partial "components/codefund/topic-list-top"}} - {{/if}} - {{else}} - {{#if displayPostBottom}} - {{partial "components/codefund/post-bottom"}} - {{/if}} - {{#if displayTopicAbovePostStream}} - {{partial "components/codefund/topic-above-post-stream"}} - {{/if}} - {{#if displayTopicAboveSuggested}} - {{partial "components/codefund/topic-above-suggested"}} - {{/if}} - {{#if displayTopicListTop}} - {{partial "components/codefund/topic-list-top"}} + {{#if hasAd}} + {{#if site.mobileView}} + {{#if displayPostBottom}} + {{partial "components/codefund/post-bottom"}} + {{/if}} + {{#if displayTopicAbovePostStream}} + {{partial "components/codefund/topic-above-post-stream"}} + {{/if}} + {{#if displayTopicAboveSuggested}} + {{partial "components/codefund/topic-above-suggested"}} + {{/if}} + {{#if displayTopicListTop}} + {{partial "components/codefund/topic-list-top"}} + {{/if}} + {{else}} + {{#if displayPostBottom}} + {{partial "components/codefund/post-bottom"}} + {{/if}} + {{#if displayTopicAbovePostStream}} + {{partial "components/codefund/topic-above-post-stream"}} + {{/if}} + {{#if displayTopicAboveSuggested}} + {{partial "components/codefund/topic-above-suggested"}} + {{/if}} + {{#if displayTopicListTop}} + {{partial "components/codefund/topic-list-top"}} + {{/if}} {{/if}} {{/if}} -{{/if}} +{{/if}} \ No newline at end of file