mirror of
https://github.com/osmarks/mycorrhiza.git
synced 2024-12-12 13:30:26 +00:00
118 lines
3.0 KiB
Go
118 lines
3.0 KiB
Go
// Code generated by qtc from "common.qtpl". DO NOT EDIT.
|
|
// See https://github.com/valyala/quicktemplate for details.
|
|
|
|
// This is the <nav> seen on top of many pages.
|
|
|
|
//line templates/common.qtpl:2
|
|
package templates
|
|
|
|
//line templates/common.qtpl:2
|
|
import (
|
|
qtio422016 "io"
|
|
|
|
qt422016 "github.com/valyala/quicktemplate"
|
|
)
|
|
|
|
//line templates/common.qtpl:2
|
|
var (
|
|
_ = qtio422016.Copy
|
|
_ = qt422016.AcquireByteBuffer
|
|
)
|
|
|
|
//line templates/common.qtpl:3
|
|
type navEntry struct {
|
|
path string
|
|
title string
|
|
}
|
|
|
|
var navEntries = []navEntry{
|
|
{"page", "Hypha"},
|
|
{"edit", "Edit"},
|
|
{"text", "Raw text"},
|
|
{"history", "History"},
|
|
{"revision", "NOT REACHED"},
|
|
{"delete-ask", "Delete"},
|
|
{"rename-ask", "Rename"},
|
|
}
|
|
|
|
//line templates/common.qtpl:18
|
|
func streamnavHTML(qw422016 *qt422016.Writer, hyphaName, navType string, revisionHash ...string) {
|
|
//line templates/common.qtpl:18
|
|
qw422016.N().S(`
|
|
<nav>
|
|
<ul>
|
|
`)
|
|
//line templates/common.qtpl:21
|
|
for _, entry := range navEntries {
|
|
//line templates/common.qtpl:22
|
|
if navType == "revision" && entry.path == "revision" {
|
|
//line templates/common.qtpl:22
|
|
qw422016.N().S(` <li><b>`)
|
|
//line templates/common.qtpl:23
|
|
qw422016.E().S(revisionHash[0])
|
|
//line templates/common.qtpl:23
|
|
qw422016.N().S(`</b></li>
|
|
`)
|
|
//line templates/common.qtpl:24
|
|
} else if navType == entry.path {
|
|
//line templates/common.qtpl:24
|
|
qw422016.N().S(` <li><b>`)
|
|
//line templates/common.qtpl:25
|
|
qw422016.E().S(entry.title)
|
|
//line templates/common.qtpl:25
|
|
qw422016.N().S(`</b></li>
|
|
`)
|
|
//line templates/common.qtpl:26
|
|
} else if entry.path != "revision" {
|
|
//line templates/common.qtpl:26
|
|
qw422016.N().S(` <li><a href="/`)
|
|
//line templates/common.qtpl:27
|
|
qw422016.E().S(entry.path)
|
|
//line templates/common.qtpl:27
|
|
qw422016.N().S(`/`)
|
|
//line templates/common.qtpl:27
|
|
qw422016.E().S(hyphaName)
|
|
//line templates/common.qtpl:27
|
|
qw422016.N().S(`">`)
|
|
//line templates/common.qtpl:27
|
|
qw422016.E().S(entry.title)
|
|
//line templates/common.qtpl:27
|
|
qw422016.N().S(`</a></li>
|
|
`)
|
|
//line templates/common.qtpl:28
|
|
}
|
|
//line templates/common.qtpl:29
|
|
}
|
|
//line templates/common.qtpl:29
|
|
qw422016.N().S(` </ul>
|
|
</nav>
|
|
`)
|
|
//line templates/common.qtpl:32
|
|
}
|
|
|
|
//line templates/common.qtpl:32
|
|
func writenavHTML(qq422016 qtio422016.Writer, hyphaName, navType string, revisionHash ...string) {
|
|
//line templates/common.qtpl:32
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
|
//line templates/common.qtpl:32
|
|
streamnavHTML(qw422016, hyphaName, navType, revisionHash...)
|
|
//line templates/common.qtpl:32
|
|
qt422016.ReleaseWriter(qw422016)
|
|
//line templates/common.qtpl:32
|
|
}
|
|
|
|
//line templates/common.qtpl:32
|
|
func navHTML(hyphaName, navType string, revisionHash ...string) string {
|
|
//line templates/common.qtpl:32
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
|
//line templates/common.qtpl:32
|
|
writenavHTML(qb422016, hyphaName, navType, revisionHash...)
|
|
//line templates/common.qtpl:32
|
|
qs422016 := string(qb422016.B)
|
|
//line templates/common.qtpl:32
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
|
//line templates/common.qtpl:32
|
|
return qs422016
|
|
//line templates/common.qtpl:32
|
|
}
|