| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent eb5ce89 commit bbef23f
16 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,18 @@ | |||
| 1 | + @( | ||
| 2 | + shouldShowAds: Boolean, | ||
| 3 | + articleAsideOptionalSizes: Seq[String], | ||
| 4 | + isSticky: Boolean = true | ||
| 5 | + | ||
| 6 | + ) | ||
| 7 | + @import conf.switches.Switches.CommercialSwitch | ||
| 8 | + | ||
| 9 | + @if(CommercialSwitch.isSwitchedOn && shouldShowAds) { | ||
| 10 | + <div class="ad-slot-container"> | ||
| 11 | + @fragments.commercial.adSlot( | ||
| 12 | + "right", | ||
| 13 | + Seq("mpu-banner-ad"), | ||
| 14 | + Map("mobile" -> (Seq("1,1", "2,2", "300,250", "300,600", "fluid") ++ articleAsideOptionalSizes)), | ||
| 15 | + optClassNames = if (isSticky) Some("js-sticky-mpu") else None | ||
| 16 | + ){ } | ||
| 17 | + </div> | ||
| 18 | + } | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2,7 +2,7 @@ | |||
| 2 | 2 | ||
| 3 | 3 | @import common.LinkTo | |
| 4 | 4 | @import views.BodyCleaner | |
| 5 | - @import views.support.Commercial.isPaidContent | ||
| 5 | + @import views.support.Commercial.{isPaidContent, articleAsideOptionalSizes, shouldShowAds} | ||
| 6 | 6 | @import views.support.RenderClasses | |
| 7 | 7 | @import views.support.TrailCssClasses.toneClass | |
| 8 | 8 | @import conf.switches.Switches.NewHeader | |
@@ -105,9 +105,11 @@ | |||
| 105 | 105 | </div> | |
| 106 | 106 | ||
| 107 | 107 | <div class="content__secondary-column js-secondary-column" aria-hidden="true"> | |
| 108 | - <div class="ad-slot-container js-ad-slot-container"></div> | ||
| 108 | + | ||
| 109 | + @fragments.articleAsideSlot(shouldShowAds(model), articleAsideOptionalSizes) | ||
| 110 | + | ||
| 109 | 111 | @if(!isPaidContent){ | |
| 110 | - <div class="js-components-container"></div> | ||
| 112 | + <div class="js-components-container"></div> | ||
| 111 | 113 | } | |
| 112 | 114 | </div> | |
| 113 | 115 | </div> | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,7 +1,7 @@ | |||
| 1 | 1 | @import common.LinkTo | |
| 2 | 2 | @import controllers.ArticlePage | |
| 3 | 3 | @import views.BodyCleaner | |
| 4 | - @import views.support.Commercial.isPaidContent | ||
| 4 | + @import views.support.Commercial.{isPaidContent, articleAsideOptionalSizes, shouldShowAds} | ||
| 5 | 5 | @import views.support.RenderClasses | |
| 6 | 6 | ||
| 7 | 7 | @(model: ArticlePage, amp: Boolean = false)(implicit request: RequestHeader, context: _root_.model.ApplicationContext) | |
@@ -51,7 +51,9 @@ <h1 class="explore-series-video-headline"> | |||
| 51 | 51 | <div class="after-article js-after-article"></div> | |
| 52 | 52 | </div> | |
| 53 | 53 | <div class="content__secondary-column js-secondary-column" aria-hidden="true"> | |
| 54 | - <div class="ad-slot-container js-ad-slot-container"></div> | ||
| 54 | + | ||
| 55 | + @fragments.articleAsideSlot(shouldShowAds(model), articleAsideOptionalSizes, Some("js-sticky-mpu")) | ||
| 56 | + | ||
| 55 | 57 | </div> | |
| 56 | 58 | </div> | |
| 57 | 59 | </div> | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2,7 +2,7 @@ | |||
| 2 | 2 | ||
| 3 | 3 | @import common.LinkTo | |
| 4 | 4 | @import views.BodyCleaner | |
| 5 | - @import views.support.Commercial.isPaidContent | ||
| 5 | + @import views.support.Commercial.{isPaidContent, articleAsideOptionalSizes, shouldShowAds} | ||
| 6 | 6 | @import views.support.TrailCssClasses.toneClass | |
| 7 | 7 | ||
| 8 | 8 | @defining(model.article) { article => | |
@@ -47,7 +47,9 @@ | |||
| 47 | 47 | </div> | |
| 48 | 48 | ||
| 49 | 49 | <div class="content__secondary-column js-secondary-column" aria-hidden="true"> | |
| 50 | - <div class="ad-slot-container js-ad-slot-container"></div> | ||
| 50 | + | ||
| 51 | + @fragments.articleAsideSlot(shouldShowAds(model), articleAsideOptionalSizes, false) | ||
| 52 | + | ||
| 51 | 53 | </div> | |
| 52 | 54 | </div> | |
| 53 | 55 | </div> | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -224,6 +224,45 @@ import collection.JavaConversions._ | |||
| 224 | 224 | } | |
| 225 | 225 | } | |
| 226 | 226 | ||
| 227 | + scenario("Article aside MPU", ArticleComponents) { | ||
| 228 | + | ||
| 229 | + Given("I am on an article entitled '10 of the best things to do in Tallinn'") | ||
| 230 | + And("I am on the 'UK' edition") | ||
| 231 | + goTo("/travel/2017/mar/20/10-best-things-to-do-tallinn-estonia-museums-cafe-art-beer") { browser => | ||
| 232 | + import browser._ | ||
| 233 | + | ||
| 234 | + $(".ad-slot--right").length should be(1) | ||
| 235 | + val adSlotRight = $(".ad-slot--right") | ||
| 236 | + | ||
| 237 | + Then("The article-aside MPU should have the correct sizes") | ||
| 238 | + adSlotRight.getId() should be("dfp-ad--right") | ||
| 239 | + adSlotRight.getAttribute("data-mobile") should be("1,1|2,2|300,250|300,600|fluid") | ||
| 240 | + } | ||
| 241 | + | ||
| 242 | + Given("I am on an article entitled '10 of the best things to do in Tallinn'") | ||
| 243 | + And("I am on the 'US' edition") | ||
| 244 | + US("/travel/2017/mar/20/10-best-things-to-do-tallinn-estonia-museums-cafe-art-beer") { browser => | ||
| 245 | + import browser._ | ||
| 246 | + | ||
| 247 | + val adSlotRight = $(".ad-slot--right") | ||
| 248 | + | ||
| 249 | + Then("The article-aside MPU should have the correct sizes") | ||
| 250 | + adSlotRight.getId() should be("dfp-ad--right") | ||
| 251 | + adSlotRight.getAttribute("data-mobile") should be("1,1|2,2|300,250|300,600|fluid|300,1050") | ||
| 252 | + } | ||
| 253 | + | ||
| 254 | + Given("I am on an immersive article, entitled 'Health insurance woes helped elect Trump, but his cure may be more painful'") | ||
| 255 | + goTo("/us-news/2017/mar/21/pennsylvania-healthcare-donald-trump-supporters") { browser => | ||
| 256 | + import browser._ | ||
| 257 | + | ||
| 258 | + val adSlotRight = $(".ad-slot--right") | ||
| 259 | + | ||
| 260 | + Then("The article-aside MPU should not be sticky") | ||
| 261 | + adSlotRight.getId() should be("dfp-ad--right") | ||
| 262 | + adSlotRight.getAttribute("class") should not include("js-sticky-mpu") | ||
| 263 | + } | ||
| 264 | + } | ||
| 265 | + | ||
| 227 | 266 | scenario("In body pictures", ArticleComponents) { | |
| 228 | 267 | ||
| 229 | 268 | Given("I am on an article entitled 'A food revolution in Charleston, US'") | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -20,6 +20,11 @@ object Commercial { | |||
| 20 | 20 | case _ => true | |
| 21 | 21 | } | |
| 22 | 22 | ||
| 23 | + def articleAsideOptionalSizes(implicit request: RequestHeader) = Edition(request).id match { | ||
| 24 | + case "US" => Seq("300,1050") | ||
| 25 | + case _ => Seq.empty | ||
| 26 | + } | ||
| 27 | + | ||
| 23 | 28 | def glabsLink (request: RequestHeader): String = { | |
| 24 | 29 | val glabsUrlSuffix = Edition(request).id match { | |
| 25 | 30 | case "AU" => "-australia" | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -58,8 +58,8 @@ define([ | |||
| 58 | 58 | ['cm-thirdPartyTags', thirdPartyTags.init], | |
| 59 | 59 | ['cm-prepare-sonobi-tag', prepareSonobiTag.init, true], | |
| 60 | 60 | ['cm-prepare-switch-tag', prepareSwitchTag.init, true], | |
| 61 | - ['cm-prepare-googletag', prepareGoogletag.init, true], | ||
| 62 | 61 | ['cm-articleAsideAdverts', articleAsideAdverts.init, true], | |
| 62 | + ['cm-prepare-googletag', prepareGoogletag.init, true], | ||
| 63 | 63 | ['cm-articleBodyAdverts', articleBodyAdverts.init, true], | |
| 64 | 64 | ['cm-liveblogAdverts', liveblogAdverts.init, true], | |
| 65 | 65 | ['cm-closeDisabledSlots', closeDisabledSlots.init], | |
| Back | FazBrowse Home | New Git URL |
0 commit comments