1
0
mirror of https://github.com/osmarks/mycorrhiza.git synced 2024-10-30 19:56:16 +00:00
mycorrhiza/views/nav.qtpl.go

279 lines
6.7 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
import "net/http"
//line views/nav.qtpl:2
2021-08-31 19:39:33 +00:00
import "fmt"
2021-02-20 16:14:33 +00:00
//line views/nav.qtpl:3
2021-08-31 19:39:33 +00:00
import "strings"
2021-02-20 16:14:33 +00:00
//line views/nav.qtpl:4
2021-08-31 19:39:33 +00:00
import "github.com/bouncepaw/mycorrhiza/user"
//line views/nav.qtpl:5
import "github.com/bouncepaw/mycorrhiza/hyphae"
2021-02-20 16:14:33 +00:00
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:7
2021-02-20 16:14:33 +00:00
import (
qtio422016 "io"
qt422016 "github.com/valyala/quicktemplate"
)
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:7
2021-02-20 16:14:33 +00:00
var (
_ = qtio422016.Copy
_ = qt422016.AcquireByteBuffer
)
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:7
func streamhyphaInfoEntry(qw422016 *qt422016.Writer, h *hyphae.Hypha, u *user.User, action, displayText string) {
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:7
qw422016.N().S(`
`)
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:8
if u.CanProceed(action) {
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:8
qw422016.N().S(`
<li class="hypha-info__entry hypha-info__entry_`)
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:9
qw422016.E().S(action)
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:9
qw422016.N().S(`">
<a class="hypha-info__link" href="/`)
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:10
qw422016.E().S(action)
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:10
qw422016.N().S(`/`)
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:10
qw422016.E().S(h.Name)
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:10
qw422016.N().S(`">`)
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:10
qw422016.E().S(displayText)
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:10
qw422016.N().S(`</a>
</li>
`)
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:12
}
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:12
qw422016.N().S(`
`)
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:13
2021-02-20 16:14:33 +00:00
}
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:13
func writehyphaInfoEntry(qq422016 qtio422016.Writer, h *hyphae.Hypha, u *user.User, action, displayText string) {
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:13
qw422016 := qt422016.AcquireWriter(qq422016)
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:13
streamhyphaInfoEntry(qw422016, h, u, action, displayText)
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:13
qt422016.ReleaseWriter(qw422016)
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:13
2021-02-20 16:14:33 +00:00
}
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:13
func hyphaInfoEntry(h *hyphae.Hypha, u *user.User, action, displayText string) string {
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:13
qb422016 := qt422016.AcquireByteBuffer()
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:13
writehyphaInfoEntry(qb422016, h, u, action, displayText)
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:13
qs422016 := string(qb422016.B)
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:13
qt422016.ReleaseByteBuffer(qb422016)
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:13
return qs422016
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:13
}
//line views/nav.qtpl:16
func backlinksDisplay(h *hyphae.Hypha) string {
n := hyphae.BacklinksCount(h)
suffix := "s"
if n%10 == 1 {
suffix = ""
}
return fmt.Sprintf("%d backlink%s", n, suffix)
}
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:26
func streamhyphaInfo(qw422016 *qt422016.Writer, rq *http.Request, h *hyphae.Hypha) {
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:26
2021-02-20 16:14:33 +00:00
qw422016.N().S(`
`)
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:28
2021-02-20 16:14:33 +00:00
u := user.FromRequest(rq)
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:29
2021-02-20 16:14:33 +00:00
qw422016.N().S(`
<nav class="hypha-info">
<ul class="hypha-info__list">
`)
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:32
streamhyphaInfoEntry(qw422016, h, u, "history", "View history")
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:32
qw422016.N().S(`
`)
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:33
streamhyphaInfoEntry(qw422016, h, u, "rename-ask", "Rename")
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:33
qw422016.N().S(`
`)
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:34
streamhyphaInfoEntry(qw422016, h, u, "delete-ask", "Delete")
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:34
qw422016.N().S(`
`)
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:35
streamhyphaInfoEntry(qw422016, h, u, "text", "View markup")
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:35
qw422016.N().S(`
`)
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:36
streamhyphaInfoEntry(qw422016, h, u, "attachment", "Manage attachment")
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:36
qw422016.N().S(`
`)
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:37
streamhyphaInfoEntry(qw422016, h, u, "backlinks", backlinksDisplay(h))
//line views/nav.qtpl:37
qw422016.N().S(`
</ul>
</nav>
2021-02-20 16:14:33 +00:00
`)
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:40
2021-02-20 16:14:33 +00:00
}
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:40
func writehyphaInfo(qq422016 qtio422016.Writer, rq *http.Request, h *hyphae.Hypha) {
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:40
2021-02-20 16:14:33 +00:00
qw422016 := qt422016.AcquireWriter(qq422016)
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:40
streamhyphaInfo(qw422016, rq, h)
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:40
2021-02-20 16:14:33 +00:00
qt422016.ReleaseWriter(qw422016)
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:40
2021-02-20 16:14:33 +00:00
}
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:40
func hyphaInfo(rq *http.Request, h *hyphae.Hypha) string {
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:40
2021-02-20 16:14:33 +00:00
qb422016 := qt422016.AcquireByteBuffer()
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:40
writehyphaInfo(qb422016, rq, h)
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:40
2021-02-20 16:14:33 +00:00
qs422016 := string(qb422016.B)
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:40
2021-02-20 16:14:33 +00:00
qt422016.ReleaseByteBuffer(qb422016)
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:40
2021-02-20 16:14:33 +00:00
return qs422016
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:40
2021-02-20 16:14:33 +00:00
}
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:42
2021-07-12 15:23:25 +00:00
func streamsiblingHyphaeHTML(qw422016 *qt422016.Writer, siblings string) {
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:42
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">
<h2 class="sibling-hyphae__title layout-card__title">Sibling hyphae</h2>
2021-02-20 16:14:33 +00:00
`)
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:45
2021-07-12 15:23:25 +00:00
qw422016.N().S(siblings)
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:45
2021-02-20 16:14:33 +00:00
qw422016.N().S(`
</aside>
`)
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:47
2021-02-20 16:14:33 +00:00
}
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:47
2021-07-12 15:23:25 +00:00
func writesiblingHyphaeHTML(qq422016 qtio422016.Writer, siblings string) {
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:47
2021-02-20 16:14:33 +00:00
qw422016 := qt422016.AcquireWriter(qq422016)
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:47
2021-07-12 15:23:25 +00:00
streamsiblingHyphaeHTML(qw422016, siblings)
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:47
2021-02-20 16:14:33 +00:00
qt422016.ReleaseWriter(qw422016)
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:47
2021-02-20 16:14:33 +00:00
}
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:47
2021-07-12 15:23:25 +00:00
func siblingHyphaeHTML(siblings string) string {
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:47
2021-02-20 16:14:33 +00:00
qb422016 := qt422016.AcquireByteBuffer()
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:47
2021-07-12 15:23:25 +00:00
writesiblingHyphaeHTML(qb422016, siblings)
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:47
2021-02-20 16:14:33 +00:00
qs422016 := string(qb422016.B)
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:47
2021-02-20 16:14:33 +00:00
qt422016.ReleaseByteBuffer(qb422016)
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:47
2021-02-20 16:14:33 +00:00
return qs422016
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:47
2021-02-20 16:14:33 +00:00
}
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:49
2021-02-20 16:14:33 +00:00
func StreamSubhyphaeHTML(qw422016 *qt422016.Writer, subhyphae string) {
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:49
2021-02-20 16:14:33 +00:00
qw422016.N().S(`
`)
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:50
2021-02-20 16:14:33 +00:00
if strings.TrimSpace(subhyphae) != "" {
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:50
2021-02-20 16:14:33 +00:00
qw422016.N().S(`
<section class="subhyphae">
<h2 class="subhyphae__title">Subhyphae</h2>
<nav class="subhyphae__nav">
<ul class="subhyphae__list">
`)
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:55
2021-02-20 16:14:33 +00:00
qw422016.N().S(subhyphae)
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:55
2021-02-20 16:14:33 +00:00
qw422016.N().S(`
</ul>
</nav>
</section>
`)
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:59
2021-02-20 16:14:33 +00:00
}
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:59
2021-02-20 16:14:33 +00:00
qw422016.N().S(`
`)
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:60
2021-02-20 16:14:33 +00:00
}
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:60
2021-02-20 16:14:33 +00:00
func WriteSubhyphaeHTML(qq422016 qtio422016.Writer, subhyphae string) {
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:60
2021-02-20 16:14:33 +00:00
qw422016 := qt422016.AcquireWriter(qq422016)
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:60
2021-02-20 16:14:33 +00:00
StreamSubhyphaeHTML(qw422016, subhyphae)
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:60
2021-02-20 16:14:33 +00:00
qt422016.ReleaseWriter(qw422016)
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:60
2021-02-20 16:14:33 +00:00
}
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:60
2021-02-20 16:14:33 +00:00
func SubhyphaeHTML(subhyphae string) string {
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:60
2021-02-20 16:14:33 +00:00
qb422016 := qt422016.AcquireByteBuffer()
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:60
2021-02-20 16:14:33 +00:00
WriteSubhyphaeHTML(qb422016, subhyphae)
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:60
2021-02-20 16:14:33 +00:00
qs422016 := string(qb422016.B)
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:60
2021-02-20 16:14:33 +00:00
qt422016.ReleaseByteBuffer(qb422016)
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:60
2021-02-20 16:14:33 +00:00
return qs422016
2021-08-31 19:39:33 +00:00
//line views/nav.qtpl:60
2021-02-20 16:14:33 +00:00
}