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

452 lines
11 KiB
Go
Raw Normal View History

2021-01-24 12:52:40 +00:00
// Code generated by qtc from "stuff.qtpl". DO NOT EDIT.
2020-08-31 17:52:26 +00:00
// See https://github.com/valyala/quicktemplate for details.
//line views/stuff.qtpl:1
package views
2020-08-31 17:52:26 +00:00
//line views/stuff.qtpl:1
import "fmt"
//line views/stuff.qtpl:2
import "path/filepath"
2021-02-22 18:37:23 +00:00
//line views/stuff.qtpl:4
2021-10-01 05:14:23 +00:00
import "github.com/bouncepaw/mycorrhiza/cfg"
//line views/stuff.qtpl:5
2021-10-01 05:14:23 +00:00
import "github.com/bouncepaw/mycorrhiza/hyphae"
//line views/stuff.qtpl:6
2021-10-01 05:14:23 +00:00
import "github.com/bouncepaw/mycorrhiza/util"
//line views/stuff.qtpl:7
2021-09-06 17:46:34 +00:00
import "github.com/bouncepaw/mycorrhiza/l18n"
//line views/stuff.qtpl:9
2020-08-31 17:52:26 +00:00
import (
qtio422016 "io"
qt422016 "github.com/valyala/quicktemplate"
)
//line views/stuff.qtpl:9
2020-08-31 17:52:26 +00:00
var (
_ = qtio422016.Copy
_ = qt422016.AcquireByteBuffer
)
//line views/stuff.qtpl:9
2022-03-20 21:24:40 +00:00
func StreamTitleSearch(qw422016 *qt422016.Writer, query string, generator func(string) <-chan string, lc *l18n.Localizer) {
//line views/stuff.qtpl:9
2020-08-31 17:52:26 +00:00
qw422016.N().S(`
2021-01-26 05:41:57 +00:00
<div class="layout">
<main class="main-width title-search">
2021-09-06 17:46:34 +00:00
<h1>`)
//line views/stuff.qtpl:12
2021-09-06 17:46:34 +00:00
qw422016.E().S(lc.Get("ui.search_results_query", &l18n.Replacements{"query": query}))
//line views/stuff.qtpl:12
2021-09-06 17:46:34 +00:00
qw422016.N().S(`</h1>
<p>`)
//line views/stuff.qtpl:13
2021-09-06 17:46:34 +00:00
qw422016.E().S(lc.Get("ui.search_results_desc"))
//line views/stuff.qtpl:13
2021-09-06 17:46:34 +00:00
qw422016.N().S(`</p>
<ul class="title-search__results">
`)
//line views/stuff.qtpl:15
for hyphaName := range generator(query) {
//line views/stuff.qtpl:15
qw422016.N().S(`
<li class="title-search__entry">
<a class="title-search__link wikilink" href="/hypha/`)
//line views/stuff.qtpl:17
qw422016.E().S(hyphaName)
//line views/stuff.qtpl:17
qw422016.N().S(`">`)
//line views/stuff.qtpl:17
qw422016.E().S(util.BeautifulName(hyphaName))
//line views/stuff.qtpl:17
qw422016.N().S(`</a>
</li>
`)
//line views/stuff.qtpl:19
}
//line views/stuff.qtpl:19
qw422016.N().S(`
</main>
</div>
`)
//line views/stuff.qtpl:22
}
//line views/stuff.qtpl:22
2022-03-20 21:24:40 +00:00
func WriteTitleSearch(qq422016 qtio422016.Writer, query string, generator func(string) <-chan string, lc *l18n.Localizer) {
//line views/stuff.qtpl:22
qw422016 := qt422016.AcquireWriter(qq422016)
//line views/stuff.qtpl:22
2022-03-20 21:24:40 +00:00
StreamTitleSearch(qw422016, query, generator, lc)
//line views/stuff.qtpl:22
qt422016.ReleaseWriter(qw422016)
//line views/stuff.qtpl:22
}
//line views/stuff.qtpl:22
2022-03-20 21:24:40 +00:00
func TitleSearch(query string, generator func(string) <-chan string, lc *l18n.Localizer) string {
//line views/stuff.qtpl:22
qb422016 := qt422016.AcquireByteBuffer()
//line views/stuff.qtpl:22
2022-03-20 21:24:40 +00:00
WriteTitleSearch(qb422016, query, generator, lc)
//line views/stuff.qtpl:22
qs422016 := string(qb422016.B)
//line views/stuff.qtpl:22
qt422016.ReleaseByteBuffer(qb422016)
//line views/stuff.qtpl:22
return qs422016
//line views/stuff.qtpl:22
}
//line views/stuff.qtpl:24
2022-03-20 21:24:40 +00:00
func StreamBacklinks(qw422016 *qt422016.Writer, hyphaName string, generator func(string) <-chan string, lc *l18n.Localizer) {
//line views/stuff.qtpl:24
qw422016.N().S(`
<div class="layout">
<main class="main-width backlinks">
2021-09-06 17:46:34 +00:00
<h1>`)
//line views/stuff.qtpl:27
qw422016.N().S(lc.Get(
"ui.backlinks_heading",
&l18n.Replacements{
"hypha_link": fmt.Sprintf(
`<a href="/hypha/%s">%s</a>`,
hyphaName,
util.BeautifulName(hyphaName),
),
},
))
//line views/stuff.qtpl:36
2021-09-06 17:46:34 +00:00
qw422016.N().S(`</h1>
<p>`)
//line views/stuff.qtpl:37
2021-09-06 17:46:34 +00:00
qw422016.E().S(lc.Get("ui.backlinks_desc"))
//line views/stuff.qtpl:37
2021-09-06 17:46:34 +00:00
qw422016.N().S(`</p>
<ul class="backlinks__list">
`)
//line views/stuff.qtpl:39
for hyphaName := range generator(hyphaName) {
//line views/stuff.qtpl:39
qw422016.N().S(`
<li class="backlinks__entry">
<a class="backlinks__link wikilink" href="/hypha/`)
//line views/stuff.qtpl:41
qw422016.E().S(hyphaName)
//line views/stuff.qtpl:41
qw422016.N().S(`">`)
//line views/stuff.qtpl:41
qw422016.E().S(util.BeautifulName(hyphaName))
//line views/stuff.qtpl:41
qw422016.N().S(`</a>
</li>
`)
//line views/stuff.qtpl:43
}
//line views/stuff.qtpl:43
qw422016.N().S(`
</ul>
</main>
</div>
`)
//line views/stuff.qtpl:47
}
//line views/stuff.qtpl:47
2022-03-20 21:24:40 +00:00
func WriteBacklinks(qq422016 qtio422016.Writer, hyphaName string, generator func(string) <-chan string, lc *l18n.Localizer) {
//line views/stuff.qtpl:47
qw422016 := qt422016.AcquireWriter(qq422016)
//line views/stuff.qtpl:47
2022-03-20 21:24:40 +00:00
StreamBacklinks(qw422016, hyphaName, generator, lc)
//line views/stuff.qtpl:47
qt422016.ReleaseWriter(qw422016)
//line views/stuff.qtpl:47
}
//line views/stuff.qtpl:47
2022-03-20 21:24:40 +00:00
func Backlinks(hyphaName string, generator func(string) <-chan string, lc *l18n.Localizer) string {
//line views/stuff.qtpl:47
qb422016 := qt422016.AcquireByteBuffer()
//line views/stuff.qtpl:47
2022-03-20 21:24:40 +00:00
WriteBacklinks(qb422016, hyphaName, generator, lc)
//line views/stuff.qtpl:47
qs422016 := string(qb422016.B)
//line views/stuff.qtpl:47
qt422016.ReleaseByteBuffer(qb422016)
//line views/stuff.qtpl:47
return qs422016
//line views/stuff.qtpl:47
}
//line views/stuff.qtpl:49
2022-03-20 21:24:40 +00:00
func StreamHelp(qw422016 *qt422016.Writer, content, lang string, lc *l18n.Localizer) {
//line views/stuff.qtpl:49
qw422016.N().S(`
<div class="layout">
<main class="main-width help">
<article>
`)
//line views/stuff.qtpl:53
qw422016.N().S(content)
//line views/stuff.qtpl:53
qw422016.N().S(`
</article>
</main>
`)
//line views/stuff.qtpl:56
2022-03-20 21:24:40 +00:00
qw422016.N().S(helpTopics(lang, lc))
//line views/stuff.qtpl:56
qw422016.N().S(`
</div>
`)
//line views/stuff.qtpl:58
}
//line views/stuff.qtpl:58
2022-03-20 21:24:40 +00:00
func WriteHelp(qq422016 qtio422016.Writer, content, lang string, lc *l18n.Localizer) {
//line views/stuff.qtpl:58
qw422016 := qt422016.AcquireWriter(qq422016)
//line views/stuff.qtpl:58
2022-03-20 21:24:40 +00:00
StreamHelp(qw422016, content, lang, lc)
//line views/stuff.qtpl:58
qt422016.ReleaseWriter(qw422016)
//line views/stuff.qtpl:58
}
//line views/stuff.qtpl:58
2022-03-20 21:24:40 +00:00
func Help(content, lang string, lc *l18n.Localizer) string {
//line views/stuff.qtpl:58
qb422016 := qt422016.AcquireByteBuffer()
//line views/stuff.qtpl:58
2022-03-20 21:24:40 +00:00
WriteHelp(qb422016, content, lang, lc)
//line views/stuff.qtpl:58
qs422016 := string(qb422016.B)
//line views/stuff.qtpl:58
qt422016.ReleaseByteBuffer(qb422016)
//line views/stuff.qtpl:58
return qs422016
//line views/stuff.qtpl:58
}
//line views/stuff.qtpl:60
2022-03-20 21:24:40 +00:00
func StreamHelpEmptyError(qw422016 *qt422016.Writer, lc *l18n.Localizer) {
//line views/stuff.qtpl:60
qw422016.N().S(`
2021-09-06 17:46:34 +00:00
<h1>`)
//line views/stuff.qtpl:61
2021-09-06 17:46:34 +00:00
qw422016.E().S(lc.Get("help.empty_error_title"))
//line views/stuff.qtpl:61
2021-09-06 17:46:34 +00:00
qw422016.N().S(`</h1>
<p>`)
//line views/stuff.qtpl:62
2021-09-06 17:46:34 +00:00
qw422016.E().S(lc.Get("help.empty_error_line_1"))
//line views/stuff.qtpl:62
2021-09-06 17:46:34 +00:00
qw422016.N().S(`</p>
<p>`)
//line views/stuff.qtpl:63
2021-09-06 17:46:34 +00:00
qw422016.E().S(lc.Get("help.empty_error_line_2a"))
//line views/stuff.qtpl:63
2021-09-06 17:46:34 +00:00
qw422016.N().S(` <a class="wikilink wikilink_external wikilink_https" href="https://github.com/bouncepaw/mycorrhiza">`)
//line views/stuff.qtpl:63
2021-09-06 17:46:34 +00:00
qw422016.E().S(lc.Get("help.empty_error_link"))
//line views/stuff.qtpl:63
2021-09-06 17:46:34 +00:00
qw422016.N().S(`</a> `)
//line views/stuff.qtpl:63
2021-09-06 17:46:34 +00:00
qw422016.E().S(lc.Get("help.empty_error_line_2b"))
//line views/stuff.qtpl:63
2021-09-06 17:46:34 +00:00
qw422016.N().S(`</p>
`)
//line views/stuff.qtpl:64
}
//line views/stuff.qtpl:64
2022-03-20 21:24:40 +00:00
func WriteHelpEmptyError(qq422016 qtio422016.Writer, lc *l18n.Localizer) {
//line views/stuff.qtpl:64
2021-09-06 17:46:34 +00:00
qw422016 := qt422016.AcquireWriter(qq422016)
//line views/stuff.qtpl:64
2022-03-20 21:24:40 +00:00
StreamHelpEmptyError(qw422016, lc)
//line views/stuff.qtpl:64
2021-09-06 17:46:34 +00:00
qt422016.ReleaseWriter(qw422016)
//line views/stuff.qtpl:64
2021-09-06 17:46:34 +00:00
}
//line views/stuff.qtpl:64
2022-03-20 21:24:40 +00:00
func HelpEmptyError(lc *l18n.Localizer) string {
//line views/stuff.qtpl:64
qb422016 := qt422016.AcquireByteBuffer()
//line views/stuff.qtpl:64
2022-03-20 21:24:40 +00:00
WriteHelpEmptyError(qb422016, lc)
//line views/stuff.qtpl:64
qs422016 := string(qb422016.B)
//line views/stuff.qtpl:64
qt422016.ReleaseByteBuffer(qb422016)
//line views/stuff.qtpl:64
return qs422016
//line views/stuff.qtpl:64
}
//line views/stuff.qtpl:66
2022-03-20 21:24:40 +00:00
func StreamHyphaList(qw422016 *qt422016.Writer, lc *l18n.Localizer) {
//line views/stuff.qtpl:66
2021-01-30 18:21:50 +00:00
qw422016.N().S(`
<div class="layout">
2021-01-26 05:41:57 +00:00
<main class="main-width">
2021-09-06 17:46:34 +00:00
<h1>`)
//line views/stuff.qtpl:69
2021-09-06 17:46:34 +00:00
qw422016.E().S(lc.Get("ui.list_heading"))
//line views/stuff.qtpl:69
2021-09-06 17:46:34 +00:00
qw422016.N().S(`</h1>
<p>`)
//line views/stuff.qtpl:70
2021-09-06 17:46:34 +00:00
qw422016.E().S(lc.GetPlural("ui.list_desc", hyphae.Count()))
//line views/stuff.qtpl:70
2021-09-06 17:46:34 +00:00
qw422016.N().S(`</p>
2021-02-22 18:37:23 +00:00
<ul class="hypha-list">
`)
//line views/stuff.qtpl:73
2021-10-01 05:14:23 +00:00
hyphaNames := make(chan string)
sortedHypha := hyphae.PathographicSort(hyphaNames)
for hypha := range hyphae.YieldExistingHyphae() {
hyphaNames <- hypha.CanonicalName()
2021-10-01 05:14:23 +00:00
}
close(hyphaNames)
//line views/stuff.qtpl:79
2021-10-01 05:14:23 +00:00
qw422016.N().S(`
`)
//line views/stuff.qtpl:80
2021-10-01 05:14:23 +00:00
for hyphaName := range sortedHypha {
//line views/stuff.qtpl:80
2021-10-01 05:14:23 +00:00
qw422016.N().S(`
`)
//line views/stuff.qtpl:81
2022-02-19 08:26:38 +00:00
h := hyphae.ByName(hyphaName)
2021-10-01 05:14:23 +00:00
//line views/stuff.qtpl:81
2021-02-22 18:37:23 +00:00
qw422016.N().S(`
<li class="hypha-list__entry">
<a class="hypha-list__link" href="/hypha/`)
//line views/stuff.qtpl:83
2022-02-19 08:26:38 +00:00
qw422016.E().S(h.CanonicalName())
//line views/stuff.qtpl:83
qw422016.N().S(`">
`)
//line views/stuff.qtpl:84
2022-02-19 08:26:38 +00:00
qw422016.E().S(util.BeautifulName(h.CanonicalName()))
//line views/stuff.qtpl:84
qw422016.N().S(`
</a>
`)
//line views/stuff.qtpl:86
2022-02-19 08:26:38 +00:00
switch h := h.(type) {
//line views/stuff.qtpl:87
2022-02-19 08:26:38 +00:00
case *hyphae.MediaHypha:
//line views/stuff.qtpl:87
qw422016.N().S(`
2022-02-19 08:26:38 +00:00
<span class="hypha-list__amnt-type">
`)
//line views/stuff.qtpl:89
2022-02-19 08:26:38 +00:00
qw422016.E().S(filepath.Ext(h.MediaFilePath())[1:])
//line views/stuff.qtpl:89
2021-02-22 18:37:23 +00:00
qw422016.N().S(`
2022-02-19 08:26:38 +00:00
</span>
2020-08-31 17:52:26 +00:00
`)
//line views/stuff.qtpl:91
2021-02-22 18:37:23 +00:00
}
//line views/stuff.qtpl:91
2020-08-31 18:16:22 +00:00
qw422016.N().S(`
2021-02-22 18:37:23 +00:00
</li>
`)
//line views/stuff.qtpl:93
2020-08-31 18:16:22 +00:00
}
//line views/stuff.qtpl:93
2020-08-31 18:16:22 +00:00
qw422016.N().S(`
2021-02-22 18:37:23 +00:00
</ul>
</main>
</div>
2020-08-31 18:16:22 +00:00
`)
//line views/stuff.qtpl:97
2020-08-31 18:16:22 +00:00
}
//line views/stuff.qtpl:97
2022-03-20 21:24:40 +00:00
func WriteHyphaList(qq422016 qtio422016.Writer, lc *l18n.Localizer) {
//line views/stuff.qtpl:97
2020-08-31 18:16:22 +00:00
qw422016 := qt422016.AcquireWriter(qq422016)
//line views/stuff.qtpl:97
2022-03-20 21:24:40 +00:00
StreamHyphaList(qw422016, lc)
//line views/stuff.qtpl:97
2020-08-31 18:16:22 +00:00
qt422016.ReleaseWriter(qw422016)
//line views/stuff.qtpl:97
2020-08-31 18:16:22 +00:00
}
//line views/stuff.qtpl:97
2022-03-20 21:24:40 +00:00
func HyphaList(lc *l18n.Localizer) string {
//line views/stuff.qtpl:97
2020-08-31 18:16:22 +00:00
qb422016 := qt422016.AcquireByteBuffer()
//line views/stuff.qtpl:97
2022-03-20 21:24:40 +00:00
WriteHyphaList(qb422016, lc)
//line views/stuff.qtpl:97
qs422016 := string(qb422016.B)
//line views/stuff.qtpl:97
qt422016.ReleaseByteBuffer(qb422016)
//line views/stuff.qtpl:97
return qs422016
//line views/stuff.qtpl:97
}
//line views/stuff.qtpl:99
2022-03-22 13:40:40 +00:00
func streamcommonScripts(qw422016 *qt422016.Writer) {
//line views/stuff.qtpl:99
qw422016.N().S(`
`)
//line views/stuff.qtpl:100
2021-07-01 09:45:29 +00:00
for _, scriptPath := range cfg.CommonScripts {
//line views/stuff.qtpl:100
qw422016.N().S(`
<script src="`)
//line views/stuff.qtpl:101
qw422016.E().S(scriptPath)
//line views/stuff.qtpl:101
qw422016.N().S(`"></script>
`)
//line views/stuff.qtpl:102
}
//line views/stuff.qtpl:102
qw422016.N().S(`
`)
//line views/stuff.qtpl:103
}
//line views/stuff.qtpl:103
2022-03-22 13:40:40 +00:00
func writecommonScripts(qq422016 qtio422016.Writer) {
//line views/stuff.qtpl:103
qw422016 := qt422016.AcquireWriter(qq422016)
//line views/stuff.qtpl:103
2022-03-22 13:40:40 +00:00
streamcommonScripts(qw422016)
//line views/stuff.qtpl:103
qt422016.ReleaseWriter(qw422016)
//line views/stuff.qtpl:103
}
//line views/stuff.qtpl:103
2022-03-22 13:40:40 +00:00
func commonScripts() string {
//line views/stuff.qtpl:103
qb422016 := qt422016.AcquireByteBuffer()
//line views/stuff.qtpl:103
2022-03-22 13:40:40 +00:00
writecommonScripts(qb422016)
//line views/stuff.qtpl:103
qs422016 := string(qb422016.B)
//line views/stuff.qtpl:103
qt422016.ReleaseByteBuffer(qb422016)
//line views/stuff.qtpl:103
return qs422016
//line views/stuff.qtpl:103
2020-08-31 17:52:26 +00:00
}