base/src/sqwl/cms/layout/PrimaryView.scala
changeset 12 e7512f9dc903
child 13 216da61215db
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/base/src/sqwl/cms/layout/PrimaryView.scala	Thu Dec 06 15:19:41 2018 +0100
@@ -0,0 +1,17 @@
+package sqwl.cms.layout
+
+import scalatags.Text.all._
+import scalatags.Text.{TypedTag, tags2}
+import sqwl.cms._
+
+object PrimaryView extends config {
+  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)),
+        raw(art.htmlContent)
+      ))
+      case _ => None
+    }
+
+}