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
|
|
|
|
import "net/http"
|
|
|
|
|
|
|
|
//line views/nav.qtpl:2
|
2021-09-06 17:46:34 +00:00
|
|
|
import "strings"
|
2021-02-20 16:14:33 +00:00
|
|
|
|
|
|
|
//line views/nav.qtpl:3
|
2021-12-20 21:08:21 +00:00
|
|
|
import "github.com/bouncepaw/mycorrhiza/hyphae/backlinks"
|
2021-02-20 16:14:33 +00:00
|
|
|
|
2021-08-08 19:19:55 +00:00
|
|
|
//line views/nav.qtpl:4
|
2021-12-20 21:08:21 +00:00
|
|
|
import "github.com/bouncepaw/mycorrhiza/l18n"
|
2021-08-31 19:39:33 +00:00
|
|
|
|
|
|
|
//line views/nav.qtpl:5
|
2021-12-20 21:08:21 +00:00
|
|
|
import "github.com/bouncepaw/mycorrhiza/user"
|
|
|
|
|
|
|
|
//line views/nav.qtpl:6
|
2021-08-08 19:19:55 +00:00
|
|
|
import "github.com/bouncepaw/mycorrhiza/hyphae"
|
2021-02-20 16:14:33 +00:00
|
|
|
|
2021-12-20 21:08:21 +00:00
|
|
|
//line views/nav.qtpl:8
|
2021-02-20 16:14:33 +00:00
|
|
|
import (
|
|
|
|
qtio422016 "io"
|
|
|
|
|
|
|
|
qt422016 "github.com/valyala/quicktemplate"
|
|
|
|
)
|
|
|
|
|
2021-12-20 21:08:21 +00:00
|
|
|
//line views/nav.qtpl:8
|
2021-02-20 16:14:33 +00:00
|
|
|
var (
|
|
|
|
_ = qtio422016.Copy
|
|
|
|
_ = qt422016.AcquireByteBuffer
|
|
|
|
)
|
|
|
|
|
2021-12-20 21:08:21 +00:00
|
|
|
//line views/nav.qtpl:8
|
2021-08-08 19:19:55 +00:00
|
|
|
func streamhyphaInfoEntry(qw422016 *qt422016.Writer, h *hyphae.Hypha, u *user.User, action, displayText string) {
|
2021-12-20 21:08:21 +00:00
|
|
|
//line views/nav.qtpl:8
|
2021-08-08 19:19:55 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
`)
|
2021-12-20 21:08:21 +00:00
|
|
|
//line views/nav.qtpl:9
|
2021-08-08 19:19:55 +00:00
|
|
|
if u.CanProceed(action) {
|
2021-12-20 21:08:21 +00:00
|
|
|
//line views/nav.qtpl:9
|
2021-08-08 19:19:55 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
<li class="hypha-info__entry hypha-info__entry_`)
|
2021-12-20 21:08:21 +00:00
|
|
|
//line views/nav.qtpl:10
|
2021-08-08 19:19:55 +00:00
|
|
|
qw422016.E().S(action)
|
2021-12-20 21:08:21 +00:00
|
|
|
//line views/nav.qtpl:10
|
2021-08-08 19:19:55 +00:00
|
|
|
qw422016.N().S(`">
|
|
|
|
<a class="hypha-info__link" href="/`)
|
2021-12-20 21:08:21 +00:00
|
|
|
//line views/nav.qtpl:11
|
2021-08-08 19:19:55 +00:00
|
|
|
qw422016.E().S(action)
|
2021-12-20 21:08:21 +00:00
|
|
|
//line views/nav.qtpl:11
|
2021-08-08 19:19:55 +00:00
|
|
|
qw422016.N().S(`/`)
|
2021-12-20 21:08:21 +00:00
|
|
|
//line views/nav.qtpl:11
|
2021-08-08 19:19:55 +00:00
|
|
|
qw422016.E().S(h.Name)
|
2021-12-20 21:08:21 +00:00
|
|
|
//line views/nav.qtpl:11
|
2021-08-08 19:19:55 +00:00
|
|
|
qw422016.N().S(`">`)
|
2021-12-20 21:08:21 +00:00
|
|
|
//line views/nav.qtpl:11
|
2021-08-08 19:19:55 +00:00
|
|
|
qw422016.E().S(displayText)
|
2021-12-20 21:08:21 +00:00
|
|
|
//line views/nav.qtpl:11
|
2021-08-08 19:19:55 +00:00
|
|
|
qw422016.N().S(`</a>
|
|
|
|
</li>
|
|
|
|
`)
|
2021-12-20 21:08:21 +00:00
|
|
|
//line views/nav.qtpl:13
|
2021-08-08 19:19:55 +00:00
|
|
|
}
|
2021-12-20 21:08:21 +00:00
|
|
|
//line views/nav.qtpl:13
|
2021-08-08 19:19:55 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
`)
|
2021-12-20 21:08:21 +00:00
|
|
|
//line views/nav.qtpl:14
|
2021-02-20 16:14:33 +00:00
|
|
|
}
|
|
|
|
|
2021-12-20 21:08:21 +00:00
|
|
|
//line views/nav.qtpl:14
|
2021-08-08 19:19:55 +00:00
|
|
|
func writehyphaInfoEntry(qq422016 qtio422016.Writer, h *hyphae.Hypha, u *user.User, action, displayText string) {
|
2021-12-20 21:08:21 +00:00
|
|
|
//line views/nav.qtpl:14
|
2021-08-08 19:19:55 +00:00
|
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
2021-12-20 21:08:21 +00:00
|
|
|
//line views/nav.qtpl:14
|
2021-08-08 19:19:55 +00:00
|
|
|
streamhyphaInfoEntry(qw422016, h, u, action, displayText)
|
2021-12-20 21:08:21 +00:00
|
|
|
//line views/nav.qtpl:14
|
2021-08-08 19:19:55 +00:00
|
|
|
qt422016.ReleaseWriter(qw422016)
|
2021-12-20 21:08:21 +00:00
|
|
|
//line views/nav.qtpl:14
|
2021-02-20 16:14:33 +00:00
|
|
|
}
|
|
|
|
|
2021-12-20 21:08:21 +00:00
|
|
|
//line views/nav.qtpl:14
|
2021-08-08 19:19:55 +00:00
|
|
|
func hyphaInfoEntry(h *hyphae.Hypha, u *user.User, action, displayText string) string {
|
2021-12-20 21:08:21 +00:00
|
|
|
//line views/nav.qtpl:14
|
2021-08-08 19:19:55 +00:00
|
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
2021-12-20 21:08:21 +00:00
|
|
|
//line views/nav.qtpl:14
|
2021-08-08 19:19:55 +00:00
|
|
|
writehyphaInfoEntry(qb422016, h, u, action, displayText)
|
2021-12-20 21:08:21 +00:00
|
|
|
//line views/nav.qtpl:14
|
2021-08-08 19:19:55 +00:00
|
|
|
qs422016 := string(qb422016.B)
|
2021-12-20 21:08:21 +00:00
|
|
|
//line views/nav.qtpl:14
|
2021-08-08 19:19:55 +00:00
|
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
2021-12-20 21:08:21 +00:00
|
|
|
//line views/nav.qtpl:14
|
2021-08-08 19:19:55 +00:00
|
|
|
return qs422016
|
2021-12-20 21:08:21 +00:00
|
|
|
//line views/nav.qtpl:14
|
2021-08-31 19:39:33 +00:00
|
|
|
}
|
|
|
|
|
2021-12-20 21:08:21 +00:00
|
|
|
//line views/nav.qtpl:16
|
2021-08-08 19:19:55 +00:00
|
|
|
func streamhyphaInfo(qw422016 *qt422016.Writer, rq *http.Request, h *hyphae.Hypha) {
|
2021-12-20 21:08:21 +00:00
|
|
|
//line views/nav.qtpl:16
|
2021-02-20 16:14:33 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
`)
|
2021-12-20 21:08:21 +00:00
|
|
|
//line views/nav.qtpl:18
|
2021-02-20 16:14:33 +00:00
|
|
|
u := user.FromRequest(rq)
|
2021-09-06 17:46:34 +00:00
|
|
|
lc := l18n.FromRequest(rq)
|
2021-12-20 21:08:21 +00:00
|
|
|
backs := backlinks.BacklinksCount(h)
|
2021-02-20 16:14:33 +00:00
|
|
|
|
2021-12-20 21:08:21 +00:00
|
|
|
//line views/nav.qtpl:21
|
2021-02-20 16:14:33 +00:00
|
|
|
qw422016.N().S(`
|
2021-08-08 19:19:55 +00:00
|
|
|
<nav class="hypha-info">
|
|
|
|
<ul class="hypha-info__list">
|
|
|
|
`)
|
2021-09-06 17:46:34 +00:00
|
|
|
//line views/nav.qtpl:24
|
2021-12-20 21:08:21 +00:00
|
|
|
streamhyphaInfoEntry(qw422016, h, u, "history", lc.Get("ui.history_link"))
|
2021-09-06 17:46:34 +00:00
|
|
|
//line views/nav.qtpl:24
|
2021-08-08 19:19:55 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
`)
|
2021-09-06 17:46:34 +00:00
|
|
|
//line views/nav.qtpl:25
|
2021-12-20 21:08:21 +00:00
|
|
|
streamhyphaInfoEntry(qw422016, h, u, "rename-ask", lc.Get("ui.rename_link"))
|
2021-09-06 17:46:34 +00:00
|
|
|
//line views/nav.qtpl:25
|
2021-08-08 19:19:55 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
`)
|
2021-09-06 17:46:34 +00:00
|
|
|
//line views/nav.qtpl:26
|
2021-12-20 21:08:21 +00:00
|
|
|
streamhyphaInfoEntry(qw422016, h, u, "delete-ask", lc.Get("ui.delete_link"))
|
2021-09-06 17:46:34 +00:00
|
|
|
//line views/nav.qtpl:26
|
2021-08-08 19:19:55 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
`)
|
2021-09-06 17:46:34 +00:00
|
|
|
//line views/nav.qtpl:27
|
2021-12-20 21:08:21 +00:00
|
|
|
streamhyphaInfoEntry(qw422016, h, u, "text", lc.Get("ui.text_link"))
|
2021-09-06 17:46:34 +00:00
|
|
|
//line views/nav.qtpl:27
|
2021-08-31 17:27:52 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
`)
|
2021-09-06 17:46:34 +00:00
|
|
|
//line views/nav.qtpl:28
|
2021-12-20 21:08:21 +00:00
|
|
|
streamhyphaInfoEntry(qw422016, h, u, "attachment", lc.Get("ui.attachment_link"))
|
2021-09-06 17:46:34 +00:00
|
|
|
//line views/nav.qtpl:28
|
2021-12-20 21:08:21 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
`)
|
|
|
|
//line views/nav.qtpl:29
|
|
|
|
streamhyphaInfoEntry(qw422016, h, u, "backlinks", lc.GetPlural("ui.backlinks_link", backs))
|
|
|
|
//line views/nav.qtpl:29
|
2021-08-08 19:19:55 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
</ul>
|
|
|
|
</nav>
|
2021-02-20 16:14:33 +00:00
|
|
|
`)
|
2021-12-20 21:08:21 +00:00
|
|
|
//line views/nav.qtpl:32
|
2021-02-20 16:14:33 +00:00
|
|
|
}
|
|
|
|
|
2021-12-20 21:08:21 +00:00
|
|
|
//line views/nav.qtpl:32
|
2021-08-08 19:19:55 +00:00
|
|
|
func writehyphaInfo(qq422016 qtio422016.Writer, rq *http.Request, h *hyphae.Hypha) {
|
2021-12-20 21:08:21 +00:00
|
|
|
//line views/nav.qtpl:32
|
2021-02-20 16:14:33 +00:00
|
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
2021-12-20 21:08:21 +00:00
|
|
|
//line views/nav.qtpl:32
|
2021-08-08 19:19:55 +00:00
|
|
|
streamhyphaInfo(qw422016, rq, h)
|
2021-12-20 21:08:21 +00:00
|
|
|
//line views/nav.qtpl:32
|
2021-02-20 16:14:33 +00:00
|
|
|
qt422016.ReleaseWriter(qw422016)
|
2021-12-20 21:08:21 +00:00
|
|
|
//line views/nav.qtpl:32
|
2021-02-20 16:14:33 +00:00
|
|
|
}
|
|
|
|
|
2021-12-20 21:08:21 +00:00
|
|
|
//line views/nav.qtpl:32
|
2021-08-08 19:19:55 +00:00
|
|
|
func hyphaInfo(rq *http.Request, h *hyphae.Hypha) string {
|
2021-12-20 21:08:21 +00:00
|
|
|
//line views/nav.qtpl:32
|
2021-02-20 16:14:33 +00:00
|
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
2021-12-20 21:08:21 +00:00
|
|
|
//line views/nav.qtpl:32
|
2021-08-08 19:19:55 +00:00
|
|
|
writehyphaInfo(qb422016, rq, h)
|
2021-12-20 21:08:21 +00:00
|
|
|
//line views/nav.qtpl:32
|
2021-02-20 16:14:33 +00:00
|
|
|
qs422016 := string(qb422016.B)
|
2021-12-20 21:08:21 +00:00
|
|
|
//line views/nav.qtpl:32
|
2021-02-20 16:14:33 +00:00
|
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
2021-12-20 21:08:21 +00:00
|
|
|
//line views/nav.qtpl:32
|
2021-02-20 16:14:33 +00:00
|
|
|
return qs422016
|
2021-12-20 21:08:21 +00:00
|
|
|
//line views/nav.qtpl:32
|
2021-02-20 16:14:33 +00:00
|
|
|
}
|
|
|
|
|
2021-12-20 21:08:21 +00:00
|
|
|
//line views/nav.qtpl:34
|
2021-09-06 17:46:34 +00:00
|
|
|
func streamsiblingHyphaeHTML(qw422016 *qt422016.Writer, siblings string, lc *l18n.Localizer) {
|
2021-12-20 21:08:21 +00:00
|
|
|
//line views/nav.qtpl:34
|
2021-02-20 16:14:33 +00:00
|
|
|
qw422016.N().S(`
|
2021-07-12 15:23:25 +00:00
|
|
|
<aside class="sibling-hyphae layout-card">
|
2021-09-06 17:46:34 +00:00
|
|
|
<h2 class="sibling-hyphae__title layout-card__title">`)
|
2021-12-20 21:08:21 +00:00
|
|
|
//line views/nav.qtpl:36
|
2021-09-06 17:46:34 +00:00
|
|
|
qw422016.E().S(lc.Get("ui.sibling_hyphae"))
|
2021-12-20 21:08:21 +00:00
|
|
|
//line views/nav.qtpl:36
|
2021-09-06 17:46:34 +00:00
|
|
|
qw422016.N().S(`</h2>
|
2021-02-20 16:14:33 +00:00
|
|
|
`)
|
2021-12-20 21:08:21 +00:00
|
|
|
//line views/nav.qtpl:37
|
2021-07-12 15:23:25 +00:00
|
|
|
qw422016.N().S(siblings)
|
2021-12-20 21:08:21 +00:00
|
|
|
//line views/nav.qtpl:37
|
2021-02-20 16:14:33 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
</aside>
|
|
|
|
`)
|
2021-12-20 21:08:21 +00:00
|
|
|
//line views/nav.qtpl:39
|
2021-02-20 16:14:33 +00:00
|
|
|
}
|
|
|
|
|
2021-12-20 21:08:21 +00:00
|
|
|
//line views/nav.qtpl:39
|
2021-09-06 17:46:34 +00:00
|
|
|
func writesiblingHyphaeHTML(qq422016 qtio422016.Writer, siblings string, lc *l18n.Localizer) {
|
2021-12-20 21:08:21 +00:00
|
|
|
//line views/nav.qtpl:39
|
2021-02-20 16:14:33 +00:00
|
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
2021-12-20 21:08:21 +00:00
|
|
|
//line views/nav.qtpl:39
|
2021-09-06 17:46:34 +00:00
|
|
|
streamsiblingHyphaeHTML(qw422016, siblings, lc)
|
2021-12-20 21:08:21 +00:00
|
|
|
//line views/nav.qtpl:39
|
2021-02-20 16:14:33 +00:00
|
|
|
qt422016.ReleaseWriter(qw422016)
|
2021-12-20 21:08:21 +00:00
|
|
|
//line views/nav.qtpl:39
|
2021-02-20 16:14:33 +00:00
|
|
|
}
|
|
|
|
|
2021-12-20 21:08:21 +00:00
|
|
|
//line views/nav.qtpl:39
|
2021-09-06 17:46:34 +00:00
|
|
|
func siblingHyphaeHTML(siblings string, lc *l18n.Localizer) string {
|
2021-12-20 21:08:21 +00:00
|
|
|
//line views/nav.qtpl:39
|
2021-02-20 16:14:33 +00:00
|
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
2021-12-20 21:08:21 +00:00
|
|
|
//line views/nav.qtpl:39
|
2021-09-06 17:46:34 +00:00
|
|
|
writesiblingHyphaeHTML(qb422016, siblings, lc)
|
2021-12-20 21:08:21 +00:00
|
|
|
//line views/nav.qtpl:39
|
2021-02-20 16:14:33 +00:00
|
|
|
qs422016 := string(qb422016.B)
|
2021-12-20 21:08:21 +00:00
|
|
|
//line views/nav.qtpl:39
|
2021-02-20 16:14:33 +00:00
|
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
2021-12-20 21:08:21 +00:00
|
|
|
//line views/nav.qtpl:39
|
2021-02-20 16:14:33 +00:00
|
|
|
return qs422016
|
2021-12-20 21:08:21 +00:00
|
|
|
//line views/nav.qtpl:39
|
2021-02-20 16:14:33 +00:00
|
|
|
}
|
|
|
|
|
2021-12-20 21:08:21 +00:00
|
|
|
//line views/nav.qtpl:41
|
2021-09-06 17:46:34 +00:00
|
|
|
func StreamSubhyphaeHTML(qw422016 *qt422016.Writer, subhyphae string, lc *l18n.Localizer) {
|
2021-12-20 21:08:21 +00:00
|
|
|
//line views/nav.qtpl:41
|
2021-02-20 16:14:33 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
`)
|
2021-12-20 21:08:21 +00:00
|
|
|
//line views/nav.qtpl:42
|
2021-02-20 16:14:33 +00:00
|
|
|
if strings.TrimSpace(subhyphae) != "" {
|
2021-12-20 21:08:21 +00:00
|
|
|
//line views/nav.qtpl:42
|
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">`)
|
2021-12-20 21:08:21 +00:00
|
|
|
//line views/nav.qtpl:44
|
2021-09-06 17:46:34 +00:00
|
|
|
qw422016.E().S(lc.Get("ui.subhyphae"))
|
2021-12-20 21:08:21 +00:00
|
|
|
//line views/nav.qtpl:44
|
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">
|
|
|
|
`)
|
2021-12-20 21:08:21 +00:00
|
|
|
//line views/nav.qtpl:47
|
2021-02-20 16:14:33 +00:00
|
|
|
qw422016.N().S(subhyphae)
|
2021-12-20 21:08:21 +00:00
|
|
|
//line views/nav.qtpl:47
|
2021-02-20 16:14:33 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
</ul>
|
|
|
|
</nav>
|
|
|
|
</section>
|
|
|
|
`)
|
2021-12-20 21:08:21 +00:00
|
|
|
//line views/nav.qtpl:51
|
2021-02-20 16:14:33 +00:00
|
|
|
}
|
2021-12-20 21:08:21 +00:00
|
|
|
//line views/nav.qtpl:51
|
2021-02-20 16:14:33 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
`)
|
2021-12-20 21:08:21 +00:00
|
|
|
//line views/nav.qtpl:52
|
2021-02-20 16:14:33 +00:00
|
|
|
}
|
|
|
|
|
2021-12-20 21:08:21 +00:00
|
|
|
//line views/nav.qtpl:52
|
2021-09-06 17:46:34 +00:00
|
|
|
func WriteSubhyphaeHTML(qq422016 qtio422016.Writer, subhyphae string, lc *l18n.Localizer) {
|
2021-12-20 21:08:21 +00:00
|
|
|
//line views/nav.qtpl:52
|
2021-02-20 16:14:33 +00:00
|
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
2021-12-20 21:08:21 +00:00
|
|
|
//line views/nav.qtpl:52
|
2021-09-06 17:46:34 +00:00
|
|
|
StreamSubhyphaeHTML(qw422016, subhyphae, lc)
|
2021-12-20 21:08:21 +00:00
|
|
|
//line views/nav.qtpl:52
|
2021-02-20 16:14:33 +00:00
|
|
|
qt422016.ReleaseWriter(qw422016)
|
2021-12-20 21:08:21 +00:00
|
|
|
//line views/nav.qtpl:52
|
2021-02-20 16:14:33 +00:00
|
|
|
}
|
|
|
|
|
2021-12-20 21:08:21 +00:00
|
|
|
//line views/nav.qtpl:52
|
2021-09-06 17:46:34 +00:00
|
|
|
func SubhyphaeHTML(subhyphae string, lc *l18n.Localizer) string {
|
2021-12-20 21:08:21 +00:00
|
|
|
//line views/nav.qtpl:52
|
2021-02-20 16:14:33 +00:00
|
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
2021-12-20 21:08:21 +00:00
|
|
|
//line views/nav.qtpl:52
|
2021-09-06 17:46:34 +00:00
|
|
|
WriteSubhyphaeHTML(qb422016, subhyphae, lc)
|
2021-12-20 21:08:21 +00:00
|
|
|
//line views/nav.qtpl:52
|
2021-02-20 16:14:33 +00:00
|
|
|
qs422016 := string(qb422016.B)
|
2021-12-20 21:08:21 +00:00
|
|
|
//line views/nav.qtpl:52
|
2021-02-20 16:14:33 +00:00
|
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
2021-12-20 21:08:21 +00:00
|
|
|
//line views/nav.qtpl:52
|
2021-02-20 16:14:33 +00:00
|
|
|
return qs422016
|
2021-12-20 21:08:21 +00:00
|
|
|
//line views/nav.qtpl:52
|
2021-02-20 16:14:33 +00:00
|
|
|
}
|