1
0
mirror of https://github.com/osmarks/mycorrhiza.git synced 2024-10-31 04:06:16 +00:00
mycorrhiza/templates/common.qtpl.go

361 lines
9.6 KiB
Go
Raw Normal View History

2020-10-02 15:31:59 +00:00
// Code generated by qtc from "common.qtpl". DO NOT EDIT.
// See https://github.com/valyala/quicktemplate for details.
//line templates/common.qtpl:1
2020-10-02 15:31:59 +00:00
package templates
//line templates/common.qtpl:1
import "net/http"
2020-10-02 15:31:59 +00:00
//line templates/common.qtpl:2
2021-02-19 18:12:36 +00:00
import "strings"
//line templates/common.qtpl:3
2021-02-19 18:12:36 +00:00
import "github.com/bouncepaw/mycorrhiza/user"
//line templates/common.qtpl:4
import "github.com/bouncepaw/mycorrhiza/util"
// This is the <nav> seen on top of many pages.
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:7
2020-10-02 15:31:59 +00:00
import (
qtio422016 "io"
qt422016 "github.com/valyala/quicktemplate"
)
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:7
2020-10-02 15:31:59 +00:00
var (
_ = qtio422016.Copy
_ = qt422016.AcquireByteBuffer
)
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:8
2020-10-02 15:31:59 +00:00
type navEntry struct {
path string
title string
}
var navEntries = []navEntry{
{"page", "Hypha"},
{"edit", "Edit"},
{"history", "History"},
{"revision", "NOT REACHED"},
{"rename-ask", "Rename"},
{"delete-ask", "Delete"},
2021-01-26 05:41:57 +00:00
{"text", "Raw text"},
2020-10-02 15:31:59 +00:00
}
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:23
func streamnavHTML(qw422016 *qt422016.Writer, rq *http.Request, hyphaName, navType string, revisionHash ...string) {
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:23
qw422016.N().S(`
`)
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:25
u := user.FromRequest(rq)
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:26
2020-10-02 15:31:59 +00:00
qw422016.N().S(`
2021-01-25 18:37:21 +00:00
<nav class="hypha-tabs main-width">
2021-01-20 13:53:30 +00:00
<ul class="hypha-tabs__flex">
2020-10-02 15:31:59 +00:00
`)
2021-01-25 18:37:21 +00:00
//line templates/common.qtpl:29
2021-02-19 18:12:36 +00:00
for _, entry := range navEntries {
//line templates/common.qtpl:30
2020-10-02 15:31:59 +00:00
if navType == "revision" && entry.path == "revision" {
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:30
2021-01-20 13:53:30 +00:00
qw422016.N().S(` <li class="hypha-tabs__tab hypha-tabs__tab_active">
2021-01-25 18:37:21 +00:00
<span class="hypha-tabs__selection">`)
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:32
2020-10-02 15:31:59 +00:00
qw422016.E().S(revisionHash[0])
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:32
2021-01-25 18:37:21 +00:00
qw422016.N().S(`</span>
2021-01-20 13:53:30 +00:00
</li>
`)
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:34
2020-10-02 15:31:59 +00:00
} else if navType == entry.path {
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:34
2021-01-20 13:53:30 +00:00
qw422016.N().S(` <li class="hypha-tabs__tab hypha-tabs__tab_active">
2021-01-25 18:37:21 +00:00
<span class="hypha-tabs__selection">`)
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:36
2020-10-02 15:31:59 +00:00
qw422016.E().S(entry.title)
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:36
2021-01-25 18:37:21 +00:00
qw422016.N().S(`</span>
2021-01-20 13:53:30 +00:00
</li>
2020-10-02 15:31:59 +00:00
`)
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:38
} else if entry.path != "revision" && u.CanProceed(entry.path) {
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:38
2021-01-20 13:53:30 +00:00
qw422016.N().S(` <li class="hypha-tabs__tab">
2021-01-25 18:37:21 +00:00
<a class="hypha-tabs__link" href="/`)
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:40
qw422016.E().S(entry.path)
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:40
2020-10-02 15:31:59 +00:00
qw422016.N().S(`/`)
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:40
2020-10-02 15:31:59 +00:00
qw422016.E().S(hyphaName)
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:40
2020-10-02 15:31:59 +00:00
qw422016.N().S(`">`)
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:40
2020-10-02 15:31:59 +00:00
qw422016.E().S(entry.title)
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:40
2021-01-20 13:53:30 +00:00
qw422016.N().S(`</a>
</li>
2020-10-02 15:31:59 +00:00
`)
2021-01-25 18:37:21 +00:00
//line templates/common.qtpl:42
2021-02-19 18:12:36 +00:00
}
//line templates/common.qtpl:43
2020-10-02 15:31:59 +00:00
}
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:43
2021-01-24 07:30:14 +00:00
qw422016.N().S(` </ul>
2020-10-02 15:31:59 +00:00
</nav>
`)
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:46
2020-10-02 15:31:59 +00:00
}
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:46
func writenavHTML(qq422016 qtio422016.Writer, rq *http.Request, hyphaName, navType string, revisionHash ...string) {
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:46
2020-10-02 15:31:59 +00:00
qw422016 := qt422016.AcquireWriter(qq422016)
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:46
streamnavHTML(qw422016, rq, hyphaName, navType, revisionHash...)
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:46
2020-10-02 15:31:59 +00:00
qt422016.ReleaseWriter(qw422016)
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:46
2020-10-02 15:31:59 +00:00
}
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:46
func navHTML(rq *http.Request, hyphaName, navType string, revisionHash ...string) string {
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:46
2020-10-02 15:31:59 +00:00
qb422016 := qt422016.AcquireByteBuffer()
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:46
writenavHTML(qb422016, rq, hyphaName, navType, revisionHash...)
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:46
2020-10-02 15:31:59 +00:00
qs422016 := string(qb422016.B)
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:46
2020-10-02 15:31:59 +00:00
qt422016.ReleaseByteBuffer(qb422016)
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:46
2020-10-02 15:31:59 +00:00
return qs422016
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:46
}
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:48
func streamuserMenuHTML(qw422016 *qt422016.Writer, u *user.User) {
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:48
qw422016.N().S(`
2021-01-24 07:30:14 +00:00
`)
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:49
if user.AuthUsed {
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:49
qw422016.N().S(`
2021-01-24 07:30:14 +00:00
<li class="header-links__entry header-links__entry_user">
`)
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:51
if u.Group == "anon" {
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:51
qw422016.N().S(`
2021-01-24 07:30:14 +00:00
<a href="/login" class="header-links__link">Login</a>
`)
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:53
} else {
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:53
qw422016.N().S(`
2021-01-24 07:30:14 +00:00
<a href="/page/`)
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:54
2021-01-23 16:37:29 +00:00
qw422016.E().S(util.UserHypha)
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:54
qw422016.N().S(`/`)
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:54
qw422016.E().S(u.Name)
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:54
2021-01-24 07:30:14 +00:00
qw422016.N().S(`" class="header-links__link">`)
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:54
qw422016.E().S(u.Name)
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:54
qw422016.N().S(`</a>
2021-01-24 07:30:14 +00:00
`)
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:55
}
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:55
qw422016.N().S(`
2021-01-24 07:30:14 +00:00
</li>
`)
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:57
}
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:57
qw422016.N().S(`
`)
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:58
}
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:58
func writeuserMenuHTML(qq422016 qtio422016.Writer, u *user.User) {
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:58
qw422016 := qt422016.AcquireWriter(qq422016)
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:58
streamuserMenuHTML(qw422016, u)
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:58
qt422016.ReleaseWriter(qw422016)
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:58
}
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:58
func userMenuHTML(u *user.User) string {
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:58
qb422016 := qt422016.AcquireByteBuffer()
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:58
writeuserMenuHTML(qb422016, u)
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:58
qs422016 := string(qb422016.B)
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:58
qt422016.ReleaseByteBuffer(qb422016)
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:58
return qs422016
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:58
2020-10-02 15:31:59 +00:00
}
2021-01-26 05:41:57 +00:00
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:60
2021-01-26 05:41:57 +00:00
func streamrelativeHyphae(qw422016 *qt422016.Writer, relatives string) {
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:60
2021-01-26 05:41:57 +00:00
qw422016.N().S(`
<aside class="relative-hyphae layout-card">
2021-02-19 09:23:57 +00:00
<h2 class="relative-hyphae__title layout-card__title">Relative hyphae</h2>
2021-01-26 05:41:57 +00:00
`)
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:63
2021-01-26 05:41:57 +00:00
qw422016.N().S(relatives)
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:63
2021-01-26 05:41:57 +00:00
qw422016.N().S(`
</aside>
`)
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:65
2021-01-26 05:41:57 +00:00
}
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:65
2021-01-26 05:41:57 +00:00
func writerelativeHyphae(qq422016 qtio422016.Writer, relatives string) {
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:65
2021-01-26 05:41:57 +00:00
qw422016 := qt422016.AcquireWriter(qq422016)
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:65
2021-01-26 05:41:57 +00:00
streamrelativeHyphae(qw422016, relatives)
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:65
2021-01-26 05:41:57 +00:00
qt422016.ReleaseWriter(qw422016)
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:65
2021-01-26 05:41:57 +00:00
}
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:65
2021-01-26 05:41:57 +00:00
func relativeHyphae(relatives string) string {
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:65
2021-01-26 05:41:57 +00:00
qb422016 := qt422016.AcquireByteBuffer()
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:65
2021-01-26 05:41:57 +00:00
writerelativeHyphae(qb422016, relatives)
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:65
2021-01-26 05:41:57 +00:00
qs422016 := string(qb422016.B)
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:65
2021-01-26 05:41:57 +00:00
qt422016.ReleaseByteBuffer(qb422016)
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:65
2021-01-26 05:41:57 +00:00
return qs422016
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:65
2021-01-26 05:41:57 +00:00
}
2021-02-19 09:23:57 +00:00
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:67
2021-02-19 09:23:57 +00:00
func streambacklinks(qw422016 *qt422016.Writer, backlinkEntries string) {
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:67
2021-02-19 09:23:57 +00:00
qw422016.N().S(`
<aside class="backlinks layout-card">
<h2 class="backlinks__title layout-card__title">Backlinks</h2>
<nav class="backlinks__nav">
<ul class="backlinks__list">
`)
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:72
2021-02-19 09:23:57 +00:00
qw422016.N().S(backlinkEntries)
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:72
2021-02-19 09:23:57 +00:00
qw422016.N().S(`
</ul>
</nav>
</aside>
`)
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:76
2021-02-19 09:23:57 +00:00
}
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:76
2021-02-19 09:23:57 +00:00
func writebacklinks(qq422016 qtio422016.Writer, backlinkEntries string) {
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:76
2021-02-19 09:23:57 +00:00
qw422016 := qt422016.AcquireWriter(qq422016)
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:76
2021-02-19 09:23:57 +00:00
streambacklinks(qw422016, backlinkEntries)
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:76
2021-02-19 09:23:57 +00:00
qt422016.ReleaseWriter(qw422016)
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:76
2021-02-19 09:23:57 +00:00
}
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:76
2021-02-19 09:23:57 +00:00
func backlinks(backlinkEntries string) string {
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:76
2021-02-19 09:23:57 +00:00
qb422016 := qt422016.AcquireByteBuffer()
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:76
2021-02-19 09:23:57 +00:00
writebacklinks(qb422016, backlinkEntries)
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:76
qs422016 := string(qb422016.B)
//line templates/common.qtpl:76
qt422016.ReleaseByteBuffer(qb422016)
//line templates/common.qtpl:76
return qs422016
//line templates/common.qtpl:76
}
//line templates/common.qtpl:78
func streamsubhyphaeMatrix(qw422016 *qt422016.Writer, subhyphae string) {
//line templates/common.qtpl:78
qw422016.N().S(`
`)
//line templates/common.qtpl:79
if strings.TrimSpace(subhyphae) != "" {
//line templates/common.qtpl:79
qw422016.N().S(`
<section class="subhyphae">
<h2 class="subhyphae__title">Subhyphae</h2>
<nav class="subhyphae__nav">
<ul class="subhyphae__list">
`)
//line templates/common.qtpl:84
qw422016.N().S(subhyphae)
//line templates/common.qtpl:84
qw422016.N().S(`
</ul>
</nav>
</section>
`)
//line templates/common.qtpl:88
}
//line templates/common.qtpl:88
qw422016.N().S(`
`)
//line templates/common.qtpl:89
}
//line templates/common.qtpl:89
func writesubhyphaeMatrix(qq422016 qtio422016.Writer, subhyphae string) {
//line templates/common.qtpl:89
qw422016 := qt422016.AcquireWriter(qq422016)
//line templates/common.qtpl:89
streamsubhyphaeMatrix(qw422016, subhyphae)
//line templates/common.qtpl:89
qt422016.ReleaseWriter(qw422016)
//line templates/common.qtpl:89
}
//line templates/common.qtpl:89
func subhyphaeMatrix(subhyphae string) string {
//line templates/common.qtpl:89
qb422016 := qt422016.AcquireByteBuffer()
//line templates/common.qtpl:89
writesubhyphaeMatrix(qb422016, subhyphae)
//line templates/common.qtpl:89
2021-02-19 09:23:57 +00:00
qs422016 := string(qb422016.B)
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:89
2021-02-19 09:23:57 +00:00
qt422016.ReleaseByteBuffer(qb422016)
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:89
2021-02-19 09:23:57 +00:00
return qs422016
2021-02-19 18:12:36 +00:00
//line templates/common.qtpl:89
2021-02-19 09:23:57 +00:00
}