1
0
mirror of https://github.com/osmarks/mycorrhiza.git synced 2024-10-30 19:56:16 +00:00
mycorrhiza/views/nav.qtpl.go
Timur Ismagilov f8f4eb92c8 Implement the new top bar #78
I decided to not implement dropdowns and stuff yet.

This stuff needs some styling for sure.
2021-07-15 13:57:39 +05:00

238 lines
5.8 KiB
Go

// 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
import "strings"
//line views/nav.qtpl:3
import "github.com/bouncepaw/mycorrhiza/user"
// This is the <nav> seen on top of many pages.
//line views/nav.qtpl:6
import (
qtio422016 "io"
qt422016 "github.com/valyala/quicktemplate"
)
//line views/nav.qtpl:6
var (
_ = qtio422016.Copy
_ = qt422016.AcquireByteBuffer
)
//line views/nav.qtpl:7
type navEntry struct {
path string
title string
}
var navEntries = []navEntry{
{"hypha", "Hypha"},
{"edit", "Edit"},
{"attachment", "Attachment"},
{"history", "History"},
{"revision", "NOT REACHED"},
{"rename-ask", "Rename"},
{"delete-ask", "Delete"},
{"text", "Raw text"},
}
//line views/nav.qtpl:23
func StreamNavHTML(qw422016 *qt422016.Writer, rq *http.Request, hyphaName, navType string, revisionHash ...string) {
//line views/nav.qtpl:23
qw422016.N().S(`
`)
//line views/nav.qtpl:25
u := user.FromRequest(rq)
//line views/nav.qtpl:26
qw422016.N().S(`
<nav class="hypha-tabs main-width">
<ul class="hypha-tabs__flex">
`)
//line views/nav.qtpl:29
for _, entry := range navEntries {
//line views/nav.qtpl:30
if navType == "revision" && entry.path == "revision" {
//line views/nav.qtpl:30
qw422016.N().S(` <li class="hypha-tabs__tab hypha-tabs__tab_active">
<span class="hypha-tabs__selection">`)
//line views/nav.qtpl:32
qw422016.E().S(revisionHash[0])
//line views/nav.qtpl:32
qw422016.N().S(`</span>
</li>
`)
//line views/nav.qtpl:34
} else if navType == entry.path {
//line views/nav.qtpl:34
qw422016.N().S(` <li class="hypha-tabs__tab hypha-tabs__tab_active">
<span class="hypha-tabs__selection">`)
//line views/nav.qtpl:36
qw422016.E().S(entry.title)
//line views/nav.qtpl:36
qw422016.N().S(`</span>
</li>
`)
//line views/nav.qtpl:38
} else if entry.path != "revision" && u.CanProceed(entry.path) {
//line views/nav.qtpl:38
qw422016.N().S(` <li class="hypha-tabs__tab">
<a class="hypha-tabs__link" href="/`)
//line views/nav.qtpl:40
qw422016.E().S(entry.path)
//line views/nav.qtpl:40
qw422016.N().S(`/`)
//line views/nav.qtpl:40
qw422016.E().S(hyphaName)
//line views/nav.qtpl:40
qw422016.N().S(`">`)
//line views/nav.qtpl:40
qw422016.E().S(entry.title)
//line views/nav.qtpl:40
qw422016.N().S(`</a>
</li>
`)
//line views/nav.qtpl:42
}
//line views/nav.qtpl:43
}
//line views/nav.qtpl:43
qw422016.N().S(` </ul>
</nav>
`)
//line views/nav.qtpl:46
}
//line views/nav.qtpl:46
func WriteNavHTML(qq422016 qtio422016.Writer, rq *http.Request, hyphaName, navType string, revisionHash ...string) {
//line views/nav.qtpl:46
qw422016 := qt422016.AcquireWriter(qq422016)
//line views/nav.qtpl:46
StreamNavHTML(qw422016, rq, hyphaName, navType, revisionHash...)
//line views/nav.qtpl:46
qt422016.ReleaseWriter(qw422016)
//line views/nav.qtpl:46
}
//line views/nav.qtpl:46
func NavHTML(rq *http.Request, hyphaName, navType string, revisionHash ...string) string {
//line views/nav.qtpl:46
qb422016 := qt422016.AcquireByteBuffer()
//line views/nav.qtpl:46
WriteNavHTML(qb422016, rq, hyphaName, navType, revisionHash...)
//line views/nav.qtpl:46
qs422016 := string(qb422016.B)
//line views/nav.qtpl:46
qt422016.ReleaseByteBuffer(qb422016)
//line views/nav.qtpl:46
return qs422016
//line views/nav.qtpl:46
}
//line views/nav.qtpl:48
func streamsiblingHyphaeHTML(qw422016 *qt422016.Writer, siblings string) {
//line views/nav.qtpl:48
qw422016.N().S(`
<aside class="sibling-hyphae layout-card">
<h2 class="sibling-hyphae__title layout-card__title">Sibling hyphae</h2>
`)
//line views/nav.qtpl:51
qw422016.N().S(siblings)
//line views/nav.qtpl:51
qw422016.N().S(`
</aside>
`)
//line views/nav.qtpl:53
}
//line views/nav.qtpl:53
func writesiblingHyphaeHTML(qq422016 qtio422016.Writer, siblings string) {
//line views/nav.qtpl:53
qw422016 := qt422016.AcquireWriter(qq422016)
//line views/nav.qtpl:53
streamsiblingHyphaeHTML(qw422016, siblings)
//line views/nav.qtpl:53
qt422016.ReleaseWriter(qw422016)
//line views/nav.qtpl:53
}
//line views/nav.qtpl:53
func siblingHyphaeHTML(siblings string) string {
//line views/nav.qtpl:53
qb422016 := qt422016.AcquireByteBuffer()
//line views/nav.qtpl:53
writesiblingHyphaeHTML(qb422016, siblings)
//line views/nav.qtpl:53
qs422016 := string(qb422016.B)
//line views/nav.qtpl:53
qt422016.ReleaseByteBuffer(qb422016)
//line views/nav.qtpl:53
return qs422016
//line views/nav.qtpl:53
}
//line views/nav.qtpl:55
func StreamSubhyphaeHTML(qw422016 *qt422016.Writer, subhyphae string) {
//line views/nav.qtpl:55
qw422016.N().S(`
`)
//line views/nav.qtpl:56
if strings.TrimSpace(subhyphae) != "" {
//line views/nav.qtpl:56
qw422016.N().S(`
<section class="subhyphae">
<h2 class="subhyphae__title">Subhyphae</h2>
<nav class="subhyphae__nav">
<ul class="subhyphae__list">
`)
//line views/nav.qtpl:61
qw422016.N().S(subhyphae)
//line views/nav.qtpl:61
qw422016.N().S(`
</ul>
</nav>
</section>
`)
//line views/nav.qtpl:65
}
//line views/nav.qtpl:65
qw422016.N().S(`
`)
//line views/nav.qtpl:66
}
//line views/nav.qtpl:66
func WriteSubhyphaeHTML(qq422016 qtio422016.Writer, subhyphae string) {
//line views/nav.qtpl:66
qw422016 := qt422016.AcquireWriter(qq422016)
//line views/nav.qtpl:66
StreamSubhyphaeHTML(qw422016, subhyphae)
//line views/nav.qtpl:66
qt422016.ReleaseWriter(qw422016)
//line views/nav.qtpl:66
}
//line views/nav.qtpl:66
func SubhyphaeHTML(subhyphae string) string {
//line views/nav.qtpl:66
qb422016 := qt422016.AcquireByteBuffer()
//line views/nav.qtpl:66
WriteSubhyphaeHTML(qb422016, subhyphae)
//line views/nav.qtpl:66
qs422016 := string(qb422016.B)
//line views/nav.qtpl:66
qt422016.ReleaseByteBuffer(qb422016)
//line views/nav.qtpl:66
return qs422016
//line views/nav.qtpl:66
}