1 package sqwl.cms.layout |
1 package sqwl.cms.layout |
2 |
2 |
|
3 import scalatags.Text.TypedTag |
3 import scalatags.Text.all._ |
4 import scalatags.Text.all._ |
4 import scalatags.Text.tags2 |
|
5 import scalatags.Text.TypedTag |
|
6 import sqwl.cms.{ViewState, config, iContent} |
5 import sqwl.cms.{ViewState, config, iContent} |
7 |
6 |
8 object Navbar extends config { |
7 object Navbar extends config { |
9 |
8 |
10 def apply(cnt: iContent, st: ViewState): TypedTag[String] = { |
9 def apply(cnt: iContent, st: ViewState): TypedTag[String] = { |
11 |
10 |
|
11 /* |
12 val navMenu = ul(cls:="nav navbar-nav navbar-right", |
12 val navMenu = ul(cls:="nav navbar-nav navbar-right", |
13 li(a(href:="#about", "O aplikaci")) |
13 li(a(href:="#about", "O aplikaci")) |
14 ) |
14 ) |
|
15 */ |
15 |
16 |
16 val navSections = ul(cls:="nav navbar-nav navbar-section", width:="100%", |
17 val navSections = ul(cls:="nav navbar-nav navbar-section", width:="100%", |
17 cnt.categories map(c => |
18 cnt.categories map(c => |
18 li(cls:="text-center", a(href:=c.pathSegment, c.name)) |
19 li(cls:="text-center", a(href:=c.pathSegment, c.name)) |
19 ) |
20 ) |
20 ) |
21 ) |
21 |
22 |
22 header(cls:="navbar navbar-default navbar-fixed-top", id:="topnavbar", |
23 header(cls:="navbar navbar-default navbar-fixed-top", |
23 div(cls:="navbar-inner", |
24 div(cls:="navbar-inner", |
24 div(cls:="container", |
25 div(cls:="container", |
25 div(cls:="navbar-header", |
26 div(cls:="navbar-header", |
26 button(`type`:="button", cls:="navbar-toggle", |
27 button(`type`:="button", cls:="navbar-toggle collapsed", |
|
28 attr("data-toggle"):="collapse", |
27 attr("data-target"):="#navbar1", |
29 attr("data-target"):="#navbar1", |
28 span(cls:="sr-only", "Navigation"), |
30 span(cls:="sr-only", "Navigation"), |
29 span(cls:="icon-bar"), |
31 span(cls:="icon-bar"), |
30 span(cls:="icon-bar"), |
32 span(cls:="icon-bar"), |
31 span(cls:="icon-bar") |
33 span(cls:="icon-bar") |
32 ), |
34 ), |
33 a(href:="#", cls:="navbar-brand", paddingTop:=4, paddingBottom:=4, |
35 a(href:="#", cls:="navbar-brand", paddingTop:=4, paddingBottom:=4, |
34 img(src:=s"/${http.prefix}/public/images/icon.png", alt:="SQWL", width:=40, height:=40)), |
36 img(src:=s"/${http.prefix}/public/images/icon.png", alt:="SQWL", |
|
37 width:=40, height:=40)), |
35 a(href:="#", cls:="navbar-brand visible-xs", |
38 a(href:="#", cls:="navbar-brand visible-xs", |
36 span("KPŽ")), |
39 span("KPŽ")), |
37 a(href:="#", cls:="navbar-brand hidden-xs", |
40 a(href:="#", cls:="navbar-brand hidden-xs", |
38 span("Kvalita pracovního života v České republice")) |
41 span("Kvalita pracovního života v České republice")) |
39 ), |
42 ) |
40 tag("nav")(cls:="hidden-xs", navMenu) |
43 //tag("nav")(cls:="hidden-xs", navMenu) |
41 ) |
44 ) |
42 ), |
45 ), |
43 div(cls:="navbar-inner hidden-xs", div(id:="navbar1", cls:="container", tag("nav")(navSections))) |
46 div(cls:="collapse navbar-collapse", id:="navbar1", |
|
47 div(cls:="container", navSections)) |
44 ) |
48 ) |
45 } |
49 } |
46 |
50 |
47 } |
51 } |
|
52 |