| author | Tomas Zeman <tzeman@volny.cz> |
| Thu, 06 Dec 2018 13:35:32 +0100 | |
| changeset 8 | 8e0809dad9f7 |
| parent 7 | 50a354e5bda4 |
| child 12 | e7512f9dc903 |
| permissions | -rw-r--r-- |
| 5 | 1 |
package sqwl.cms.layout |
2 |
||
| 6 | 3 |
import scalatags.Text.TypedTag |
| 5 | 4 |
import scalatags.Text.all._ |
5 |
import sqwl.cms.{ViewState, config, iContent}
|
|
6 |
||
7 |
object Navbar extends config {
|
|
8 |
||
9 |
def apply(cnt: iContent, st: ViewState): TypedTag[String] = {
|
|
10 |
||
| 6 | 11 |
/* |
| 5 | 12 |
val navMenu = ul(cls:="nav navbar-nav navbar-right", |
13 |
li(a(href:="#about", "O aplikaci")) |
|
14 |
) |
|
| 6 | 15 |
*/ |
| 5 | 16 |
|
17 |
val navSections = ul(cls:="nav navbar-nav navbar-section", width:="100%", |
|
18 |
cnt.categories map(c => |
|
|
8
8e0809dad9f7
Fixed links to category, article
Tomas Zeman <tzeman@volny.cz>
parents:
7
diff
changeset
|
19 |
li(cls:="text-center", a(href:=s"/${http.prefix}/${c.pathSegment}", c.name))
|
| 5 | 20 |
) |
21 |
) |
|
22 |
||
| 6 | 23 |
header(cls:="navbar navbar-default navbar-fixed-top", |
| 5 | 24 |
div(cls:="navbar-inner", |
25 |
div(cls:="container", |
|
26 |
div(cls:="navbar-header", |
|
| 6 | 27 |
button(`type`:="button", cls:="navbar-toggle collapsed", |
28 |
attr("data-toggle"):="collapse",
|
|
| 5 | 29 |
attr("data-target"):="#navbar1",
|
30 |
span(cls:="sr-only", "Navigation"), |
|
31 |
span(cls:="icon-bar"), |
|
32 |
span(cls:="icon-bar"), |
|
33 |
span(cls:="icon-bar") |
|
34 |
), |
|
35 |
a(href:="#", cls:="navbar-brand", paddingTop:=4, paddingBottom:=4, |
|
| 7 | 36 |
img(src:=s"/${http.prefix}/public/${cnt.icon._1}",
|
37 |
alt:=cnt.appTitleShort, width:=40, height:=40)), |
|
| 5 | 38 |
a(href:="#", cls:="navbar-brand visible-xs", |
| 7 | 39 |
span(cnt.appTitleShort)), |
| 5 | 40 |
a(href:="#", cls:="navbar-brand hidden-xs", |
| 7 | 41 |
span(cnt.appTitle)) |
| 6 | 42 |
) |
43 |
//tag("nav")(cls:="hidden-xs", navMenu)
|
|
| 5 | 44 |
) |
45 |
), |
|
| 6 | 46 |
div(cls:="collapse navbar-collapse", id:="navbar1", |
47 |
div(cls:="container", navSections)) |
|
| 5 | 48 |
) |
49 |
} |
|
50 |
||
51 |
} |
|
| 6 | 52 |