package sqwl.cms.layout
import scalatags.Text.all._
import scalatags.Text.{TypedTag, tags2}
import sqwl.cms._
object PrimaryView extends config with UrlScheme {
def apply(cnt: iContent, st: ViewState): Option[TypedTag[String]] =
st match {
case ViewArticle(art) => Some(tags2.section(
h1(a(href:=s"/${http.prefix}/${art.pathSegment}", art.title)),
div(cls:="row", div(cls:="col-md-12", art.tags.map(t =>
a(href:=s"/${http.prefix}/$TAG/${t.pathSegment}", cls:="tag",
t.name)))),
raw(art.htmlContent)
))
case _ => None
}
}