Didn't have the chance to migrate //all// templates just yet. We'll get there.
* Implement yet another template system
* Move orphans to the new system and fix a bug in it
* Link orphans in the admin panel
* Move the backlink handlers to the web package
* Move auth routing to web
* Move /user-list to the new system
* Move change password and translate it
* Move stuff
* Move admin-related stuff to the web
* Move a lot of files into internal dir
Outside of it are web and stuff that needs further refactoring
* Fix static not loading and de-qtpl tree
* Move tree to internal
* Keep the globe on the same line #230
* Revert "Keep the globe on the same line #230"
This reverts commit ae78e5e459.
* Migrate templates from hypview: delete, edit, start empty and existing WIP
The delete media view was removed, I didn't even know it still existed as a GET. A rudiment.
* Make views multi-file and break compilation
* Megarefactoring of hypha views
* Auth-related stuffs
* Fix some of those weird imports
* Migrate cat views
* Fix cat js
* Lower standards
* Internalize trauma
191 lines
4.9 KiB
Go
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/internal/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
|
|
}
|