+ @maybeAtom.map{ atom => + + @views.html.fragments.atoms.interactive(atom, shouldFence = false) + + } diff --git a/sport/app/football/views/tablesList/tablesPage.scala.html b/sport/app/football/views/tablesList/tablesPage.scala.html index 250f3e44b5a4..bd02473e2390 100644 --- a/sport/app/football/views/tablesList/tablesPage.scala.html +++ b/sport/app/football/views/tablesList/tablesPage.scala.html @@ -8,6 +8,11 @@ + @page.atom.map{ atom => + + @views.html.fragments.atoms.interactive(atom, shouldFence = false) + + } <@if(!page.singleCompetition){h1}else{h2} class="hide-on-mobile-if-localnav content__inline-section page-heading--football"> diff --git a/sport/app/football/views/wallchart/embed.scala.html b/sport/app/football/views/wallchart/embed.scala.html index d673a627db44..2e098f495397 100644 --- a/sport/app/football/views/wallchart/embed.scala.html +++ b/sport/app/football/views/wallchart/embed.scala.html @@ -8,7 +8,7 @@ - @wallchart(competition, competitionStages, next) + @wallchart(competition, competitionStages, next, None) @fragments.analytics.base()(page, request, context) diff --git a/sport/app/football/views/wallchart/page.scala.html b/sport/app/football/views/wallchart/page.scala.html index 7f495b6ac94c..9ab5816ef5ba 100644 --- a/sport/app/football/views/wallchart/page.scala.html +++ b/sport/app/football/views/wallchart/page.scala.html @@ -1,9 +1,10 @@ @import _root_.football.model.CompetitionStageLike @import model.{Competition, Page} +@import model.content.InteractiveAtom -@(page: Page, competition: Competition, competitionStages: List[CompetitionStageLike], next: Option[pa.FootballMatch])(implicit request: RequestHeader, context: model.ApplicationContext) +@(page: Page, competition: Competition, competitionStages: List[CompetitionStageLike], next: Option[pa.FootballMatch], maybeAtom: Option[InteractiveAtom])(implicit request: RequestHeader, context: model.ApplicationContext) @mainLegacy(page, Some("football")){ }{ - @wallchart(competition, competitionStages, next) + @wallchart(competition, competitionStages, next, maybeAtom) } diff --git a/sport/app/football/views/wallchart/wallchart.scala.html b/sport/app/football/views/wallchart/wallchart.scala.html index f942dd3bc231..2331287959a5 100644 --- a/sport/app/football/views/wallchart/wallchart.scala.html +++ b/sport/app/football/views/wallchart/wallchart.scala.html @@ -2,10 +2,16 @@ @import model.Competition @import conf.switches.Switches @import conf.Configuration +@import model.ApplicationContext +@import model.content.InteractiveAtom -@(competition: Competition, competitionStages: List[CompetitionStageLike], next: Option[pa.FootballMatch])(implicit request: RequestHeader) - - +@(competition: Competition, competitionStages: List[CompetitionStageLike], next: Option[pa.FootballMatch], maybeAtom: Option[InteractiveAtom])(implicit request: RequestHeader, context: ApplicationContext) + + @maybeAtom.map{ atom => + + @views.html.fragments.atoms.interactive(atom, shouldFence = false) + + } @competitionStages.map { case knockoutStage: _root_.football.model.KnockoutSpider => { diff --git a/sport/conf/routes b/sport/conf/routes index 8b5b072870ea..17241b70979f 100644 --- a/sport/conf/routes +++ b/sport/conf/routes @@ -23,8 +23,8 @@ GET /football/:tag/fixtures/more/:year/:month/:day.json GET /football/:tag/fixtures/more/:year/:month/:day football.controllers.FixturesController.moreTagFixturesFor(year, month, day, tag) GET /football/:tag/fixtures/:year/:month/:day.json football.controllers.FixturesController.tagFixturesForJson(year, month, day, tag) GET /football/:tag/fixtures/:year/:month/:day football.controllers.FixturesController.tagFixturesFor(year, month, day, tag) -GET /football/:tag/fixtures football.controllers.FixturesController.tagFixturesJson(tag) -GET /football/:tag/fixtures.json football.controllers.FixturesController.tagFixtures(tag) +GET /football/:tag/fixtures football.controllers.FixturesController.tagFixtures(tag) +GET /football/:tag/fixtures.json football.controllers.FixturesController.tagFixturesJson(tag) GET /football/results/:year/:month/:day.json football.controllers.ResultsController.allResultsForJson(year, month, day) GET /football/results/:year/:month/:day football.controllers.ResultsController.allResultsFor(year, month, day) diff --git a/sport/test/LeagueTablesFeatureTest.scala b/sport/test/LeagueTablesFeatureTest.scala index cb9f1d79ea1d..6cd441e717cf 100644 --- a/sport/test/LeagueTablesFeatureTest.scala +++ b/sport/test/LeagueTablesFeatureTest.scala @@ -18,7 +18,8 @@ import org.scalatest.matchers.should.Matchers with BeforeAndAfterAll with WithMaterializer with WithTestApplicationContext - with WithTestWsClient { + with WithTestWsClient + with WithTestContentApiClient { Feature("League Tables") { @@ -67,7 +68,11 @@ import org.scalatest.matchers.should.Matchers Scenario("Should redirect when no competition table data found") { val leagueTableController = - new LeagueTableController(testCompetitionsService, play.api.test.Helpers.stubControllerComponents()) + new LeagueTableController( + testCompetitionsService, + play.api.test.Helpers.stubControllerComponents(), + testContentApiClient, + ) val result = leagueTableController.renderCompetition("sfgsfgsfg")(FakeRequest()) status(result) should be(303) } diff --git a/sport/test/controllers/FixturesControllerTest.scala b/sport/test/controllers/FixturesControllerTest.scala index efd511379d26..e20cbf27fc80 100644 --- a/sport/test/controllers/FixturesControllerTest.scala +++ b/sport/test/controllers/FixturesControllerTest.scala @@ -17,14 +17,19 @@ import org.scalatest.matchers.should.Matchers with WithMaterializer with BeforeAndAfterAll with WithTestApplicationContext - with WithTestWsClient { + with WithTestWsClient + with WithTestContentApiClient { val fixturesUrl = "/football/fixtures" val fixtureForUrl = "/football/fixtures/2012/oct/20" val tag = "premierleague" lazy val fixturesController = - new FixturesController(testCompetitionsService, play.api.test.Helpers.stubControllerComponents()) + new FixturesController( + testCompetitionsService, + play.api.test.Helpers.stubControllerComponents(), + testContentApiClient, + ) "can load the all fixtures page" in { val result = fixturesController.allFixtures()(TestRequest()) diff --git a/sport/test/controllers/LeagueTableControllerTest.scala b/sport/test/controllers/LeagueTableControllerTest.scala index c541e4791527..2b9c30c7af1f 100644 --- a/sport/test/controllers/LeagueTableControllerTest.scala +++ b/sport/test/controllers/LeagueTableControllerTest.scala @@ -17,10 +17,15 @@ import org.scalatest.{BeforeAndAfterAll, DoNotDiscover} with BeforeAndAfterAll with WithTestApplicationContext with WithTestExecutionContext - with WithTestWsClient { + with WithTestWsClient + with WithTestContentApiClient { lazy val leagueTableController = - new LeagueTableController(testCompetitionsService, play.api.test.Helpers.stubControllerComponents()) + new LeagueTableController( + testCompetitionsService, + play.api.test.Helpers.stubControllerComponents(), + testContentApiClient, + ) "League Table Controller" should "200 when content type is table" in { val result = leagueTableController.renderLeagueTables()(TestRequest())
+ @page.atom.map{ atom => + + @views.html.fragments.atoms.interactive(atom, shouldFence = false) + + } <@if(!page.singleCompetition){h1}else{h2} class="hide-on-mobile-if-localnav content__inline-section page-heading--football"> diff --git a/sport/app/football/views/wallchart/embed.scala.html b/sport/app/football/views/wallchart/embed.scala.html index d673a627db44..2e098f495397 100644 --- a/sport/app/football/views/wallchart/embed.scala.html +++ b/sport/app/football/views/wallchart/embed.scala.html @@ -8,7 +8,7 @@ - @wallchart(competition, competitionStages, next) + @wallchart(competition, competitionStages, next, None) @fragments.analytics.base()(page, request, context) diff --git a/sport/app/football/views/wallchart/page.scala.html b/sport/app/football/views/wallchart/page.scala.html index 7f495b6ac94c..9ab5816ef5ba 100644 --- a/sport/app/football/views/wallchart/page.scala.html +++ b/sport/app/football/views/wallchart/page.scala.html @@ -1,9 +1,10 @@ @import _root_.football.model.CompetitionStageLike @import model.{Competition, Page} +@import model.content.InteractiveAtom -@(page: Page, competition: Competition, competitionStages: List[CompetitionStageLike], next: Option[pa.FootballMatch])(implicit request: RequestHeader, context: model.ApplicationContext) +@(page: Page, competition: Competition, competitionStages: List[CompetitionStageLike], next: Option[pa.FootballMatch], maybeAtom: Option[InteractiveAtom])(implicit request: RequestHeader, context: model.ApplicationContext) @mainLegacy(page, Some("football")){ }{ - @wallchart(competition, competitionStages, next) + @wallchart(competition, competitionStages, next, maybeAtom) } diff --git a/sport/app/football/views/wallchart/wallchart.scala.html b/sport/app/football/views/wallchart/wallchart.scala.html index f942dd3bc231..2331287959a5 100644 --- a/sport/app/football/views/wallchart/wallchart.scala.html +++ b/sport/app/football/views/wallchart/wallchart.scala.html @@ -2,10 +2,16 @@ @import model.Competition @import conf.switches.Switches @import conf.Configuration +@import model.ApplicationContext +@import model.content.InteractiveAtom -@(competition: Competition, competitionStages: List[CompetitionStageLike], next: Option[pa.FootballMatch])(implicit request: RequestHeader) - - +@(competition: Competition, competitionStages: List[CompetitionStageLike], next: Option[pa.FootballMatch], maybeAtom: Option[InteractiveAtom])(implicit request: RequestHeader, context: ApplicationContext) + + @maybeAtom.map{ atom => + + @views.html.fragments.atoms.interactive(atom, shouldFence = false) + + } @competitionStages.map { case knockoutStage: _root_.football.model.KnockoutSpider => { diff --git a/sport/conf/routes b/sport/conf/routes index 8b5b072870ea..17241b70979f 100644 --- a/sport/conf/routes +++ b/sport/conf/routes @@ -23,8 +23,8 @@ GET /football/:tag/fixtures/more/:year/:month/:day.json GET /football/:tag/fixtures/more/:year/:month/:day football.controllers.FixturesController.moreTagFixturesFor(year, month, day, tag) GET /football/:tag/fixtures/:year/:month/:day.json football.controllers.FixturesController.tagFixturesForJson(year, month, day, tag) GET /football/:tag/fixtures/:year/:month/:day football.controllers.FixturesController.tagFixturesFor(year, month, day, tag) -GET /football/:tag/fixtures football.controllers.FixturesController.tagFixturesJson(tag) -GET /football/:tag/fixtures.json football.controllers.FixturesController.tagFixtures(tag) +GET /football/:tag/fixtures football.controllers.FixturesController.tagFixtures(tag) +GET /football/:tag/fixtures.json football.controllers.FixturesController.tagFixturesJson(tag) GET /football/results/:year/:month/:day.json football.controllers.ResultsController.allResultsForJson(year, month, day) GET /football/results/:year/:month/:day football.controllers.ResultsController.allResultsFor(year, month, day) diff --git a/sport/test/LeagueTablesFeatureTest.scala b/sport/test/LeagueTablesFeatureTest.scala index cb9f1d79ea1d..6cd441e717cf 100644 --- a/sport/test/LeagueTablesFeatureTest.scala +++ b/sport/test/LeagueTablesFeatureTest.scala @@ -18,7 +18,8 @@ import org.scalatest.matchers.should.Matchers with BeforeAndAfterAll with WithMaterializer with WithTestApplicationContext - with WithTestWsClient { + with WithTestWsClient + with WithTestContentApiClient { Feature("League Tables") { @@ -67,7 +68,11 @@ import org.scalatest.matchers.should.Matchers Scenario("Should redirect when no competition table data found") { val leagueTableController = - new LeagueTableController(testCompetitionsService, play.api.test.Helpers.stubControllerComponents()) + new LeagueTableController( + testCompetitionsService, + play.api.test.Helpers.stubControllerComponents(), + testContentApiClient, + ) val result = leagueTableController.renderCompetition("sfgsfgsfg")(FakeRequest()) status(result) should be(303) } diff --git a/sport/test/controllers/FixturesControllerTest.scala b/sport/test/controllers/FixturesControllerTest.scala index efd511379d26..e20cbf27fc80 100644 --- a/sport/test/controllers/FixturesControllerTest.scala +++ b/sport/test/controllers/FixturesControllerTest.scala @@ -17,14 +17,19 @@ import org.scalatest.matchers.should.Matchers with WithMaterializer with BeforeAndAfterAll with WithTestApplicationContext - with WithTestWsClient { + with WithTestWsClient + with WithTestContentApiClient { val fixturesUrl = "/football/fixtures" val fixtureForUrl = "/football/fixtures/2012/oct/20" val tag = "premierleague" lazy val fixturesController = - new FixturesController(testCompetitionsService, play.api.test.Helpers.stubControllerComponents()) + new FixturesController( + testCompetitionsService, + play.api.test.Helpers.stubControllerComponents(), + testContentApiClient, + ) "can load the all fixtures page" in { val result = fixturesController.allFixtures()(TestRequest()) diff --git a/sport/test/controllers/LeagueTableControllerTest.scala b/sport/test/controllers/LeagueTableControllerTest.scala index c541e4791527..2b9c30c7af1f 100644 --- a/sport/test/controllers/LeagueTableControllerTest.scala +++ b/sport/test/controllers/LeagueTableControllerTest.scala @@ -17,10 +17,15 @@ import org.scalatest.{BeforeAndAfterAll, DoNotDiscover} with BeforeAndAfterAll with WithTestApplicationContext with WithTestExecutionContext - with WithTestWsClient { + with WithTestWsClient + with WithTestContentApiClient { lazy val leagueTableController = - new LeagueTableController(testCompetitionsService, play.api.test.Helpers.stubControllerComponents()) + new LeagueTableController( + testCompetitionsService, + play.api.test.Helpers.stubControllerComponents(), + testContentApiClient, + ) "League Table Controller" should "200 when content type is table" in { val result = leagueTableController.renderLeagueTables()(TestRequest())