equal
deleted
inserted
replaced
2 |
2 |
3 import scalatags.Text.all._ |
3 import scalatags.Text.all._ |
4 import scalatags.Text.{TypedTag, tags2} |
4 import scalatags.Text.{TypedTag, tags2} |
5 import sqwl.cms._ |
5 import sqwl.cms._ |
6 |
6 |
7 object PrimaryView extends config { |
7 object PrimaryView extends config with UrlScheme { |
8 def apply(cnt: iContent, st: ViewState): Option[TypedTag[String]] = |
8 def apply(cnt: iContent, st: ViewState): Option[TypedTag[String]] = |
9 st match { |
9 st match { |
10 case ViewArticle(art) => Some(tags2.section( |
10 case ViewArticle(art) => Some(tags2.section( |
11 h1(a(href:=s"/${http.prefix}/${art.pathSegment}", art.title)), |
11 h1(a(href:=s"/${http.prefix}/${art.pathSegment}", art.title)), |
|
12 div(cls:="row", art.tags.map(t => |
|
13 a(href:=s"/${http.prefix}/$TAG/${t.pathSegment}", cls:="tag", s"(${t.name})"))), |
12 raw(art.htmlContent) |
14 raw(art.htmlContent) |
13 )) |
15 )) |
14 case _ => None |
16 case _ => None |
15 } |
17 } |
16 |
18 |