| author | Tomas Zeman <tzeman@volny.cz> |
| Tue, 15 Jan 2019 12:25:19 +0100 | |
| changeset 27 | 8529ce302f7c |
| parent 7 | 50a354e5bda4 |
| child 33 | fa0f19a74283 |
| permissions | -rw-r--r-- |
|
4
1a1347e8c5be
Build modules: base, content, app; example content, minimal layout
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
1 |
package sqwl.cms |
|
1a1347e8c5be
Build modules: base, content, app; example content, minimal layout
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
2 |
|
|
1a1347e8c5be
Build modules: base, content, app; example content, minimal layout
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
3 |
import java.nio.file.Path |
|
1a1347e8c5be
Build modules: base, content, app; example content, minimal layout
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
4 |
|
|
1a1347e8c5be
Build modules: base, content, app; example content, minimal layout
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
5 |
trait Named {
|
|
1a1347e8c5be
Build modules: base, content, app; example content, minimal layout
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
6 |
def name: String |
|
1a1347e8c5be
Build modules: base, content, app; example content, minimal layout
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
7 |
} |
|
1a1347e8c5be
Build modules: base, content, app; example content, minimal layout
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
8 |
|
|
1a1347e8c5be
Build modules: base, content, app; example content, minimal layout
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
9 |
trait Navigable {
|
|
1a1347e8c5be
Build modules: base, content, app; example content, minimal layout
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
10 |
def pathSegment: String |
|
1a1347e8c5be
Build modules: base, content, app; example content, minimal layout
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
11 |
} |
|
1a1347e8c5be
Build modules: base, content, app; example content, minimal layout
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
12 |
|
|
1a1347e8c5be
Build modules: base, content, app; example content, minimal layout
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
13 |
trait iCategory extends Named with Navigable |
|
1a1347e8c5be
Build modules: base, content, app; example content, minimal layout
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
14 |
|
|
1a1347e8c5be
Build modules: base, content, app; example content, minimal layout
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
15 |
trait iTag extends Named with Navigable |
|
1a1347e8c5be
Build modules: base, content, app; example content, minimal layout
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
16 |
|
|
1a1347e8c5be
Build modules: base, content, app; example content, minimal layout
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
17 |
trait iArticle extends Navigable {
|
|
1a1347e8c5be
Build modules: base, content, app; example content, minimal layout
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
18 |
def title: String |
|
1a1347e8c5be
Build modules: base, content, app; example content, minimal layout
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
19 |
def htmlContent: String |
|
1a1347e8c5be
Build modules: base, content, app; example content, minimal layout
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
20 |
def category: Option[iCategory] |
|
1a1347e8c5be
Build modules: base, content, app; example content, minimal layout
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
21 |
def tags: Seq[iTag] |
|
1a1347e8c5be
Build modules: base, content, app; example content, minimal layout
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
22 |
def assets: Path |
|
27
8529ce302f7c
Article.rank: sort articles by category/tag w.r.t. rank
Tomas Zeman <tzeman@volny.cz>
parents:
7
diff
changeset
|
23 |
def rank: Int |
|
4
1a1347e8c5be
Build modules: base, content, app; example content, minimal layout
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
24 |
} |
|
1a1347e8c5be
Build modules: base, content, app; example content, minimal layout
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
25 |
|
|
1a1347e8c5be
Build modules: base, content, app; example content, minimal layout
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
26 |
trait iContent {
|
| 7 | 27 |
def appTitle: String |
28 |
def appTitleShort: String |
|
29 |
def icon: (String, Path) |
|
30 |
def publicAssets: Path |
|
31 |
def styleSheet: (String, Path) |
|
|
4
1a1347e8c5be
Build modules: base, content, app; example content, minimal layout
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
32 |
def articlesByTag(t: iTag): Seq[iArticle] |
|
1a1347e8c5be
Build modules: base, content, app; example content, minimal layout
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
33 |
def articlesByCategory(c: iCategory): Seq[iArticle] |
|
1a1347e8c5be
Build modules: base, content, app; example content, minimal layout
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
34 |
def tags: Seq[iTag] |
|
1a1347e8c5be
Build modules: base, content, app; example content, minimal layout
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
35 |
def categories: Seq[iCategory] |
|
1a1347e8c5be
Build modules: base, content, app; example content, minimal layout
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
36 |
def articleByPath(path: String): Option[iArticle] |
|
1a1347e8c5be
Build modules: base, content, app; example content, minimal layout
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
37 |
def categoryByPath(path: String): Option[iCategory] |
|
1a1347e8c5be
Build modules: base, content, app; example content, minimal layout
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
38 |
def tagByPath(path: String): Option[iTag] |
|
1a1347e8c5be
Build modules: base, content, app; example content, minimal layout
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
39 |
} |