1
0
mirror of https://github.com/osmarks/mycorrhiza.git synced 2024-12-16 15:00:26 +00:00
mycorrhiza/views/nav.qtpl.go

344 lines
8.4 KiB
Go
Raw Normal View History

2021-02-20 16:14:33 +00:00
// Code generated by qtc from "nav.qtpl". DO NOT EDIT.
// See https://github.com/valyala/quicktemplate for details.
//line views/nav.qtpl:1
package views
//line views/nav.qtpl:1
2021-09-06 17:46:34 +00:00
import "strings"
2021-02-20 16:14:33 +00:00
//line views/nav.qtpl:2
import "github.com/bouncepaw/mycorrhiza/cfg"
2021-02-20 16:14:33 +00:00
//line views/nav.qtpl:3
2022-04-02 16:58:57 +00:00
import "github.com/bouncepaw/mycorrhiza/backlinks"
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:4
import "github.com/bouncepaw/mycorrhiza/l18n"
//line views/nav.qtpl:5
import "github.com/bouncepaw/mycorrhiza/user"
//line views/nav.qtpl:6
import "github.com/bouncepaw/mycorrhiza/hyphae"
2021-02-20 16:14:33 +00:00
2022-03-29 20:59:36 +00:00
//line views/nav.qtpl:7
import "github.com/bouncepaw/mycorrhiza/viewutil"
//line views/nav.qtpl:9
2021-02-20 16:14:33 +00:00
import (
qtio422016 "io"
qt422016 "github.com/valyala/quicktemplate"
)
2022-03-29 20:59:36 +00:00
//line views/nav.qtpl:9
2021-02-20 16:14:33 +00:00
var (
_ = qtio422016.Copy
_ = qt422016.AcquireByteBuffer
)
2022-03-29 20:59:36 +00:00
//line views/nav.qtpl:9
2022-02-19 08:26:38 +00:00
func streamhyphaInfoEntry(qw422016 *qt422016.Writer, h hyphae.Hypha, u *user.User, action, displayText string) {
2022-03-29 20:59:36 +00:00
//line views/nav.qtpl:9
qw422016.N().S(`
`)
2022-03-29 20:59:36 +00:00
//line views/nav.qtpl:10
if u.CanProceed(action) {
2022-03-29 20:59:36 +00:00
//line views/nav.qtpl:10
qw422016.N().S(`
<li class="hypha-info__entry hypha-info__entry_`)
2022-03-29 20:59:36 +00:00
//line views/nav.qtpl:11
qw422016.E().S(action)
2022-03-29 20:59:36 +00:00
//line views/nav.qtpl:11
qw422016.N().S(`">
<a class="hypha-info__link" href="/`)
2022-03-29 20:59:36 +00:00
//line views/nav.qtpl:12
qw422016.E().S(action)
2022-03-29 20:59:36 +00:00
//line views/nav.qtpl:12
qw422016.N().S(`/`)
2022-03-29 20:59:36 +00:00
//line views/nav.qtpl:12
2022-02-03 22:29:01 +00:00
qw422016.E().S(h.CanonicalName())
2022-03-29 20:59:36 +00:00
//line views/nav.qtpl:12
qw422016.N().S(`">`)
2022-03-29 20:59:36 +00:00
//line views/nav.qtpl:12
qw422016.E().S(displayText)
2022-03-29 20:59:36 +00:00
//line views/nav.qtpl:12
qw422016.N().S(`</a>
</li>
`)
2022-03-29 20:59:36 +00:00
//line views/nav.qtpl:14
}
2022-03-29 20:59:36 +00:00
//line views/nav.qtpl:14
qw422016.N().S(`
`)
2022-03-29 20:59:36 +00:00
//line views/nav.qtpl:15
2021-02-20 16:14:33 +00:00
}
2022-03-29 20:59:36 +00:00
//line views/nav.qtpl:15
2022-02-19 08:26:38 +00:00
func writehyphaInfoEntry(qq422016 qtio422016.Writer, h hyphae.Hypha, u *user.User, action, displayText string) {
2022-03-29 20:59:36 +00:00
//line views/nav.qtpl:15
qw422016 := qt422016.AcquireWriter(qq422016)
2022-03-29 20:59:36 +00:00
//line views/nav.qtpl:15
streamhyphaInfoEntry(qw422016, h, u, action, displayText)
2022-03-29 20:59:36 +00:00
//line views/nav.qtpl:15
qt422016.ReleaseWriter(qw422016)
2022-03-29 20:59:36 +00:00
//line views/nav.qtpl:15
2021-02-20 16:14:33 +00:00
}
2022-03-29 20:59:36 +00:00
//line views/nav.qtpl:15
2022-02-19 08:26:38 +00:00
func hyphaInfoEntry(h hyphae.Hypha, u *user.User, action, displayText string) string {
2022-03-29 20:59:36 +00:00
//line views/nav.qtpl:15
qb422016 := qt422016.AcquireByteBuffer()
2022-03-29 20:59:36 +00:00
//line views/nav.qtpl:15
writehyphaInfoEntry(qb422016, h, u, action, displayText)
2022-03-29 20:59:36 +00:00
//line views/nav.qtpl:15
qs422016 := string(qb422016.B)
2022-03-29 20:59:36 +00:00
//line views/nav.qtpl:15
qt422016.ReleaseByteBuffer(qb422016)
2022-03-29 20:59:36 +00:00
//line views/nav.qtpl:15
return qs422016
2022-03-29 20:59:36 +00:00
//line views/nav.qtpl:15
2021-08-31 19:39:33 +00:00
}
2022-03-29 20:59:36 +00:00
//line views/nav.qtpl:17
func streamhyphaInfo(qw422016 *qt422016.Writer, meta viewutil.Meta, h hyphae.Hypha) {
//line views/nav.qtpl:17
2021-02-20 16:14:33 +00:00
qw422016.N().S(`
`)
2022-03-29 20:59:36 +00:00
//line views/nav.qtpl:19
u := meta.U
lc := meta.Lc
backs := backlinks.BacklinksCount(h)
2021-02-20 16:14:33 +00:00
2022-03-29 20:59:36 +00:00
//line views/nav.qtpl:22
2021-02-20 16:14:33 +00:00
qw422016.N().S(`
<nav class="hypha-info">
<ul class="hypha-info__list">
`)
//line views/nav.qtpl:25
2022-03-29 20:59:36 +00:00
streamhyphaInfoEntry(qw422016, h, u, "history", lc.Get("ui.history_link"))
2021-09-06 17:46:34 +00:00
//line views/nav.qtpl:25
qw422016.N().S(`
`)
2021-09-06 17:46:34 +00:00
//line views/nav.qtpl:26
2022-03-29 20:59:36 +00:00
streamhyphaInfoEntry(qw422016, h, u, "rename", lc.Get("ui.rename_link"))
2021-09-06 17:46:34 +00:00
//line views/nav.qtpl:26
qw422016.N().S(`
`)
2021-09-06 17:46:34 +00:00
//line views/nav.qtpl:27
2022-03-29 20:59:36 +00:00
streamhyphaInfoEntry(qw422016, h, u, "delete", lc.Get("ui.delete_link"))
2021-09-06 17:46:34 +00:00
//line views/nav.qtpl:27
qw422016.N().S(`
`)
2021-09-06 17:46:34 +00:00
//line views/nav.qtpl:28
2022-03-29 20:59:36 +00:00
streamhyphaInfoEntry(qw422016, h, u, "text", lc.Get("ui.text_link"))
2021-09-06 17:46:34 +00:00
//line views/nav.qtpl:28
qw422016.N().S(`
`)
//line views/nav.qtpl:29
2022-03-29 20:59:36 +00:00
streamhyphaInfoEntry(qw422016, h, u, "media", lc.Get("ui.media_link"))
//line views/nav.qtpl:29
2022-03-29 20:59:36 +00:00
qw422016.N().S(`
`)
//line views/nav.qtpl:30
streamhyphaInfoEntry(qw422016, h, u, "backlinks", lc.GetPlural("ui.backlinks_link", backs))
//line views/nav.qtpl:30
qw422016.N().S(`
</ul>
</nav>
2021-02-20 16:14:33 +00:00
`)
2022-03-29 20:59:36 +00:00
//line views/nav.qtpl:33
2021-02-20 16:14:33 +00:00
}
2022-03-29 20:59:36 +00:00
//line views/nav.qtpl:33
func writehyphaInfo(qq422016 qtio422016.Writer, meta viewutil.Meta, h hyphae.Hypha) {
//line views/nav.qtpl:33
2021-02-20 16:14:33 +00:00
qw422016 := qt422016.AcquireWriter(qq422016)
2022-03-29 20:59:36 +00:00
//line views/nav.qtpl:33
streamhyphaInfo(qw422016, meta, h)
2022-03-29 20:59:36 +00:00
//line views/nav.qtpl:33
2021-02-20 16:14:33 +00:00
qt422016.ReleaseWriter(qw422016)
2022-03-29 20:59:36 +00:00
//line views/nav.qtpl:33
2021-02-20 16:14:33 +00:00
}
2022-03-29 20:59:36 +00:00
//line views/nav.qtpl:33
func hyphaInfo(meta viewutil.Meta, h hyphae.Hypha) string {
//line views/nav.qtpl:33
2021-02-20 16:14:33 +00:00
qb422016 := qt422016.AcquireByteBuffer()
2022-03-29 20:59:36 +00:00
//line views/nav.qtpl:33
writehyphaInfo(qb422016, meta, h)
2022-03-29 20:59:36 +00:00
//line views/nav.qtpl:33
2021-02-20 16:14:33 +00:00
qs422016 := string(qb422016.B)
2022-03-29 20:59:36 +00:00
//line views/nav.qtpl:33
2021-02-20 16:14:33 +00:00
qt422016.ReleaseByteBuffer(qb422016)
2022-03-29 20:59:36 +00:00
//line views/nav.qtpl:33
2021-02-20 16:14:33 +00:00
return qs422016
2022-03-29 20:59:36 +00:00
//line views/nav.qtpl:33
2021-02-20 16:14:33 +00:00
}
2022-03-29 20:59:36 +00:00
//line views/nav.qtpl:35
2022-03-20 21:24:40 +00:00
func streamsiblingHyphae(qw422016 *qt422016.Writer, siblings string, lc *l18n.Localizer) {
2022-03-29 20:59:36 +00:00
//line views/nav.qtpl:35
2021-02-20 16:14:33 +00:00
qw422016.N().S(`
`)
2022-03-29 20:59:36 +00:00
//line views/nav.qtpl:36
if cfg.UseSiblingHyphaeSidebar {
2022-03-29 20:59:36 +00:00
//line views/nav.qtpl:36
qw422016.N().S(`
<aside class="sibling-hyphae layout-card">
<h2 class="sibling-hyphae__title layout-card__title">`)
2022-03-29 20:59:36 +00:00
//line views/nav.qtpl:38
qw422016.E().S(lc.Get("ui.sibling_hyphae"))
2022-03-29 20:59:36 +00:00
//line views/nav.qtpl:38
qw422016.N().S(`</h2>
2021-02-20 16:14:33 +00:00
`)
2022-03-29 20:59:36 +00:00
//line views/nav.qtpl:39
qw422016.N().S(siblings)
2022-03-29 20:59:36 +00:00
//line views/nav.qtpl:39
qw422016.N().S(`
2021-02-20 16:14:33 +00:00
</aside>
`)
2022-03-29 20:59:36 +00:00
//line views/nav.qtpl:41
}
2022-03-29 20:59:36 +00:00
//line views/nav.qtpl:41
qw422016.N().S(`
`)
2022-03-29 20:59:36 +00:00
//line views/nav.qtpl:42
2021-02-20 16:14:33 +00:00
}
2022-03-29 20:59:36 +00:00
//line views/nav.qtpl:42
2022-03-20 21:24:40 +00:00
func writesiblingHyphae(qq422016 qtio422016.Writer, siblings string, lc *l18n.Localizer) {
2022-03-29 20:59:36 +00:00
//line views/nav.qtpl:42
2021-02-20 16:14:33 +00:00
qw422016 := qt422016.AcquireWriter(qq422016)
2022-03-29 20:59:36 +00:00
//line views/nav.qtpl:42
2022-03-20 21:24:40 +00:00
streamsiblingHyphae(qw422016, siblings, lc)
2022-03-29 20:59:36 +00:00
//line views/nav.qtpl:42
2021-02-20 16:14:33 +00:00
qt422016.ReleaseWriter(qw422016)
2022-03-29 20:59:36 +00:00
//line views/nav.qtpl:42
2021-02-20 16:14:33 +00:00
}
2022-03-29 20:59:36 +00:00
//line views/nav.qtpl:42
2022-03-20 21:24:40 +00:00
func siblingHyphae(siblings string, lc *l18n.Localizer) string {
2022-03-29 20:59:36 +00:00
//line views/nav.qtpl:42
2021-02-20 16:14:33 +00:00
qb422016 := qt422016.AcquireByteBuffer()
2022-03-29 20:59:36 +00:00
//line views/nav.qtpl:42
2022-03-20 21:24:40 +00:00
writesiblingHyphae(qb422016, siblings, lc)
2022-03-29 20:59:36 +00:00
//line views/nav.qtpl:42
2021-02-20 16:14:33 +00:00
qs422016 := string(qb422016.B)
2022-03-29 20:59:36 +00:00
//line views/nav.qtpl:42
2021-02-20 16:14:33 +00:00
qt422016.ReleaseByteBuffer(qb422016)
2022-03-29 20:59:36 +00:00
//line views/nav.qtpl:42
2021-02-20 16:14:33 +00:00
return qs422016
2022-03-29 20:59:36 +00:00
//line views/nav.qtpl:42
2021-02-20 16:14:33 +00:00
}
2022-03-29 20:59:36 +00:00
//line views/nav.qtpl:44
2022-03-20 21:24:40 +00:00
func StreamSubhyphae(qw422016 *qt422016.Writer, subhyphae string, lc *l18n.Localizer) {
2022-03-29 20:59:36 +00:00
//line views/nav.qtpl:44
2021-02-20 16:14:33 +00:00
qw422016.N().S(`
`)
2022-03-29 20:59:36 +00:00
//line views/nav.qtpl:45
2021-02-20 16:14:33 +00:00
if strings.TrimSpace(subhyphae) != "" {
2022-03-29 20:59:36 +00:00
//line views/nav.qtpl:45
2021-02-20 16:14:33 +00:00
qw422016.N().S(`
<section class="subhyphae">
2021-09-06 17:46:34 +00:00
<h2 class="subhyphae__title">`)
2022-03-29 20:59:36 +00:00
//line views/nav.qtpl:47
2021-09-06 17:46:34 +00:00
qw422016.E().S(lc.Get("ui.subhyphae"))
2022-03-29 20:59:36 +00:00
//line views/nav.qtpl:47
2021-09-06 17:46:34 +00:00
qw422016.N().S(`</h2>
2021-02-20 16:14:33 +00:00
<nav class="subhyphae__nav">
<ul class="subhyphae__list">
`)
2022-03-29 20:59:36 +00:00
//line views/nav.qtpl:50
2021-02-20 16:14:33 +00:00
qw422016.N().S(subhyphae)
2022-03-29 20:59:36 +00:00
//line views/nav.qtpl:50
2021-02-20 16:14:33 +00:00
qw422016.N().S(`
</ul>
</nav>
</section>
`)
2022-03-29 20:59:36 +00:00
//line views/nav.qtpl:54
2021-02-20 16:14:33 +00:00
}
2022-03-29 20:59:36 +00:00
//line views/nav.qtpl:54
2021-02-20 16:14:33 +00:00
qw422016.N().S(`
`)
2022-03-29 20:59:36 +00:00
//line views/nav.qtpl:55
2021-02-20 16:14:33 +00:00
}
2022-03-29 20:59:36 +00:00
//line views/nav.qtpl:55
2022-03-20 21:24:40 +00:00
func WriteSubhyphae(qq422016 qtio422016.Writer, subhyphae string, lc *l18n.Localizer) {
2022-03-29 20:59:36 +00:00
//line views/nav.qtpl:55
2021-02-20 16:14:33 +00:00
qw422016 := qt422016.AcquireWriter(qq422016)
2022-03-29 20:59:36 +00:00
//line views/nav.qtpl:55
2022-03-20 21:24:40 +00:00
StreamSubhyphae(qw422016, subhyphae, lc)
2022-03-29 20:59:36 +00:00
//line views/nav.qtpl:55
2021-02-20 16:14:33 +00:00
qt422016.ReleaseWriter(qw422016)
2022-03-29 20:59:36 +00:00
//line views/nav.qtpl:55
2021-02-20 16:14:33 +00:00
}
2022-03-29 20:59:36 +00:00
//line views/nav.qtpl:55
2022-03-20 21:24:40 +00:00
func Subhyphae(subhyphae string, lc *l18n.Localizer) string {
2022-03-29 20:59:36 +00:00
//line views/nav.qtpl:55
2021-02-20 16:14:33 +00:00
qb422016 := qt422016.AcquireByteBuffer()
2022-03-29 20:59:36 +00:00
//line views/nav.qtpl:55
2022-03-20 21:24:40 +00:00
WriteSubhyphae(qb422016, subhyphae, lc)
2022-03-29 20:59:36 +00:00
//line views/nav.qtpl:55
2021-02-20 16:14:33 +00:00
qs422016 := string(qb422016.B)
2022-03-29 20:59:36 +00:00
//line views/nav.qtpl:55
2021-02-20 16:14:33 +00:00
qt422016.ReleaseByteBuffer(qb422016)
2022-03-29 20:59:36 +00:00
//line views/nav.qtpl:55
2021-02-20 16:14:33 +00:00
return qs422016
2022-03-29 20:59:36 +00:00
//line views/nav.qtpl:55
2021-02-20 16:14:33 +00:00
}
2022-04-09 11:55:55 +00:00
//line views/nav.qtpl:57
func streamcommonScripts(qw422016 *qt422016.Writer) {
//line views/nav.qtpl:57
qw422016.N().S(`
`)
//line views/nav.qtpl:58
for _, scriptPath := range cfg.CommonScripts {
//line views/nav.qtpl:58
qw422016.N().S(`
<script src="`)
//line views/nav.qtpl:59
qw422016.E().S(scriptPath)
//line views/nav.qtpl:59
qw422016.N().S(`"></script>
`)
//line views/nav.qtpl:60
}
//line views/nav.qtpl:60
qw422016.N().S(`
`)
//line views/nav.qtpl:61
}
//line views/nav.qtpl:61
func writecommonScripts(qq422016 qtio422016.Writer) {
//line views/nav.qtpl:61
qw422016 := qt422016.AcquireWriter(qq422016)
//line views/nav.qtpl:61
streamcommonScripts(qw422016)
//line views/nav.qtpl:61
qt422016.ReleaseWriter(qw422016)
//line views/nav.qtpl:61
}
//line views/nav.qtpl:61
func commonScripts() string {
//line views/nav.qtpl:61
qb422016 := qt422016.AcquireByteBuffer()
//line views/nav.qtpl:61
writecommonScripts(qb422016)
//line views/nav.qtpl:61
qs422016 := string(qb422016.B)
//line views/nav.qtpl:61
qt422016.ReleaseByteBuffer(qb422016)
//line views/nav.qtpl:61
return qs422016
//line views/nav.qtpl:61
}