package sqwl.cms
import scalatags.Text.all._
import scalatags.Text.tags2
import scalatags.Text.TypedTag
object Layout {
def apply(content: iContent, st: ViewState): TypedTag[String] = {
html(
head(
tags2.title(st match {
case ViewArticle(v) => v.title
case ViewCategory(v) => v.name
case ViewTag(v) => v.name
case Dashboard => "SQWL"
case News => "Novinky"
})
),
body(
div("foo"),
st match {
case ViewArticle(article) => div(
a(href:=article.pathSegment, article.title),
raw(article.htmlContent)
)
case _ => ""
},
div(
content.categories map(c => div(a(href:=c.pathSegment, c.name)))
)
)
)
}
}