equal
deleted
inserted
replaced
|
1 package sqwl.cms.layout |
|
2 |
|
3 import scalatags.Text.all._ |
|
4 import scalatags.Text.{TypedTag, tags2} |
|
5 import sqwl.cms._ |
|
6 |
|
7 object ArticlesInCategory extends config { |
|
8 def apply(cnt: iContent, st: ViewState): Option[TypedTag[String]] = |
|
9 st match { |
|
10 case ViewCategory(c) => |
|
11 val l = cnt.articlesByCategory(c) |
|
12 Some(tags2.section( |
|
13 ul(l.map(art => |
|
14 li(a(href:=s"/${http.prefix}/${art.pathSegment}", art.title)) |
|
15 )), |
|
16 if (l.isEmpty) "V této kategorii není ještě článek." else "" |
|
17 )) |
|
18 case _ => None |
|
19 } |
|
20 } |