| author | Tomas Zeman <tzeman@volny.cz> |
| Thu, 06 Dec 2018 15:19:41 +0100 | |
| changeset 12 | e7512f9dc903 |
| child 13 | 216da61215db |
| permissions | -rw-r--r-- |
|
12
e7512f9dc903
Layout: categories, articles, primary view
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
1 |
package sqwl.cms.layout |
|
e7512f9dc903
Layout: categories, articles, primary view
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
2 |
|
|
e7512f9dc903
Layout: categories, articles, primary view
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
3 |
import scalatags.Text.all._ |
|
e7512f9dc903
Layout: categories, articles, primary view
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
4 |
import scalatags.Text.{TypedTag, tags2}
|
|
e7512f9dc903
Layout: categories, articles, primary view
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
5 |
import sqwl.cms._ |
|
e7512f9dc903
Layout: categories, articles, primary view
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
6 |
|
|
e7512f9dc903
Layout: categories, articles, primary view
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
7 |
object PrimaryView extends config {
|
|
e7512f9dc903
Layout: categories, articles, primary view
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
8 |
def apply(cnt: iContent, st: ViewState): Option[TypedTag[String]] = |
|
e7512f9dc903
Layout: categories, articles, primary view
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
9 |
st match {
|
|
e7512f9dc903
Layout: categories, articles, primary view
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
10 |
case ViewArticle(art) => Some(tags2.section( |
|
e7512f9dc903
Layout: categories, articles, primary view
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
11 |
h1(a(href:=s"/${http.prefix}/${art.pathSegment}", art.title)),
|
|
e7512f9dc903
Layout: categories, articles, primary view
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
12 |
raw(art.htmlContent) |
|
e7512f9dc903
Layout: categories, articles, primary view
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
13 |
)) |
|
e7512f9dc903
Layout: categories, articles, primary view
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
14 |
case _ => None |
|
e7512f9dc903
Layout: categories, articles, primary view
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
15 |
} |
|
e7512f9dc903
Layout: categories, articles, primary view
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
16 |
|
|
e7512f9dc903
Layout: categories, articles, primary view
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
17 |
} |