in common/app/model/meta.scala [240:276]
def fromFapiContentFormat(fapiContentFormat: fapiContentFormat): ContentFormat =
ContentFormat(fapiContentFormat.design, fapiContentFormat.theme, fapiContentFormat.display)
implicit val contentFormatWrites: Writes[ContentFormat] = (format: ContentFormat) =>
Json.obj(
"design" -> format.design.toString,
"theme" -> format.theme.toString,
"display" -> format.display.toString,
)
// TODO I am sure these should be in shared code, but not aware of any at time
// of writing. Let's move it somewhere common in the future.
def parseDesign(s: String): Design =
s match {
case "ArticleDesign" => ArticleDesign
case "GalleryDesign" => GalleryDesign
case "AudioDesign" => AudioDesign
case "VideoDesign" => VideoDesign
case "ReviewDesign" => ReviewDesign
case "AnalysisDesign" => AnalysisDesign
case "CommentDesign" => CommentDesign
case "LetterDesign" => LetterDesign
case "FeatureDesign" => FeatureDesign
case "LiveBlogDesign" => LiveBlogDesign
case "DeadBlogDesign" => DeadBlogDesign
case "RecipeDesign" => RecipeDesign
case "MatchReportDesign" => MatchReportDesign
case "InterviewDesign" => InterviewDesign
case "EditorialDesign" => EditorialDesign
case "QuizDesign" => QuizDesign
case "FullPageInteractiveDesign" => FullPageInteractiveDesign
case "InteractiveDesign" => InteractiveDesign
case "PhotoEssayDesign" => PhotoEssayDesign
case "ObituaryDesign" => ObituaryDesign
case _ => ArticleDesign
}