Successful ads between nth post

This commit is contained in:
Sarah Ni 2015-08-04 11:25:00 +10:00
parent 648a91a6e5
commit 9e7b33f7c1
5 changed files with 16 additions and 12 deletions

BIN
.DS_Store vendored

Binary file not shown.

View File

@ -1,7 +0,0 @@
export default Ember.Model.extend({
PostSpecificCount: function() {
return this.get('post_number') % 5 === 0;
}.property('post_number'),
})

View File

@ -1,4 +1,3 @@
{{#if Discourse.PostSpecificCount}}
{{#if postSpecificCount}}
{{google-dfp-ad placement="post-bottom"}}
{{/if}}

View File

@ -0,0 +1,12 @@
import PostModel from 'discourse/models/post';
export default {
name: 'extend-post-model',
initialize() {
PostModel.reopen({
postSpecificCount: function() {
return this.get('post_number') % 2 === 0;
}.property('post_number')
});
}
};