| author | Tomas Zeman <tomas@functionals.cz> |
| Tue, 29 Dec 2020 16:57:31 +0100 | |
| changeset 34 | 775d6da26993 |
| parent 33 | fa0f19a74283 |
| permissions | -rw-r--r-- |
| 33 | 1 |
/* |
2 |
* Copyright 2018-2020 Tomas Zeman <tomas@functionals.cz> |
|
3 |
* |
|
4 |
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
5 |
* you may not use this file except in compliance with the License. |
|
6 |
* You may obtain a copy of the License at |
|
7 |
* |
|
8 |
* http://www.apache.org/licenses/LICENSE-2.0 |
|
9 |
* |
|
10 |
* Unless required by applicable law or agreed to in writing, software |
|
11 |
* distributed under the License is distributed on an "AS IS" BASIS, |
|
12 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
13 |
* See the License for the specific language governing permissions and |
|
14 |
* limitations under the License. |
|
15 |
*/ |
|
|
4
1a1347e8c5be
Build modules: base, content, app; example content, minimal layout
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
16 |
package sqwl.cms |
|
1a1347e8c5be
Build modules: base, content, app; example content, minimal layout
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
17 |
|
|
1a1347e8c5be
Build modules: base, content, app; example content, minimal layout
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
18 |
import java.nio.file.Path |
|
1a1347e8c5be
Build modules: base, content, app; example content, minimal layout
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
19 |
|
| 33 | 20 |
import scalatags.Text.all._ |
21 |
||
|
4
1a1347e8c5be
Build modules: base, content, app; example content, minimal layout
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
22 |
trait Named {
|
|
1a1347e8c5be
Build modules: base, content, app; example content, minimal layout
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
23 |
def name: String |
|
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 Navigable {
|
|
1a1347e8c5be
Build modules: base, content, app; example content, minimal layout
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
27 |
def pathSegment: String |
|
1a1347e8c5be
Build modules: base, content, app; example content, minimal layout
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
28 |
} |
|
1a1347e8c5be
Build modules: base, content, app; example content, minimal layout
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
29 |
|
|
1a1347e8c5be
Build modules: base, content, app; example content, minimal layout
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
30 |
trait iCategory extends Named with Navigable |
|
1a1347e8c5be
Build modules: base, content, app; example content, minimal layout
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
31 |
|
|
1a1347e8c5be
Build modules: base, content, app; example content, minimal layout
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
32 |
trait iTag extends Named with Navigable |
|
1a1347e8c5be
Build modules: base, content, app; example content, minimal layout
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
33 |
|
|
1a1347e8c5be
Build modules: base, content, app; example content, minimal layout
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
34 |
trait iArticle extends Navigable {
|
|
1a1347e8c5be
Build modules: base, content, app; example content, minimal layout
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
35 |
def title: String |
| 33 | 36 |
def htmlContent: SeqFrag[Frag] |
|
4
1a1347e8c5be
Build modules: base, content, app; example content, minimal layout
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
37 |
def category: Option[iCategory] |
|
1a1347e8c5be
Build modules: base, content, app; example content, minimal layout
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
38 |
def tags: Seq[iTag] |
|
27
8529ce302f7c
Article.rank: sort articles by category/tag w.r.t. rank
Tomas Zeman <tzeman@volny.cz>
parents:
7
diff
changeset
|
39 |
def rank: Int |
|
4
1a1347e8c5be
Build modules: base, content, app; example content, minimal layout
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
40 |
} |
|
1a1347e8c5be
Build modules: base, content, app; example content, minimal layout
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
41 |
|
|
1a1347e8c5be
Build modules: base, content, app; example content, minimal layout
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
42 |
trait iContent {
|
| 7 | 43 |
def appTitle: String |
44 |
def appTitleShort: String |
|
45 |
def icon: (String, Path) |
|
46 |
def publicAssets: Path |
|
47 |
def styleSheet: (String, Path) |
|
|
4
1a1347e8c5be
Build modules: base, content, app; example content, minimal layout
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
48 |
def articlesByTag(t: iTag): Seq[iArticle] |
|
1a1347e8c5be
Build modules: base, content, app; example content, minimal layout
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
49 |
def articlesByCategory(c: iCategory): Seq[iArticle] |
|
1a1347e8c5be
Build modules: base, content, app; example content, minimal layout
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
50 |
def tags: Seq[iTag] |
|
1a1347e8c5be
Build modules: base, content, app; example content, minimal layout
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
51 |
def categories: Seq[iCategory] |
|
1a1347e8c5be
Build modules: base, content, app; example content, minimal layout
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
52 |
def articleByPath(path: String): Option[iArticle] |
|
1a1347e8c5be
Build modules: base, content, app; example content, minimal layout
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
53 |
def categoryByPath(path: String): Option[iCategory] |
|
1a1347e8c5be
Build modules: base, content, app; example content, minimal layout
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
54 |
def tagByPath(path: String): Option[iTag] |
| 33 | 55 |
def articleAssets(a: iArticle): Path |
|
4
1a1347e8c5be
Build modules: base, content, app; example content, minimal layout
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
56 |
} |