2021-02-20 15:48:51 +00:00
|
|
|
// Code generated by qtc from "hypha.qtpl". DO NOT EDIT.
|
|
|
|
// See https://github.com/valyala/quicktemplate for details.
|
|
|
|
|
|
|
|
//line views/hypha.qtpl:1
|
|
|
|
package views
|
|
|
|
|
|
|
|
//line views/hypha.qtpl:1
|
|
|
|
import "path/filepath"
|
|
|
|
|
|
|
|
//line views/hypha.qtpl:2
|
|
|
|
import "strings"
|
|
|
|
|
|
|
|
//line views/hypha.qtpl:3
|
|
|
|
import "github.com/bouncepaw/mycorrhiza/hyphae"
|
|
|
|
|
|
|
|
//line views/hypha.qtpl:4
|
|
|
|
import "github.com/bouncepaw/mycorrhiza/util"
|
|
|
|
|
|
|
|
//line views/hypha.qtpl:6
|
|
|
|
import (
|
|
|
|
qtio422016 "io"
|
|
|
|
|
|
|
|
qt422016 "github.com/valyala/quicktemplate"
|
|
|
|
)
|
|
|
|
|
|
|
|
//line views/hypha.qtpl:6
|
|
|
|
var (
|
|
|
|
_ = qtio422016.Copy
|
|
|
|
_ = qt422016.AcquireByteBuffer
|
|
|
|
)
|
|
|
|
|
|
|
|
//line views/hypha.qtpl:6
|
|
|
|
func StreamNaviTitleHTML(qw422016 *qt422016.Writer, h *hyphae.Hypha) {
|
|
|
|
//line views/hypha.qtpl:6
|
|
|
|
qw422016.N().S(`
|
|
|
|
`)
|
|
|
|
//line views/hypha.qtpl:8
|
|
|
|
var (
|
|
|
|
prevAcc = "/hypha/"
|
|
|
|
parts = strings.Split(h.Name, "/")
|
|
|
|
)
|
|
|
|
|
|
|
|
//line views/hypha.qtpl:12
|
|
|
|
qw422016.N().S(`
|
|
|
|
<h1 class="navi-title">
|
|
|
|
`)
|
|
|
|
//line views/hypha.qtpl:14
|
|
|
|
qw422016.N().S(`<a href="/hypha/`)
|
|
|
|
//line views/hypha.qtpl:15
|
|
|
|
qw422016.E().S(util.HomePage)
|
|
|
|
//line views/hypha.qtpl:15
|
|
|
|
qw422016.N().S(`">`)
|
|
|
|
//line views/hypha.qtpl:16
|
|
|
|
qw422016.N().S(util.SiteNavIcon)
|
|
|
|
//line views/hypha.qtpl:16
|
|
|
|
qw422016.N().S(`<span aria-hidden="true" class="navi-title__colon">:</span></a>`)
|
|
|
|
//line views/hypha.qtpl:20
|
|
|
|
for i, part := range parts {
|
|
|
|
//line views/hypha.qtpl:21
|
|
|
|
if i > 0 {
|
|
|
|
//line views/hypha.qtpl:21
|
|
|
|
qw422016.N().S(`<span aria-hidden="true" class="navi-title__separator">/</span>`)
|
|
|
|
//line views/hypha.qtpl:23
|
|
|
|
}
|
|
|
|
//line views/hypha.qtpl:23
|
|
|
|
qw422016.N().S(`<a href="`)
|
|
|
|
//line views/hypha.qtpl:25
|
|
|
|
qw422016.E().S(prevAcc + part)
|
|
|
|
//line views/hypha.qtpl:25
|
|
|
|
qw422016.N().S(`"rel="`)
|
|
|
|
//line views/hypha.qtpl:26
|
|
|
|
if i == len(parts)-1 {
|
|
|
|
//line views/hypha.qtpl:26
|
|
|
|
qw422016.N().S(`bookmark`)
|
|
|
|
//line views/hypha.qtpl:26
|
|
|
|
} else {
|
|
|
|
//line views/hypha.qtpl:26
|
|
|
|
qw422016.N().S(`up`)
|
|
|
|
//line views/hypha.qtpl:26
|
|
|
|
}
|
|
|
|
//line views/hypha.qtpl:26
|
|
|
|
qw422016.N().S(`">`)
|
|
|
|
//line views/hypha.qtpl:27
|
|
|
|
qw422016.N().S(util.BeautifulName(part))
|
|
|
|
//line views/hypha.qtpl:27
|
|
|
|
qw422016.N().S(`</a>`)
|
|
|
|
//line views/hypha.qtpl:29
|
|
|
|
prevAcc += part + "/"
|
|
|
|
|
|
|
|
//line views/hypha.qtpl:30
|
|
|
|
}
|
|
|
|
//line views/hypha.qtpl:31
|
|
|
|
qw422016.N().S(`
|
|
|
|
</h1>
|
|
|
|
`)
|
|
|
|
//line views/hypha.qtpl:33
|
|
|
|
}
|
|
|
|
|
|
|
|
//line views/hypha.qtpl:33
|
|
|
|
func WriteNaviTitleHTML(qq422016 qtio422016.Writer, h *hyphae.Hypha) {
|
|
|
|
//line views/hypha.qtpl:33
|
|
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
|
|
|
//line views/hypha.qtpl:33
|
|
|
|
StreamNaviTitleHTML(qw422016, h)
|
|
|
|
//line views/hypha.qtpl:33
|
|
|
|
qt422016.ReleaseWriter(qw422016)
|
|
|
|
//line views/hypha.qtpl:33
|
|
|
|
}
|
|
|
|
|
|
|
|
//line views/hypha.qtpl:33
|
|
|
|
func NaviTitleHTML(h *hyphae.Hypha) string {
|
|
|
|
//line views/hypha.qtpl:33
|
|
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
|
|
|
//line views/hypha.qtpl:33
|
|
|
|
WriteNaviTitleHTML(qb422016, h)
|
|
|
|
//line views/hypha.qtpl:33
|
|
|
|
qs422016 := string(qb422016.B)
|
|
|
|
//line views/hypha.qtpl:33
|
|
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
|
|
|
//line views/hypha.qtpl:33
|
|
|
|
return qs422016
|
|
|
|
//line views/hypha.qtpl:33
|
|
|
|
}
|
|
|
|
|
|
|
|
//line views/hypha.qtpl:35
|
|
|
|
func StreamAttachmentHTML(qw422016 *qt422016.Writer, h *hyphae.Hypha) {
|
2021-03-14 13:16:30 +00:00
|
|
|
//line views/hypha.qtpl:35
|
2021-02-20 15:48:51 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
`)
|
2021-03-14 13:16:30 +00:00
|
|
|
//line views/hypha.qtpl:36
|
2021-02-20 15:48:51 +00:00
|
|
|
switch filepath.Ext(h.BinaryPath) {
|
2021-03-14 13:16:30 +00:00
|
|
|
//line views/hypha.qtpl:38
|
2021-02-20 15:48:51 +00:00
|
|
|
case ".jpg", ".gif", ".png", ".webp", ".svg", ".ico":
|
2021-03-14 13:16:30 +00:00
|
|
|
//line views/hypha.qtpl:38
|
2021-02-20 15:48:51 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
<div class="binary-container binary-container_with-img">
|
|
|
|
<a href="/binary/`)
|
2021-03-14 13:16:30 +00:00
|
|
|
//line views/hypha.qtpl:40
|
2021-02-20 15:48:51 +00:00
|
|
|
qw422016.N().S(h.Name)
|
2021-03-14 13:16:30 +00:00
|
|
|
//line views/hypha.qtpl:40
|
2021-02-20 15:48:51 +00:00
|
|
|
qw422016.N().S(`"><img src="/binary/`)
|
2021-03-14 13:16:30 +00:00
|
|
|
//line views/hypha.qtpl:40
|
2021-02-20 15:48:51 +00:00
|
|
|
qw422016.N().S(h.Name)
|
2021-03-14 13:16:30 +00:00
|
|
|
//line views/hypha.qtpl:40
|
2021-02-20 15:48:51 +00:00
|
|
|
qw422016.N().S(`"/></a>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
`)
|
2021-03-14 13:16:30 +00:00
|
|
|
//line views/hypha.qtpl:43
|
2021-02-20 15:48:51 +00:00
|
|
|
case ".ogg", ".webm", ".mp4":
|
2021-03-14 13:16:30 +00:00
|
|
|
//line views/hypha.qtpl:43
|
2021-02-20 15:48:51 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
<div class="binary-container binary-container_with-video">
|
|
|
|
<video controls>
|
|
|
|
<source src="/binary/`)
|
2021-03-14 13:16:30 +00:00
|
|
|
//line views/hypha.qtpl:46
|
2021-02-20 15:48:51 +00:00
|
|
|
qw422016.N().S(h.Name)
|
2021-03-14 13:16:30 +00:00
|
|
|
//line views/hypha.qtpl:46
|
2021-02-20 15:48:51 +00:00
|
|
|
qw422016.N().S(`"/>
|
|
|
|
<p>Your browser does not support video. <a href="/binary/`)
|
2021-03-14 13:16:30 +00:00
|
|
|
//line views/hypha.qtpl:47
|
2021-02-20 15:48:51 +00:00
|
|
|
qw422016.N().S(h.Name)
|
2021-03-14 13:16:30 +00:00
|
|
|
//line views/hypha.qtpl:47
|
2021-02-20 15:48:51 +00:00
|
|
|
qw422016.N().S(`">Download video</a></p>
|
|
|
|
</video>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
`)
|
2021-03-14 13:16:30 +00:00
|
|
|
//line views/hypha.qtpl:51
|
2021-02-20 15:48:51 +00:00
|
|
|
case ".mp3":
|
2021-03-14 13:16:30 +00:00
|
|
|
//line views/hypha.qtpl:51
|
2021-02-20 15:48:51 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
<div class="binary-container binary-container_with-audio">
|
|
|
|
<audio controls>
|
|
|
|
<source src="/binary/`)
|
2021-03-14 13:16:30 +00:00
|
|
|
//line views/hypha.qtpl:54
|
2021-02-20 15:48:51 +00:00
|
|
|
qw422016.N().S(h.Name)
|
2021-03-14 13:16:30 +00:00
|
|
|
//line views/hypha.qtpl:54
|
2021-02-20 15:48:51 +00:00
|
|
|
qw422016.N().S(`"/>
|
|
|
|
<p>Your browser does not support audio. <a href="/binary/`)
|
2021-03-14 13:16:30 +00:00
|
|
|
//line views/hypha.qtpl:55
|
2021-02-20 15:48:51 +00:00
|
|
|
qw422016.N().S(h.Name)
|
2021-03-14 13:16:30 +00:00
|
|
|
//line views/hypha.qtpl:55
|
2021-02-20 15:48:51 +00:00
|
|
|
qw422016.N().S(`">Download audio</a></p>
|
|
|
|
</audio>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
`)
|
2021-03-14 13:16:30 +00:00
|
|
|
//line views/hypha.qtpl:59
|
2021-02-20 15:48:51 +00:00
|
|
|
default:
|
2021-03-14 13:16:30 +00:00
|
|
|
//line views/hypha.qtpl:59
|
2021-02-20 15:48:51 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
<div class="binary-container binary-container_with-nothing">
|
|
|
|
<p><a href="/binary/`)
|
2021-03-14 13:16:30 +00:00
|
|
|
//line views/hypha.qtpl:61
|
2021-02-20 15:48:51 +00:00
|
|
|
qw422016.N().S(h.Name)
|
2021-03-14 13:16:30 +00:00
|
|
|
//line views/hypha.qtpl:61
|
2021-02-20 15:48:51 +00:00
|
|
|
qw422016.N().S(`">Download media</a></p>
|
|
|
|
</div>
|
|
|
|
`)
|
2021-03-14 13:16:30 +00:00
|
|
|
//line views/hypha.qtpl:63
|
2021-02-20 15:48:51 +00:00
|
|
|
}
|
2021-03-14 13:16:30 +00:00
|
|
|
//line views/hypha.qtpl:63
|
2021-02-20 15:48:51 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
`)
|
2021-03-14 13:16:30 +00:00
|
|
|
//line views/hypha.qtpl:64
|
2021-02-20 15:48:51 +00:00
|
|
|
}
|
|
|
|
|
2021-03-14 13:16:30 +00:00
|
|
|
//line views/hypha.qtpl:64
|
2021-02-20 15:48:51 +00:00
|
|
|
func WriteAttachmentHTML(qq422016 qtio422016.Writer, h *hyphae.Hypha) {
|
2021-03-14 13:16:30 +00:00
|
|
|
//line views/hypha.qtpl:64
|
2021-02-20 15:48:51 +00:00
|
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
2021-03-14 13:16:30 +00:00
|
|
|
//line views/hypha.qtpl:64
|
2021-02-20 15:48:51 +00:00
|
|
|
StreamAttachmentHTML(qw422016, h)
|
2021-03-14 13:16:30 +00:00
|
|
|
//line views/hypha.qtpl:64
|
2021-02-20 15:48:51 +00:00
|
|
|
qt422016.ReleaseWriter(qw422016)
|
2021-03-14 13:16:30 +00:00
|
|
|
//line views/hypha.qtpl:64
|
2021-02-20 15:48:51 +00:00
|
|
|
}
|
|
|
|
|
2021-03-14 13:16:30 +00:00
|
|
|
//line views/hypha.qtpl:64
|
2021-02-20 15:48:51 +00:00
|
|
|
func AttachmentHTML(h *hyphae.Hypha) string {
|
2021-03-14 13:16:30 +00:00
|
|
|
//line views/hypha.qtpl:64
|
2021-02-20 15:48:51 +00:00
|
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
2021-03-14 13:16:30 +00:00
|
|
|
//line views/hypha.qtpl:64
|
2021-02-20 15:48:51 +00:00
|
|
|
WriteAttachmentHTML(qb422016, h)
|
2021-03-14 13:16:30 +00:00
|
|
|
//line views/hypha.qtpl:64
|
2021-02-20 15:48:51 +00:00
|
|
|
qs422016 := string(qb422016.B)
|
2021-03-14 13:16:30 +00:00
|
|
|
//line views/hypha.qtpl:64
|
2021-02-20 15:48:51 +00:00
|
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
2021-03-14 13:16:30 +00:00
|
|
|
//line views/hypha.qtpl:64
|
2021-02-20 15:48:51 +00:00
|
|
|
return qs422016
|
2021-03-14 13:16:30 +00:00
|
|
|
//line views/hypha.qtpl:64
|
2021-02-20 15:48:51 +00:00
|
|
|
}
|