1
0
mirror of https://github.com/osmarks/mycorrhiza.git synced 2024-10-30 11:46:16 +00:00
mycorrhiza/mycoopts/view.qtpl.go
2022-06-10 18:45:27 +03:00

191 lines
4.9 KiB
Go

// Code generated by qtc from "view.qtpl". DO NOT EDIT.
// See https://github.com/valyala/quicktemplate for details.
//line mycoopts/view.qtpl:1
package mycoopts
//line mycoopts/view.qtpl:1
import "path/filepath"
//line mycoopts/view.qtpl:3
import "github.com/bouncepaw/mycorrhiza/hyphae"
//line mycoopts/view.qtpl:4
import "github.com/bouncepaw/mycorrhiza/l18n"
//line mycoopts/view.qtpl:6
import (
qtio422016 "io"
qt422016 "github.com/valyala/quicktemplate"
)
//line mycoopts/view.qtpl:6
var (
_ = qtio422016.Copy
_ = qt422016.AcquireByteBuffer
)
//line mycoopts/view.qtpl:6
func streammediaRaw(qw422016 *qt422016.Writer, h *hyphae.MediaHypha) {
//line mycoopts/view.qtpl:6
StreamMedia(qw422016, h, l18n.New("en", "en"))
//line mycoopts/view.qtpl:6
}
//line mycoopts/view.qtpl:6
func writemediaRaw(qq422016 qtio422016.Writer, h *hyphae.MediaHypha) {
//line mycoopts/view.qtpl:6
qw422016 := qt422016.AcquireWriter(qq422016)
//line mycoopts/view.qtpl:6
streammediaRaw(qw422016, h)
//line mycoopts/view.qtpl:6
qt422016.ReleaseWriter(qw422016)
//line mycoopts/view.qtpl:6
}
//line mycoopts/view.qtpl:6
func mediaRaw(h *hyphae.MediaHypha) string {
//line mycoopts/view.qtpl:6
qb422016 := qt422016.AcquireByteBuffer()
//line mycoopts/view.qtpl:6
writemediaRaw(qb422016, h)
//line mycoopts/view.qtpl:6
qs422016 := string(qb422016.B)
//line mycoopts/view.qtpl:6
qt422016.ReleaseByteBuffer(qb422016)
//line mycoopts/view.qtpl:6
return qs422016
//line mycoopts/view.qtpl:6
}
//line mycoopts/view.qtpl:8
func StreamMedia(qw422016 *qt422016.Writer, h *hyphae.MediaHypha, lc *l18n.Localizer) {
//line mycoopts/view.qtpl:8
qw422016.N().S(`
`)
//line mycoopts/view.qtpl:9
switch filepath.Ext(h.MediaFilePath()) {
//line mycoopts/view.qtpl:11
case ".jpg", ".gif", ".png", ".webp", ".svg", ".ico":
//line mycoopts/view.qtpl:11
qw422016.N().S(`
<div class="binary-container binary-container_with-img">
<a href="/binary/`)
//line mycoopts/view.qtpl:13
qw422016.N().S(h.CanonicalName())
//line mycoopts/view.qtpl:13
qw422016.N().S(`"><img src="/binary/`)
//line mycoopts/view.qtpl:13
qw422016.N().S(h.CanonicalName())
//line mycoopts/view.qtpl:13
qw422016.N().S(`"/></a>
</div>
`)
//line mycoopts/view.qtpl:16
case ".ogg", ".webm", ".mp4":
//line mycoopts/view.qtpl:16
qw422016.N().S(`
<div class="binary-container binary-container_with-video">
<video controls>
<source src="/binary/`)
//line mycoopts/view.qtpl:19
qw422016.N().S(h.CanonicalName())
//line mycoopts/view.qtpl:19
qw422016.N().S(`"/>
<p>`)
//line mycoopts/view.qtpl:20
qw422016.E().S(lc.Get("ui.media_novideo"))
//line mycoopts/view.qtpl:20
qw422016.N().S(` <a href="/binary/`)
//line mycoopts/view.qtpl:20
qw422016.N().S(h.CanonicalName())
//line mycoopts/view.qtpl:20
qw422016.N().S(`">`)
//line mycoopts/view.qtpl:20
qw422016.E().S(lc.Get("ui.media_novideo_link"))
//line mycoopts/view.qtpl:20
qw422016.N().S(`</a></p>
</video>
</div>
`)
//line mycoopts/view.qtpl:24
case ".mp3":
//line mycoopts/view.qtpl:24
qw422016.N().S(`
<div class="binary-container binary-container_with-audio">
<audio controls>
<source src="/binary/`)
//line mycoopts/view.qtpl:27
qw422016.N().S(h.CanonicalName())
//line mycoopts/view.qtpl:27
qw422016.N().S(`"/>
<p>`)
//line mycoopts/view.qtpl:28
qw422016.E().S(lc.Get("ui.media_noaudio"))
//line mycoopts/view.qtpl:28
qw422016.N().S(` <a href="/binary/`)
//line mycoopts/view.qtpl:28
qw422016.N().S(h.CanonicalName())
//line mycoopts/view.qtpl:28
qw422016.N().S(`">`)
//line mycoopts/view.qtpl:28
qw422016.E().S(lc.Get("ui.media_noaudio_link"))
//line mycoopts/view.qtpl:28
qw422016.N().S(`</a></p>
</audio>
</div>
`)
//line mycoopts/view.qtpl:32
default:
//line mycoopts/view.qtpl:32
qw422016.N().S(`
<div class="binary-container binary-container_with-nothing">
<p><a href="/binary/`)
//line mycoopts/view.qtpl:34
qw422016.N().S(h.CanonicalName())
//line mycoopts/view.qtpl:34
qw422016.N().S(`">`)
//line mycoopts/view.qtpl:34
qw422016.E().S(lc.Get("ui.media_download"))
//line mycoopts/view.qtpl:34
qw422016.N().S(`</a></p>
</div>
`)
//line mycoopts/view.qtpl:36
}
//line mycoopts/view.qtpl:36
qw422016.N().S(`
`)
//line mycoopts/view.qtpl:37
}
//line mycoopts/view.qtpl:37
func WriteMedia(qq422016 qtio422016.Writer, h *hyphae.MediaHypha, lc *l18n.Localizer) {
//line mycoopts/view.qtpl:37
qw422016 := qt422016.AcquireWriter(qq422016)
//line mycoopts/view.qtpl:37
StreamMedia(qw422016, h, lc)
//line mycoopts/view.qtpl:37
qt422016.ReleaseWriter(qw422016)
//line mycoopts/view.qtpl:37
}
//line mycoopts/view.qtpl:37
func Media(h *hyphae.MediaHypha, lc *l18n.Localizer) string {
//line mycoopts/view.qtpl:37
qb422016 := qt422016.AcquireByteBuffer()
//line mycoopts/view.qtpl:37
WriteMedia(qb422016, h, lc)
//line mycoopts/view.qtpl:37
qs422016 := string(qb422016.B)
//line mycoopts/view.qtpl:37
qt422016.ReleaseByteBuffer(qb422016)
//line mycoopts/view.qtpl:37
return qs422016
//line mycoopts/view.qtpl:37
}