2021-09-07 19:39:22 +00:00
|
|
|
// Code generated by qtc from "nav.qtpl". DO NOT EDIT.
|
|
|
|
// See https://github.com/valyala/quicktemplate for details.
|
|
|
|
|
2022-05-02 07:06:34 +00:00
|
|
|
//line tpl/nav.qtpl:1
|
2021-09-07 19:39:22 +00:00
|
|
|
package tpl
|
|
|
|
|
2022-05-02 07:06:34 +00:00
|
|
|
//line tpl/nav.qtpl:1
|
2021-09-07 19:39:22 +00:00
|
|
|
import (
|
|
|
|
qtio422016 "io"
|
|
|
|
|
|
|
|
qt422016 "github.com/valyala/quicktemplate"
|
|
|
|
)
|
|
|
|
|
2022-05-02 07:06:34 +00:00
|
|
|
//line tpl/nav.qtpl:1
|
2021-09-07 19:39:22 +00:00
|
|
|
var (
|
|
|
|
_ = qtio422016.Copy
|
|
|
|
_ = qt422016.AcquireByteBuffer
|
|
|
|
)
|
|
|
|
|
2022-05-02 07:06:34 +00:00
|
|
|
//line tpl/nav.qtpl:2
|
2021-09-07 19:39:22 +00:00
|
|
|
type NavItem struct {
|
|
|
|
Name string
|
|
|
|
Url string
|
|
|
|
}
|
|
|
|
|
2022-05-02 07:06:34 +00:00
|
|
|
//line tpl/nav.qtpl:8
|
2021-09-07 19:39:22 +00:00
|
|
|
func StreamPrintNavItems(qw422016 *qt422016.Writer, current string, items []NavItem) {
|
2022-05-02 07:06:34 +00:00
|
|
|
//line tpl/nav.qtpl:8
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
<nav class="navbar navbar-expand-md navbar-dark fixed-top bg-dark">
|
|
|
|
<div class="container-fluid">
|
|
|
|
<div class="collapse navbar-collapse" id="navbarCollapse">
|
|
|
|
<ul class="navbar-nav me-auto mb-2 mb-md-0">
|
|
|
|
`)
|
2022-05-02 07:06:34 +00:00
|
|
|
//line tpl/nav.qtpl:13
|
2021-09-07 19:39:22 +00:00
|
|
|
for _, item := range items {
|
2022-05-02 07:06:34 +00:00
|
|
|
//line tpl/nav.qtpl:13
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
<li class="nav-item">
|
|
|
|
<a class="nav-link`)
|
2022-05-02 07:06:34 +00:00
|
|
|
//line tpl/nav.qtpl:15
|
2021-09-07 19:39:22 +00:00
|
|
|
if current == item.Name {
|
2022-05-02 07:06:34 +00:00
|
|
|
//line tpl/nav.qtpl:15
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().S(` active`)
|
2022-05-02 07:06:34 +00:00
|
|
|
//line tpl/nav.qtpl:15
|
2021-09-07 19:39:22 +00:00
|
|
|
}
|
2022-05-02 07:06:34 +00:00
|
|
|
//line tpl/nav.qtpl:15
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().S(`" href="`)
|
2022-05-02 07:06:34 +00:00
|
|
|
//line tpl/nav.qtpl:15
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.E().S(item.Url)
|
2022-05-02 07:06:34 +00:00
|
|
|
//line tpl/nav.qtpl:15
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().S(`">
|
|
|
|
`)
|
2022-05-02 07:06:34 +00:00
|
|
|
//line tpl/nav.qtpl:16
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.E().S(item.Name)
|
2022-05-02 07:06:34 +00:00
|
|
|
//line tpl/nav.qtpl:16
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
`)
|
2022-05-02 07:06:34 +00:00
|
|
|
//line tpl/nav.qtpl:19
|
2021-09-07 19:39:22 +00:00
|
|
|
}
|
2022-05-02 07:06:34 +00:00
|
|
|
//line tpl/nav.qtpl:19
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</nav>
|
|
|
|
`)
|
2022-05-02 07:06:34 +00:00
|
|
|
//line tpl/nav.qtpl:23
|
2021-09-07 19:39:22 +00:00
|
|
|
}
|
|
|
|
|
2022-05-02 07:06:34 +00:00
|
|
|
//line tpl/nav.qtpl:23
|
2021-09-07 19:39:22 +00:00
|
|
|
func WritePrintNavItems(qq422016 qtio422016.Writer, current string, items []NavItem) {
|
2022-05-02 07:06:34 +00:00
|
|
|
//line tpl/nav.qtpl:23
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
2022-05-02 07:06:34 +00:00
|
|
|
//line tpl/nav.qtpl:23
|
2021-09-07 19:39:22 +00:00
|
|
|
StreamPrintNavItems(qw422016, current, items)
|
2022-05-02 07:06:34 +00:00
|
|
|
//line tpl/nav.qtpl:23
|
2021-09-07 19:39:22 +00:00
|
|
|
qt422016.ReleaseWriter(qw422016)
|
2022-05-02 07:06:34 +00:00
|
|
|
//line tpl/nav.qtpl:23
|
2021-09-07 19:39:22 +00:00
|
|
|
}
|
|
|
|
|
2022-05-02 07:06:34 +00:00
|
|
|
//line tpl/nav.qtpl:23
|
2021-09-07 19:39:22 +00:00
|
|
|
func PrintNavItems(current string, items []NavItem) string {
|
2022-05-02 07:06:34 +00:00
|
|
|
//line tpl/nav.qtpl:23
|
2021-09-07 19:39:22 +00:00
|
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
2022-05-02 07:06:34 +00:00
|
|
|
//line tpl/nav.qtpl:23
|
2021-09-07 19:39:22 +00:00
|
|
|
WritePrintNavItems(qb422016, current, items)
|
2022-05-02 07:06:34 +00:00
|
|
|
//line tpl/nav.qtpl:23
|
2021-09-07 19:39:22 +00:00
|
|
|
qs422016 := string(qb422016.B)
|
2022-05-02 07:06:34 +00:00
|
|
|
//line tpl/nav.qtpl:23
|
2021-09-07 19:39:22 +00:00
|
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
2022-05-02 07:06:34 +00:00
|
|
|
//line tpl/nav.qtpl:23
|
2021-09-07 19:39:22 +00:00
|
|
|
return qs422016
|
2022-05-02 07:06:34 +00:00
|
|
|
//line tpl/nav.qtpl:23
|
2021-09-07 19:39:22 +00:00
|
|
|
}
|