2021-04-07 17:49:56 +00:00
|
|
|
// Code generated by qtc from "view.qtpl". DO NOT EDIT.
|
|
|
|
// See https://github.com/valyala/quicktemplate for details.
|
|
|
|
|
|
|
|
//line tree/view.qtpl:1
|
|
|
|
package tree
|
|
|
|
|
|
|
|
//line tree/view.qtpl:1
|
|
|
|
import "sort"
|
|
|
|
|
|
|
|
//line tree/view.qtpl:2
|
|
|
|
import "path"
|
|
|
|
|
|
|
|
//line tree/view.qtpl:3
|
|
|
|
import "github.com/bouncepaw/mycorrhiza/util"
|
|
|
|
|
2021-11-05 20:06:46 +00:00
|
|
|
// Subhyphae links are recursive. It may end up looking like that if drawn with
|
|
|
|
// pseudographics:
|
|
|
|
// ╔══════════════╗
|
|
|
|
// ║Foo ║ The presented hyphae are foo and foo/bar
|
|
|
|
// ║╔════════════╗║
|
|
|
|
// ║║Bar ║║
|
|
|
|
// ║╚════════════╝║
|
|
|
|
// ╚══════════════╝
|
|
|
|
|
|
|
|
//line tree/view.qtpl:13
|
2021-04-07 17:49:56 +00:00
|
|
|
import (
|
|
|
|
qtio422016 "io"
|
|
|
|
|
|
|
|
qt422016 "github.com/valyala/quicktemplate"
|
|
|
|
)
|
|
|
|
|
2021-11-05 20:06:46 +00:00
|
|
|
//line tree/view.qtpl:13
|
2021-04-07 17:49:56 +00:00
|
|
|
var (
|
|
|
|
_ = qtio422016.Copy
|
|
|
|
_ = qt422016.AcquireByteBuffer
|
|
|
|
)
|
|
|
|
|
2021-11-05 20:06:46 +00:00
|
|
|
//line tree/view.qtpl:13
|
2021-04-07 17:49:56 +00:00
|
|
|
func streamchildHTML(qw422016 *qt422016.Writer, c *child) {
|
2021-11-05 20:06:46 +00:00
|
|
|
//line tree/view.qtpl:13
|
2021-04-07 17:49:56 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
`)
|
2021-11-05 20:06:46 +00:00
|
|
|
//line tree/view.qtpl:15
|
2021-04-07 17:49:56 +00:00
|
|
|
sort.Slice(c.children, func(i, j int) bool {
|
|
|
|
return c.children[i].name < c.children[j].name
|
|
|
|
})
|
|
|
|
|
2021-11-05 20:06:46 +00:00
|
|
|
//line tree/view.qtpl:18
|
2021-04-07 17:49:56 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
<li class="subhyphae__entry">
|
2021-10-01 09:18:11 +00:00
|
|
|
<a class="subhyphae__link `)
|
2021-11-05 20:06:46 +00:00
|
|
|
//line tree/view.qtpl:20
|
2021-10-01 09:18:11 +00:00
|
|
|
if !c.exists {
|
2021-11-05 20:06:46 +00:00
|
|
|
//line tree/view.qtpl:20
|
2021-10-01 09:18:11 +00:00
|
|
|
qw422016.N().S(`wikilink_new`)
|
2021-11-05 20:06:46 +00:00
|
|
|
//line tree/view.qtpl:20
|
2021-10-01 09:18:11 +00:00
|
|
|
}
|
2021-11-05 20:06:46 +00:00
|
|
|
//line tree/view.qtpl:20
|
2021-10-01 09:18:11 +00:00
|
|
|
qw422016.N().S(`" href="/hypha/`)
|
2021-11-05 20:06:46 +00:00
|
|
|
//line tree/view.qtpl:20
|
2021-04-07 17:49:56 +00:00
|
|
|
qw422016.E().S(c.name)
|
2021-11-05 20:06:46 +00:00
|
|
|
//line tree/view.qtpl:20
|
2021-04-07 17:49:56 +00:00
|
|
|
qw422016.N().S(`">
|
|
|
|
`)
|
2021-11-05 20:06:46 +00:00
|
|
|
//line tree/view.qtpl:21
|
2021-04-07 17:49:56 +00:00
|
|
|
qw422016.E().S(util.BeautifulName(path.Base(c.name)))
|
2021-11-05 20:06:46 +00:00
|
|
|
//line tree/view.qtpl:21
|
2021-04-07 17:49:56 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
</a>
|
|
|
|
`)
|
2021-11-05 20:06:46 +00:00
|
|
|
//line tree/view.qtpl:23
|
2021-04-07 17:49:56 +00:00
|
|
|
if len(c.children) > 0 {
|
2021-11-05 20:06:46 +00:00
|
|
|
//line tree/view.qtpl:23
|
2021-04-07 17:49:56 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
<ul>
|
|
|
|
`)
|
2021-11-05 20:06:46 +00:00
|
|
|
//line tree/view.qtpl:25
|
2021-04-07 17:49:56 +00:00
|
|
|
for _, child := range c.children {
|
2021-11-05 20:06:46 +00:00
|
|
|
//line tree/view.qtpl:25
|
2021-04-07 17:49:56 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
`)
|
2021-11-05 20:06:46 +00:00
|
|
|
//line tree/view.qtpl:26
|
2021-04-07 17:49:56 +00:00
|
|
|
qw422016.N().S(childHTML(&child))
|
2021-11-05 20:06:46 +00:00
|
|
|
//line tree/view.qtpl:26
|
2021-04-07 17:49:56 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
`)
|
2021-11-05 20:06:46 +00:00
|
|
|
//line tree/view.qtpl:27
|
2021-04-07 17:49:56 +00:00
|
|
|
}
|
2021-11-05 20:06:46 +00:00
|
|
|
//line tree/view.qtpl:27
|
2021-04-07 17:49:56 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
</ul>
|
|
|
|
`)
|
2021-11-05 20:06:46 +00:00
|
|
|
//line tree/view.qtpl:29
|
2021-04-07 17:49:56 +00:00
|
|
|
}
|
2021-11-05 20:06:46 +00:00
|
|
|
//line tree/view.qtpl:29
|
2021-04-07 17:49:56 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
</li>
|
|
|
|
`)
|
2021-11-05 20:06:46 +00:00
|
|
|
//line tree/view.qtpl:31
|
2021-04-07 17:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-11-05 20:06:46 +00:00
|
|
|
//line tree/view.qtpl:31
|
2021-04-07 17:49:56 +00:00
|
|
|
func writechildHTML(qq422016 qtio422016.Writer, c *child) {
|
2021-11-05 20:06:46 +00:00
|
|
|
//line tree/view.qtpl:31
|
2021-04-07 17:49:56 +00:00
|
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
2021-11-05 20:06:46 +00:00
|
|
|
//line tree/view.qtpl:31
|
2021-04-07 17:49:56 +00:00
|
|
|
streamchildHTML(qw422016, c)
|
2021-11-05 20:06:46 +00:00
|
|
|
//line tree/view.qtpl:31
|
2021-04-07 17:49:56 +00:00
|
|
|
qt422016.ReleaseWriter(qw422016)
|
2021-11-05 20:06:46 +00:00
|
|
|
//line tree/view.qtpl:31
|
2021-04-07 17:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-11-05 20:06:46 +00:00
|
|
|
//line tree/view.qtpl:31
|
2021-04-07 17:49:56 +00:00
|
|
|
func childHTML(c *child) string {
|
2021-11-05 20:06:46 +00:00
|
|
|
//line tree/view.qtpl:31
|
2021-04-07 17:49:56 +00:00
|
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
2021-11-05 20:06:46 +00:00
|
|
|
//line tree/view.qtpl:31
|
2021-04-07 17:49:56 +00:00
|
|
|
writechildHTML(qb422016, c)
|
2021-11-05 20:06:46 +00:00
|
|
|
//line tree/view.qtpl:31
|
2021-04-07 17:49:56 +00:00
|
|
|
qs422016 := string(qb422016.B)
|
2021-11-05 20:06:46 +00:00
|
|
|
//line tree/view.qtpl:31
|
2021-04-07 17:49:56 +00:00
|
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
2021-11-05 20:06:46 +00:00
|
|
|
//line tree/view.qtpl:31
|
2021-04-07 17:49:56 +00:00
|
|
|
return qs422016
|
2021-11-05 20:06:46 +00:00
|
|
|
//line tree/view.qtpl:31
|
2021-04-07 17:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-11-05 20:06:46 +00:00
|
|
|
//line tree/view.qtpl:34
|
2021-04-07 17:49:56 +00:00
|
|
|
func streamsiblingHTML(qw422016 *qt422016.Writer, s *sibling) {
|
2021-11-05 20:06:46 +00:00
|
|
|
//line tree/view.qtpl:34
|
2021-04-07 17:49:56 +00:00
|
|
|
qw422016.N().S(`
|
2021-07-12 15:23:25 +00:00
|
|
|
<li class="sibling-hyphae__entry">
|
2021-10-01 08:57:00 +00:00
|
|
|
<a class="sibling-hyphae__link `)
|
2021-11-05 20:06:46 +00:00
|
|
|
//line tree/view.qtpl:36
|
2021-10-01 08:57:00 +00:00
|
|
|
if !s.exists {
|
2021-11-05 20:06:46 +00:00
|
|
|
//line tree/view.qtpl:36
|
2021-10-01 08:57:00 +00:00
|
|
|
qw422016.N().S(`wikilink_new`)
|
2021-11-05 20:06:46 +00:00
|
|
|
//line tree/view.qtpl:36
|
2021-10-01 08:57:00 +00:00
|
|
|
}
|
2021-11-05 20:06:46 +00:00
|
|
|
//line tree/view.qtpl:36
|
2021-10-01 08:57:00 +00:00
|
|
|
qw422016.N().S(`" href="/hypha/`)
|
2021-11-05 20:06:46 +00:00
|
|
|
//line tree/view.qtpl:36
|
2021-04-07 17:49:56 +00:00
|
|
|
qw422016.E().S(s.name)
|
2021-11-05 20:06:46 +00:00
|
|
|
//line tree/view.qtpl:36
|
2021-04-07 17:49:56 +00:00
|
|
|
qw422016.N().S(`">
|
|
|
|
`)
|
2021-11-05 20:06:46 +00:00
|
|
|
//line tree/view.qtpl:37
|
2021-04-07 17:49:56 +00:00
|
|
|
qw422016.E().S(util.BeautifulName(path.Base(s.name)))
|
2021-11-05 20:06:46 +00:00
|
|
|
//line tree/view.qtpl:37
|
2021-04-07 17:49:56 +00:00
|
|
|
qw422016.N().S(`
|
2021-07-12 15:23:25 +00:00
|
|
|
<span class="sibling-hyphae__count">
|
2021-04-07 17:49:56 +00:00
|
|
|
`)
|
2021-11-05 20:06:46 +00:00
|
|
|
//line tree/view.qtpl:39
|
2021-04-07 17:49:56 +00:00
|
|
|
if s.directSubhyphaeCount > 0 {
|
2021-11-05 20:06:46 +00:00
|
|
|
//line tree/view.qtpl:39
|
2021-04-07 17:49:56 +00:00
|
|
|
qw422016.N().S(`
|
2021-07-12 15:23:25 +00:00
|
|
|
<span class="sibling-hyphae__direct-count">
|
2021-04-07 17:49:56 +00:00
|
|
|
`)
|
2021-11-05 20:06:46 +00:00
|
|
|
//line tree/view.qtpl:41
|
2021-04-07 17:49:56 +00:00
|
|
|
qw422016.N().D(s.directSubhyphaeCount)
|
2021-11-05 20:06:46 +00:00
|
|
|
//line tree/view.qtpl:41
|
2021-04-07 17:49:56 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
</span>
|
|
|
|
`)
|
2021-11-05 20:06:46 +00:00
|
|
|
//line tree/view.qtpl:43
|
2021-04-07 17:49:56 +00:00
|
|
|
}
|
2021-11-05 20:06:46 +00:00
|
|
|
//line tree/view.qtpl:43
|
2021-04-07 17:49:56 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
`)
|
2021-11-05 20:06:46 +00:00
|
|
|
//line tree/view.qtpl:44
|
2021-04-07 17:49:56 +00:00
|
|
|
if s.indirectSubhyphaeCount > 0 {
|
2021-11-05 20:06:46 +00:00
|
|
|
//line tree/view.qtpl:44
|
2021-04-07 17:49:56 +00:00
|
|
|
qw422016.N().S(`
|
2021-07-12 15:23:25 +00:00
|
|
|
<span class="sibling-hyphae__indirect-count">
|
2021-04-07 17:49:56 +00:00
|
|
|
(`)
|
2021-11-05 20:06:46 +00:00
|
|
|
//line tree/view.qtpl:46
|
2021-04-07 17:49:56 +00:00
|
|
|
qw422016.N().D(s.indirectSubhyphaeCount)
|
2021-11-05 20:06:46 +00:00
|
|
|
//line tree/view.qtpl:46
|
2021-04-07 17:49:56 +00:00
|
|
|
qw422016.N().S(`)
|
|
|
|
</span>
|
|
|
|
`)
|
2021-11-05 20:06:46 +00:00
|
|
|
//line tree/view.qtpl:48
|
2021-04-07 17:49:56 +00:00
|
|
|
}
|
2021-11-05 20:06:46 +00:00
|
|
|
//line tree/view.qtpl:48
|
2021-04-07 17:49:56 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
</span>
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
`)
|
2021-11-05 20:06:46 +00:00
|
|
|
//line tree/view.qtpl:52
|
2021-04-07 17:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-11-05 20:06:46 +00:00
|
|
|
//line tree/view.qtpl:52
|
2021-04-07 17:49:56 +00:00
|
|
|
func writesiblingHTML(qq422016 qtio422016.Writer, s *sibling) {
|
2021-11-05 20:06:46 +00:00
|
|
|
//line tree/view.qtpl:52
|
2021-04-07 17:49:56 +00:00
|
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
2021-11-05 20:06:46 +00:00
|
|
|
//line tree/view.qtpl:52
|
2021-04-07 17:49:56 +00:00
|
|
|
streamsiblingHTML(qw422016, s)
|
2021-11-05 20:06:46 +00:00
|
|
|
//line tree/view.qtpl:52
|
2021-04-07 17:49:56 +00:00
|
|
|
qt422016.ReleaseWriter(qw422016)
|
2021-11-05 20:06:46 +00:00
|
|
|
//line tree/view.qtpl:52
|
2021-04-07 17:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-11-05 20:06:46 +00:00
|
|
|
//line tree/view.qtpl:52
|
2021-04-07 17:49:56 +00:00
|
|
|
func siblingHTML(s *sibling) string {
|
2021-11-05 20:06:46 +00:00
|
|
|
//line tree/view.qtpl:52
|
2021-04-07 17:49:56 +00:00
|
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
2021-11-05 20:06:46 +00:00
|
|
|
//line tree/view.qtpl:52
|
2021-04-07 17:49:56 +00:00
|
|
|
writesiblingHTML(qb422016, s)
|
2021-11-05 20:06:46 +00:00
|
|
|
//line tree/view.qtpl:52
|
2021-04-07 17:49:56 +00:00
|
|
|
qs422016 := string(qb422016.B)
|
2021-11-05 20:06:46 +00:00
|
|
|
//line tree/view.qtpl:52
|
2021-04-07 17:49:56 +00:00
|
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
2021-11-05 20:06:46 +00:00
|
|
|
//line tree/view.qtpl:52
|
2021-04-07 17:49:56 +00:00
|
|
|
return qs422016
|
2021-11-05 20:06:46 +00:00
|
|
|
//line tree/view.qtpl:52
|
2021-04-07 17:49:56 +00:00
|
|
|
}
|