From 9aa1bb3f4a3a28851bb27716288745e2c04d184f Mon Sep 17 00:00:00 2001 From: Sarah Ni Date: Tue, 4 Aug 2015 14:52:58 +1000 Subject: [PATCH] Added input for nth post for users --- assets/javascripts/initializers/extend-post-model.js.es6 | 2 +- config/locales/server.en.yml | 1 + config/settings.yml | 3 +++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/assets/javascripts/initializers/extend-post-model.js.es6 b/assets/javascripts/initializers/extend-post-model.js.es6 index 90b2dcb..a6e33cd 100644 --- a/assets/javascripts/initializers/extend-post-model.js.es6 +++ b/assets/javascripts/initializers/extend-post-model.js.es6 @@ -5,7 +5,7 @@ export default { initialize() { PostModel.reopen({ postSpecificCount: function() { - return this.get('post_number') % 2 === 0; + return this.get('post_number') === parseInt(Discourse.SiteSettings.dfp_nth_post_code); }.property('post_number') }); } diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml index 1cb7718..4559e67 100755 --- a/config/locales/server.en.yml +++ b/config/locales/server.en.yml @@ -16,6 +16,7 @@ en: dfp_size_topic_above_suggested_height_code: "Put your ad topic above suggested size height!" dfp_size_post_bottom_width_code: "Put your ad post bottom size width!" dfp_size_post_bottom_height_code: "Put your ad post bottom size height!" + dfp_nth_post_code: "Choose the Nth position for your ad to show" dfp_show_size_1_example: "leaderboard 728x90" dfp_show_size_2_example: "large rectangle 336x280" dfp_show_size_3_example: "medium rectangle 300x250" diff --git a/config/settings.yml b/config/settings.yml index cbc619e..890dd2b 100755 --- a/config/settings.yml +++ b/config/settings.yml @@ -47,6 +47,9 @@ ad_plugin: dfp_show_post_bottom: client: true default: false + dfp_nth_post_code: + client: true + default: '' dfp_show_size_1_example: client: true default: false