1
0
mirror of https://github.com/osmarks/mycorrhiza.git synced 2024-10-30 03:36:16 +00:00
mycorrhiza/views/hypha.qtpl.go
2022-04-24 14:11:53 +03:00

235 lines
6.0 KiB
Go

// 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:3
import "github.com/bouncepaw/mycorrhiza/hyphae"
//line views/hypha.qtpl:4
import "github.com/bouncepaw/mycorrhiza/l18n"
//line views/hypha.qtpl:5
import "github.com/bouncepaw/mycorrhiza/util"
//line views/hypha.qtpl:7
import (
qtio422016 "io"
qt422016 "github.com/valyala/quicktemplate"
)
//line views/hypha.qtpl:7
var (
_ = qtio422016.Copy
_ = qt422016.AcquireByteBuffer
)
//line views/hypha.qtpl:7
func streambeautifulLink(qw422016 *qt422016.Writer, hyphaName string) {
//line views/hypha.qtpl:7
qw422016.N().S(`<a href="/hypha/`)
//line views/hypha.qtpl:7
qw422016.N().S(hyphaName)
//line views/hypha.qtpl:7
qw422016.N().S(`">`)
//line views/hypha.qtpl:7
qw422016.E().S(util.BeautifulName(hyphaName))
//line views/hypha.qtpl:7
qw422016.N().S(`</a>`)
//line views/hypha.qtpl:7
}
//line views/hypha.qtpl:7
func writebeautifulLink(qq422016 qtio422016.Writer, hyphaName string) {
//line views/hypha.qtpl:7
qw422016 := qt422016.AcquireWriter(qq422016)
//line views/hypha.qtpl:7
streambeautifulLink(qw422016, hyphaName)
//line views/hypha.qtpl:7
qt422016.ReleaseWriter(qw422016)
//line views/hypha.qtpl:7
}
//line views/hypha.qtpl:7
func beautifulLink(hyphaName string) string {
//line views/hypha.qtpl:7
qb422016 := qt422016.AcquireByteBuffer()
//line views/hypha.qtpl:7
writebeautifulLink(qb422016, hyphaName)
//line views/hypha.qtpl:7
qs422016 := string(qb422016.B)
//line views/hypha.qtpl:7
qt422016.ReleaseByteBuffer(qb422016)
//line views/hypha.qtpl:7
return qs422016
//line views/hypha.qtpl:7
}
//line views/hypha.qtpl:9
func StreamMediaRaw(qw422016 *qt422016.Writer, h *hyphae.MediaHypha) {
//line views/hypha.qtpl:9
StreamMedia(qw422016, h, l18n.New("en", "en"))
//line views/hypha.qtpl:9
}
//line views/hypha.qtpl:9
func WriteMediaRaw(qq422016 qtio422016.Writer, h *hyphae.MediaHypha) {
//line views/hypha.qtpl:9
qw422016 := qt422016.AcquireWriter(qq422016)
//line views/hypha.qtpl:9
StreamMediaRaw(qw422016, h)
//line views/hypha.qtpl:9
qt422016.ReleaseWriter(qw422016)
//line views/hypha.qtpl:9
}
//line views/hypha.qtpl:9
func MediaRaw(h *hyphae.MediaHypha) string {
//line views/hypha.qtpl:9
qb422016 := qt422016.AcquireByteBuffer()
//line views/hypha.qtpl:9
WriteMediaRaw(qb422016, h)
//line views/hypha.qtpl:9
qs422016 := string(qb422016.B)
//line views/hypha.qtpl:9
qt422016.ReleaseByteBuffer(qb422016)
//line views/hypha.qtpl:9
return qs422016
//line views/hypha.qtpl:9
}
//line views/hypha.qtpl:11
func StreamMedia(qw422016 *qt422016.Writer, h *hyphae.MediaHypha, lc *l18n.Localizer) {
//line views/hypha.qtpl:11
qw422016.N().S(`
`)
//line views/hypha.qtpl:12
switch filepath.Ext(h.MediaFilePath()) {
//line views/hypha.qtpl:14
case ".jpg", ".gif", ".png", ".webp", ".svg", ".ico":
//line views/hypha.qtpl:14
qw422016.N().S(`
<div class="binary-container binary-container_with-img">
<a href="/binary/`)
//line views/hypha.qtpl:16
qw422016.N().S(h.CanonicalName())
//line views/hypha.qtpl:16
qw422016.N().S(`"><img src="/binary/`)
//line views/hypha.qtpl:16
qw422016.N().S(h.CanonicalName())
//line views/hypha.qtpl:16
qw422016.N().S(`"/></a>
</div>
`)
//line views/hypha.qtpl:19
case ".ogg", ".webm", ".mp4":
//line views/hypha.qtpl:19
qw422016.N().S(`
<div class="binary-container binary-container_with-video">
<video controls>
<source src="/binary/`)
//line views/hypha.qtpl:22
qw422016.N().S(h.CanonicalName())
//line views/hypha.qtpl:22
qw422016.N().S(`"/>
<p>`)
//line views/hypha.qtpl:23
qw422016.E().S(lc.Get("ui.media_novideo"))
//line views/hypha.qtpl:23
qw422016.N().S(` <a href="/binary/`)
//line views/hypha.qtpl:23
qw422016.N().S(h.CanonicalName())
//line views/hypha.qtpl:23
qw422016.N().S(`">`)
//line views/hypha.qtpl:23
qw422016.E().S(lc.Get("ui.media_novideo_link"))
//line views/hypha.qtpl:23
qw422016.N().S(`</a></p>
</video>
</div>
`)
//line views/hypha.qtpl:27
case ".mp3":
//line views/hypha.qtpl:27
qw422016.N().S(`
<div class="binary-container binary-container_with-audio">
<audio controls>
<source src="/binary/`)
//line views/hypha.qtpl:30
qw422016.N().S(h.CanonicalName())
//line views/hypha.qtpl:30
qw422016.N().S(`"/>
<p>`)
//line views/hypha.qtpl:31
qw422016.E().S(lc.Get("ui.media_noaudio"))
//line views/hypha.qtpl:31
qw422016.N().S(` <a href="/binary/`)
//line views/hypha.qtpl:31
qw422016.N().S(h.CanonicalName())
//line views/hypha.qtpl:31
qw422016.N().S(`">`)
//line views/hypha.qtpl:31
qw422016.E().S(lc.Get("ui.media_noaudio_link"))
//line views/hypha.qtpl:31
qw422016.N().S(`</a></p>
</audio>
</div>
`)
//line views/hypha.qtpl:35
default:
//line views/hypha.qtpl:35
qw422016.N().S(`
<div class="binary-container binary-container_with-nothing">
<p><a href="/binary/`)
//line views/hypha.qtpl:37
qw422016.N().S(h.CanonicalName())
//line views/hypha.qtpl:37
qw422016.N().S(`">`)
//line views/hypha.qtpl:37
qw422016.E().S(lc.Get("ui.media_download"))
//line views/hypha.qtpl:37
qw422016.N().S(`</a></p>
</div>
`)
//line views/hypha.qtpl:39
}
//line views/hypha.qtpl:39
qw422016.N().S(`
`)
//line views/hypha.qtpl:40
}
//line views/hypha.qtpl:40
func WriteMedia(qq422016 qtio422016.Writer, h *hyphae.MediaHypha, lc *l18n.Localizer) {
//line views/hypha.qtpl:40
qw422016 := qt422016.AcquireWriter(qq422016)
//line views/hypha.qtpl:40
StreamMedia(qw422016, h, lc)
//line views/hypha.qtpl:40
qt422016.ReleaseWriter(qw422016)
//line views/hypha.qtpl:40
}
//line views/hypha.qtpl:40
func Media(h *hyphae.MediaHypha, lc *l18n.Localizer) string {
//line views/hypha.qtpl:40
qb422016 := qt422016.AcquireByteBuffer()
//line views/hypha.qtpl:40
WriteMedia(qb422016, h, lc)
//line views/hypha.qtpl:40
qs422016 := string(qb422016.B)
//line views/hypha.qtpl:40
qt422016.ReleaseByteBuffer(qb422016)
//line views/hypha.qtpl:40
return qs422016
//line views/hypha.qtpl:40
}