diff --git a/sport/app/football/controllers/MatchListController.scala b/sport/app/football/controllers/MatchListController.scala index 18c890ac456..1a22fe9a728 100644 --- a/sport/app/football/controllers/MatchListController.scala +++ b/sport/app/football/controllers/MatchListController.scala @@ -36,17 +36,18 @@ trait MatchListController extends BaseController with Requests { pageType = matchesList.pageType, matchesList = DotcomRenderingFootballDataModel.getMatchesList(matchesList.matchesGroupedByDateAndCompetition), nextPage = matchesList.nextPage, + previousPage = matchesList.previousPage, ) JsonComponent.fromWritable(model) - } else if (request.isJson) { + } else if (request.isJson) JsonComponent( "html" -> football.views.html.matchList.matchesComponent(matchesList), "next" -> Html(matchesList.nextPage.getOrElse("")), "previous" -> Html(matchesList.previousPage.getOrElse("")), "atom" -> atom.isDefined, ) - } else + else RevalidatableResult.Ok(football.views.html.matchList.matchesPage(page, matchesList, filters, atom)) } } diff --git a/sport/app/football/model/DotcomRenderingFootballDataModel.scala b/sport/app/football/model/DotcomRenderingFootballDataModel.scala index eb89738bd5a..38b1f401878 100644 --- a/sport/app/football/model/DotcomRenderingFootballDataModel.scala +++ b/sport/app/football/model/DotcomRenderingFootballDataModel.scala @@ -31,6 +31,7 @@ case class DotcomRenderingFootballDataModel( pageType: String, matchesList: Seq[MatchesByDateAndCompetition], nextPage: Option[String], + previousPage: Option[String], ) object DotcomRenderingFootballDataModel { @@ -96,14 +97,14 @@ object DotcomRenderingFootballDataModelImplicits { implicit val leagueTeamWrites: Writes[LeagueTeam] = Json.writes[LeagueTeam] implicit val leagueTableEntryWrites: Writes[LeagueTableEntry] = Json.writes[LeagueTableEntry] - implicit val competitionFormat: Writes[CompetitionSummary] = new Writes[CompetitionSummary] { - def writes(competition: CompetitionSummary): JsValue = Json.obj( + implicit val competitionFormat: Writes[CompetitionSummary] = (competition: CompetitionSummary) => + Json.obj( "id" -> competition.id, "url" -> competition.url, "fullName" -> competition.fullName, "shortName" -> competition.shortName, + "nation" -> competition.nation, ) - } implicit val competitionMatchesFormat: Writes[CompetitionMatches] = Json.writes[CompetitionMatches] implicit val dateCompetitionMatchesFormat: Writes[MatchesByDateAndCompetition] = Json.writes[MatchesByDateAndCompetition] diff --git a/sport/app/football/model/model.scala b/sport/app/football/model/model.scala index 45057f23544..edd5f909991 100644 --- a/sport/app/football/model/model.scala +++ b/sport/app/football/model/model.scala @@ -11,6 +11,7 @@ trait CompetitionSummary { def url: String def fullName: String def shortName: String + def nation: String } /** @param tableDividers