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