| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -75,6 +75,7 @@ class ArticleController(contentApiClient: ContentApiClient, val controllerCompon | |||
| 75 | 75 | else ArticleHtmlPage.html(article) | |
| 76 | 76 | } | |
| 77 | 77 | ||
| 78 | + // add extra data for *.json?guui endpoint | ||
| 78 | 79 | val contentFieldsJson = if (request.isGuuiJson) List("contentFields" -> Json.toJson(ContentFields(article.article))) else List() | |
| 79 | 80 | ||
| 80 | 81 | val jsonResponse = () => List(("html", views.html.fragments.articleBody(article))) ++ contentFieldsJson | |
@@ -130,5 +131,3 @@ class ArticleController(contentApiClient: ContentApiClient, val controllerCompon | |||
| 130 | 131 | } | |
| 131 | 132 | ||
| 132 | 133 | } | |
| 133 | - | ||
| 134 | - | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -32,15 +32,15 @@ class LiveBlogController(contentApiClient: ContentApiClient, val controllerCompo | |||
| 32 | 32 | else renderPage | |
| 33 | 33 | } | |
| 34 | 34 | ||
| 35 | - def renderLiveBlogEmail(path: String): Action[AnyContent] = | ||
| 35 | + def renderEmail(path: String): Action[AnyContent] = | ||
| 36 | 36 | Action.async { implicit request => | |
| 37 | 37 | println("Rendering live blog email") | |
| 38 | 38 | mapModel(path, range = Some(ArticleBlocks)) { | |
| 39 | 39 | render(path, _) | |
| 40 | 40 | } | |
| 41 | 41 | } | |
| 42 | 42 | ||
| 43 | - def renderLiveBlog(path: String, page: Option[String] = None, format: Option[String] = None): Action[AnyContent] = | ||
| 43 | + def renderArticle(path: String, page: Option[String] = None, format: Option[String] = None): Action[AnyContent] = | ||
| 44 | 44 | ||
| 45 | 45 | Action.async { implicit request => | |
| 46 | 46 | ||
@@ -58,7 +58,7 @@ class LiveBlogController(contentApiClient: ContentApiClient, val controllerCompo | |||
| 58 | 58 | } | |
| 59 | 59 | } | |
| 60 | 60 | ||
| 61 | - def renderLiveBlogJson(path: String, lastUpdate: Option[String], rendered: Option[Boolean], isLivePage: Option[Boolean]): Action[AnyContent] = { | ||
| 61 | + def renderJson(path: String, lastUpdate: Option[String], rendered: Option[Boolean], isLivePage: Option[Boolean]): Action[AnyContent] = { | ||
| 62 | 62 | Action.async { implicit request => | |
| 63 | 63 | ||
| 64 | 64 | println("Rendering live blog json") | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -20,10 +20,9 @@ GET /_cdn_healthcheck controllers.HealthCheck.healthCheck() | |||
| 20 | 20 | # e.g. /theguardian/2015/nov/03/mainsection | |
| 21 | 21 | GET /$publication<(theguardian|theobserver)>/$year<\d\d\d\d>/$month<\w\w\w>/$day<\d\d>/$tail<.+> controllers.PublicationController.publishedOn(publication, year, month, day, tail) | |
| 22 | 22 | ||
| 23 | - GET /$path<[^/]+/([^/]+/)?live/.*>.json controllers.LiveBlogController.renderLiveBlogJson(path, lastUpdate: Option[String], rendered: Option[Boolean], isLivePage: Option[Boolean]) | ||
| 24 | - GET /$path<[^/]+/([^/]+/)?live/.*>/email controllers.LiveBlogController.renderLiveBlogEmail(path) | ||
| 25 | - GET /$path<[^/]+/([^/]+/)?live/.*> controllers.LiveBlogController.renderLiveBlog(path, page: Option[String], format: Option[String]) | ||
| 26 | - | ||
| 23 | + GET /$path<[^/]+/([^/]+/)?live/.*>.json controllers.LiveBlogController.renderJson(path, lastUpdate: Option[String], rendered: Option[Boolean], isLivePage: Option[Boolean]) | ||
| 24 | + GET /$path<[^/]+/([^/]+/)?live/.*>/email controllers.LiveBlogController.renderEmail(path) | ||
| 25 | + GET /$path<[^/]+/([^/]+/)?live/.*> controllers.LiveBlogController.renderArticle(path, page: Option[String], format: Option[String]) | ||
| 27 | 26 | ||
| 28 | 27 | GET /*path.json controllers.ArticleController.renderJson(path) | |
| 29 | 28 | GET /*path/email controllers.ArticleController.renderEmail(path) | |
| Back | FazBrowse Home | New Git URL |
0 commit comments