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