Make views multi-file and break compilation
This commit is contained in:
parent
86a8091bf6
commit
68a7573764
@ -48,26 +48,6 @@ func RenameHypha(meta viewutil.Meta, hyphaName string) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
type emptyHyphaData struct {
|
|
||||||
Meta viewutil.Meta
|
|
||||||
HyphaName string
|
|
||||||
AllowRegistration bool
|
|
||||||
UseAuth bool
|
|
||||||
}
|
|
||||||
|
|
||||||
func EmptyHypha(meta viewutil.Meta, hyphaName string) string {
|
|
||||||
var buf strings.Builder
|
|
||||||
if err := chainEmptyHypha.Get(meta).ExecuteTemplate(&buf, "empty hypha card", emptyHyphaData{
|
|
||||||
Meta: meta,
|
|
||||||
HyphaName: hyphaName,
|
|
||||||
AllowRegistration: cfg.AllowRegistration,
|
|
||||||
UseAuth: cfg.UseAuth,
|
|
||||||
}); err != nil {
|
|
||||||
log.Println(err)
|
|
||||||
}
|
|
||||||
return buf.String()
|
|
||||||
}
|
|
||||||
|
|
||||||
type naviTitleData struct {
|
type naviTitleData struct {
|
||||||
HyphaNameParts []string
|
HyphaNameParts []string
|
||||||
HyphaNamePartsWithParents []string
|
HyphaNamePartsWithParents []string
|
||||||
@ -87,7 +67,7 @@ func NaviTitle(meta viewutil.Meta, hyphaName string) template.HTML {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println(err)
|
log.Println(err)
|
||||||
}
|
}
|
||||||
return buf.String()
|
return template.HTML(buf.String())
|
||||||
}
|
}
|
||||||
|
|
||||||
func naviTitleify(hyphaName string) ([]string, []string) {
|
func naviTitleify(hyphaName string) ([]string, []string) {
|
||||||
|
|||||||
@ -5,12 +5,9 @@
|
|||||||
|
|
||||||
{% import "github.com/bouncepaw/mycorrhiza/internal/cfg" %}
|
{% import "github.com/bouncepaw/mycorrhiza/internal/cfg" %}
|
||||||
{% import "github.com/bouncepaw/mycorrhiza/internal/hyphae" %}
|
{% import "github.com/bouncepaw/mycorrhiza/internal/hyphae" %}
|
||||||
{% import "github.com/bouncepaw/mycorrhiza/categories" %}
|
|
||||||
{% import "github.com/bouncepaw/mycorrhiza/l18n" %}
|
{% import "github.com/bouncepaw/mycorrhiza/l18n" %}
|
||||||
{% import "github.com/bouncepaw/mycorrhiza/internal/mimetype" %}
|
{% import "github.com/bouncepaw/mycorrhiza/internal/mimetype" %}
|
||||||
{% import "github.com/bouncepaw/mycorrhiza/internal/tree" %}
|
|
||||||
{% import "github.com/bouncepaw/mycorrhiza/internal/user" %}
|
{% import "github.com/bouncepaw/mycorrhiza/internal/user" %}
|
||||||
{% import "github.com/bouncepaw/mycorrhiza/util" %}
|
|
||||||
{% import "github.com/bouncepaw/mycorrhiza/web/viewutil" %}
|
{% import "github.com/bouncepaw/mycorrhiza/web/viewutil" %}
|
||||||
|
|
||||||
{% func MediaMenu(rq *http.Request, h hyphae.Hypha, u *user.User) %}
|
{% func MediaMenu(rq *http.Request, h hyphae.Hypha, u *user.User) %}
|
||||||
|
|||||||
@ -23,629 +23,360 @@ import "github.com/bouncepaw/mycorrhiza/internal/cfg"
|
|||||||
import "github.com/bouncepaw/mycorrhiza/internal/hyphae"
|
import "github.com/bouncepaw/mycorrhiza/internal/hyphae"
|
||||||
|
|
||||||
//line hypview/readers.qtpl:8
|
//line hypview/readers.qtpl:8
|
||||||
import "github.com/bouncepaw/mycorrhiza/categories"
|
|
||||||
|
|
||||||
//line hypview/readers.qtpl:9
|
|
||||||
import "github.com/bouncepaw/mycorrhiza/l18n"
|
import "github.com/bouncepaw/mycorrhiza/l18n"
|
||||||
|
|
||||||
//line hypview/readers.qtpl:10
|
//line hypview/readers.qtpl:9
|
||||||
import "github.com/bouncepaw/mycorrhiza/internal/mimetype"
|
import "github.com/bouncepaw/mycorrhiza/internal/mimetype"
|
||||||
|
|
||||||
//line hypview/readers.qtpl:11
|
//line hypview/readers.qtpl:10
|
||||||
import "github.com/bouncepaw/mycorrhiza/tree"
|
|
||||||
|
|
||||||
//line hypview/readers.qtpl:12
|
|
||||||
import "github.com/bouncepaw/mycorrhiza/internal/user"
|
import "github.com/bouncepaw/mycorrhiza/internal/user"
|
||||||
|
|
||||||
//line hypview/readers.qtpl:13
|
//line hypview/readers.qtpl:11
|
||||||
import "github.com/bouncepaw/mycorrhiza/util"
|
|
||||||
|
|
||||||
//line hypview/readers.qtpl:14
|
|
||||||
import "github.com/bouncepaw/mycorrhiza/web/viewutil"
|
import "github.com/bouncepaw/mycorrhiza/web/viewutil"
|
||||||
|
|
||||||
//line hypview/readers.qtpl:16
|
//line hypview/readers.qtpl:13
|
||||||
import (
|
import (
|
||||||
qtio422016 "io"
|
qtio422016 "io"
|
||||||
|
|
||||||
qt422016 "github.com/valyala/quicktemplate"
|
qt422016 "github.com/valyala/quicktemplate"
|
||||||
)
|
)
|
||||||
|
|
||||||
//line hypview/readers.qtpl:16
|
//line hypview/readers.qtpl:13
|
||||||
var (
|
var (
|
||||||
_ = qtio422016.Copy
|
_ = qtio422016.Copy
|
||||||
_ = qt422016.AcquireByteBuffer
|
_ = qt422016.AcquireByteBuffer
|
||||||
)
|
)
|
||||||
|
|
||||||
//line hypview/readers.qtpl:16
|
//line hypview/readers.qtpl:13
|
||||||
func StreamMediaMenu(qw422016 *qt422016.Writer, rq *http.Request, h hyphae.Hypha, u *user.User) {
|
func StreamMediaMenu(qw422016 *qt422016.Writer, rq *http.Request, h hyphae.Hypha, u *user.User) {
|
||||||
//line hypview/readers.qtpl:16
|
//line hypview/readers.qtpl:13
|
||||||
qw422016.N().S(`
|
qw422016.N().S(`
|
||||||
`)
|
`)
|
||||||
//line hypview/readers.qtpl:18
|
//line hypview/readers.qtpl:15
|
||||||
lc := l18n.FromRequest(rq)
|
lc := l18n.FromRequest(rq)
|
||||||
|
|
||||||
//line hypview/readers.qtpl:19
|
//line hypview/readers.qtpl:16
|
||||||
qw422016.N().S(`
|
qw422016.N().S(`
|
||||||
<main class="main-width media-tab">
|
<main class="main-width media-tab">
|
||||||
<h1>`)
|
<h1>`)
|
||||||
//line hypview/readers.qtpl:21
|
//line hypview/readers.qtpl:18
|
||||||
qw422016.N().S(lc.Get("ui.media_title", &l18n.Replacements{"name": beautifulLink(h.CanonicalName())}))
|
qw422016.N().S(lc.Get("ui.media_title", &l18n.Replacements{"name": beautifulLink(h.CanonicalName())}))
|
||||||
//line hypview/readers.qtpl:21
|
//line hypview/readers.qtpl:18
|
||||||
qw422016.N().S(`</h1>
|
qw422016.N().S(`</h1>
|
||||||
`)
|
`)
|
||||||
//line hypview/readers.qtpl:22
|
//line hypview/readers.qtpl:19
|
||||||
switch h.(type) {
|
switch h.(type) {
|
||||||
//line hypview/readers.qtpl:23
|
//line hypview/readers.qtpl:20
|
||||||
case *hyphae.MediaHypha:
|
case *hyphae.MediaHypha:
|
||||||
//line hypview/readers.qtpl:23
|
//line hypview/readers.qtpl:20
|
||||||
qw422016.N().S(`
|
qw422016.N().S(`
|
||||||
<p class="explanation">`)
|
<p class="explanation">`)
|
||||||
//line hypview/readers.qtpl:24
|
//line hypview/readers.qtpl:21
|
||||||
qw422016.E().S(lc.Get("ui.media_tip"))
|
qw422016.E().S(lc.Get("ui.media_tip"))
|
||||||
//line hypview/readers.qtpl:24
|
//line hypview/readers.qtpl:21
|
||||||
qw422016.N().S(` <a href="/help/en/media" class="shy-link">`)
|
qw422016.N().S(` <a href="/help/en/media" class="shy-link">`)
|
||||||
//line hypview/readers.qtpl:24
|
//line hypview/readers.qtpl:21
|
||||||
qw422016.E().S(lc.Get("ui.media_what_is"))
|
qw422016.E().S(lc.Get("ui.media_what_is"))
|
||||||
//line hypview/readers.qtpl:24
|
//line hypview/readers.qtpl:21
|
||||||
qw422016.N().S(`</a></p>
|
qw422016.N().S(`</a></p>
|
||||||
`)
|
`)
|
||||||
//line hypview/readers.qtpl:25
|
//line hypview/readers.qtpl:22
|
||||||
default:
|
default:
|
||||||
//line hypview/readers.qtpl:25
|
//line hypview/readers.qtpl:22
|
||||||
qw422016.N().S(`
|
qw422016.N().S(`
|
||||||
<p class="explanation">`)
|
<p class="explanation">`)
|
||||||
//line hypview/readers.qtpl:26
|
//line hypview/readers.qtpl:23
|
||||||
qw422016.E().S(lc.Get("ui.media_empty"))
|
qw422016.E().S(lc.Get("ui.media_empty"))
|
||||||
//line hypview/readers.qtpl:26
|
//line hypview/readers.qtpl:23
|
||||||
qw422016.N().S(` <a href="/help/en/media" class="shy-link">`)
|
qw422016.N().S(` <a href="/help/en/media" class="shy-link">`)
|
||||||
//line hypview/readers.qtpl:26
|
//line hypview/readers.qtpl:23
|
||||||
qw422016.E().S(lc.Get("ui.media_what_is"))
|
qw422016.E().S(lc.Get("ui.media_what_is"))
|
||||||
//line hypview/readers.qtpl:26
|
//line hypview/readers.qtpl:23
|
||||||
qw422016.N().S(`</a></p>
|
qw422016.N().S(`</a></p>
|
||||||
`)
|
`)
|
||||||
//line hypview/readers.qtpl:27
|
//line hypview/readers.qtpl:24
|
||||||
}
|
}
|
||||||
//line hypview/readers.qtpl:27
|
//line hypview/readers.qtpl:24
|
||||||
qw422016.N().S(`
|
qw422016.N().S(`
|
||||||
|
|
||||||
<section class="amnt-grid">
|
<section class="amnt-grid">
|
||||||
`)
|
`)
|
||||||
//line hypview/readers.qtpl:30
|
//line hypview/readers.qtpl:27
|
||||||
switch h := h.(type) {
|
switch h := h.(type) {
|
||||||
//line hypview/readers.qtpl:31
|
//line hypview/readers.qtpl:28
|
||||||
case *hyphae.MediaHypha:
|
case *hyphae.MediaHypha:
|
||||||
//line hypview/readers.qtpl:31
|
//line hypview/readers.qtpl:28
|
||||||
qw422016.N().S(`
|
qw422016.N().S(`
|
||||||
`)
|
`)
|
||||||
//line hypview/readers.qtpl:33
|
//line hypview/readers.qtpl:30
|
||||||
mime := mimetype.FromExtension(path.Ext(h.MediaFilePath()))
|
mime := mimetype.FromExtension(path.Ext(h.MediaFilePath()))
|
||||||
fileinfo, err := os.Stat(h.MediaFilePath())
|
fileinfo, err := os.Stat(h.MediaFilePath())
|
||||||
|
|
||||||
//line hypview/readers.qtpl:34
|
//line hypview/readers.qtpl:31
|
||||||
qw422016.N().S(`
|
qw422016.N().S(`
|
||||||
`)
|
`)
|
||||||
//line hypview/readers.qtpl:35
|
//line hypview/readers.qtpl:32
|
||||||
if err == nil {
|
if err == nil {
|
||||||
//line hypview/readers.qtpl:35
|
//line hypview/readers.qtpl:32
|
||||||
qw422016.N().S(`
|
qw422016.N().S(`
|
||||||
<fieldset class="amnt-menu-block">
|
<fieldset class="amnt-menu-block">
|
||||||
<legend class="modal__title modal__title_small">`)
|
<legend class="modal__title modal__title_small">`)
|
||||||
//line hypview/readers.qtpl:37
|
//line hypview/readers.qtpl:34
|
||||||
qw422016.E().S(lc.Get("ui.media_stat"))
|
qw422016.E().S(lc.Get("ui.media_stat"))
|
||||||
//line hypview/readers.qtpl:37
|
//line hypview/readers.qtpl:34
|
||||||
qw422016.N().S(`</legend>
|
qw422016.N().S(`</legend>
|
||||||
<p class="modal__confirmation-msg"><b>`)
|
<p class="modal__confirmation-msg"><b>`)
|
||||||
//line hypview/readers.qtpl:38
|
//line hypview/readers.qtpl:35
|
||||||
qw422016.E().S(lc.Get("ui.media_stat_size"))
|
qw422016.E().S(lc.Get("ui.media_stat_size"))
|
||||||
//line hypview/readers.qtpl:38
|
//line hypview/readers.qtpl:35
|
||||||
qw422016.N().S(`</b> `)
|
qw422016.N().S(`</b> `)
|
||||||
//line hypview/readers.qtpl:38
|
//line hypview/readers.qtpl:35
|
||||||
qw422016.E().S(lc.GetPlural64("ui.media_size_value", fileinfo.Size()))
|
qw422016.E().S(lc.GetPlural64("ui.media_size_value", fileinfo.Size()))
|
||||||
//line hypview/readers.qtpl:38
|
//line hypview/readers.qtpl:35
|
||||||
qw422016.N().S(`</p>
|
qw422016.N().S(`</p>
|
||||||
<p><b>`)
|
<p><b>`)
|
||||||
//line hypview/readers.qtpl:39
|
//line hypview/readers.qtpl:36
|
||||||
qw422016.E().S(lc.Get("ui.media_stat_mime"))
|
qw422016.E().S(lc.Get("ui.media_stat_mime"))
|
||||||
//line hypview/readers.qtpl:39
|
//line hypview/readers.qtpl:36
|
||||||
qw422016.N().S(`</b> `)
|
qw422016.N().S(`</b> `)
|
||||||
//line hypview/readers.qtpl:39
|
//line hypview/readers.qtpl:36
|
||||||
qw422016.E().S(mime)
|
qw422016.E().S(mime)
|
||||||
//line hypview/readers.qtpl:39
|
//line hypview/readers.qtpl:36
|
||||||
qw422016.N().S(`</p>
|
qw422016.N().S(`</p>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
`)
|
`)
|
||||||
//line hypview/readers.qtpl:41
|
//line hypview/readers.qtpl:38
|
||||||
}
|
}
|
||||||
//line hypview/readers.qtpl:41
|
//line hypview/readers.qtpl:38
|
||||||
qw422016.N().S(`
|
qw422016.N().S(`
|
||||||
|
|
||||||
`)
|
`)
|
||||||
//line hypview/readers.qtpl:43
|
//line hypview/readers.qtpl:40
|
||||||
if strings.HasPrefix(mime, "image/") {
|
if strings.HasPrefix(mime, "image/") {
|
||||||
//line hypview/readers.qtpl:43
|
//line hypview/readers.qtpl:40
|
||||||
qw422016.N().S(`
|
qw422016.N().S(`
|
||||||
<fieldset class="amnt-menu-block">
|
<fieldset class="amnt-menu-block">
|
||||||
<legend class="modal__title modal__title_small">`)
|
<legend class="modal__title modal__title_small">`)
|
||||||
//line hypview/readers.qtpl:45
|
//line hypview/readers.qtpl:42
|
||||||
qw422016.E().S(lc.Get("ui.media_include"))
|
qw422016.E().S(lc.Get("ui.media_include"))
|
||||||
//line hypview/readers.qtpl:45
|
//line hypview/readers.qtpl:42
|
||||||
qw422016.N().S(`</legend>
|
qw422016.N().S(`</legend>
|
||||||
<p class="modal__confirmation-msg">`)
|
<p class="modal__confirmation-msg">`)
|
||||||
//line hypview/readers.qtpl:46
|
//line hypview/readers.qtpl:43
|
||||||
qw422016.E().S(lc.Get("ui.media_include_tip"))
|
qw422016.E().S(lc.Get("ui.media_include_tip"))
|
||||||
//line hypview/readers.qtpl:46
|
//line hypview/readers.qtpl:43
|
||||||
qw422016.N().S(`</p>
|
qw422016.N().S(`</p>
|
||||||
<pre class="codeblock"><code>img { `)
|
<pre class="codeblock"><code>img { `)
|
||||||
//line hypview/readers.qtpl:47
|
//line hypview/readers.qtpl:44
|
||||||
qw422016.E().S(h.CanonicalName())
|
qw422016.E().S(h.CanonicalName())
|
||||||
//line hypview/readers.qtpl:47
|
//line hypview/readers.qtpl:44
|
||||||
qw422016.N().S(` }</code></pre>
|
qw422016.N().S(` }</code></pre>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
`)
|
`)
|
||||||
//line hypview/readers.qtpl:49
|
//line hypview/readers.qtpl:46
|
||||||
}
|
}
|
||||||
//line hypview/readers.qtpl:49
|
//line hypview/readers.qtpl:46
|
||||||
qw422016.N().S(`
|
qw422016.N().S(`
|
||||||
`)
|
`)
|
||||||
//line hypview/readers.qtpl:50
|
//line hypview/readers.qtpl:47
|
||||||
}
|
}
|
||||||
//line hypview/readers.qtpl:50
|
//line hypview/readers.qtpl:47
|
||||||
qw422016.N().S(`
|
qw422016.N().S(`
|
||||||
|
|
||||||
`)
|
`)
|
||||||
//line hypview/readers.qtpl:52
|
//line hypview/readers.qtpl:49
|
||||||
if u.CanProceed("upload-binary") {
|
if u.CanProceed("upload-binary") {
|
||||||
//line hypview/readers.qtpl:52
|
//line hypview/readers.qtpl:49
|
||||||
qw422016.N().S(`
|
qw422016.N().S(`
|
||||||
<form action="/upload-binary/`)
|
<form action="/upload-binary/`)
|
||||||
//line hypview/readers.qtpl:53
|
//line hypview/readers.qtpl:50
|
||||||
qw422016.E().S(h.CanonicalName())
|
qw422016.E().S(h.CanonicalName())
|
||||||
//line hypview/readers.qtpl:53
|
//line hypview/readers.qtpl:50
|
||||||
qw422016.N().S(`"
|
qw422016.N().S(`"
|
||||||
method="post" enctype="multipart/form-data"
|
method="post" enctype="multipart/form-data"
|
||||||
class="upload-binary modal amnt-menu-block">
|
class="upload-binary modal amnt-menu-block">
|
||||||
<fieldset class="modal__fieldset">
|
<fieldset class="modal__fieldset">
|
||||||
<legend class="modal__title modal__title_small">`)
|
<legend class="modal__title modal__title_small">`)
|
||||||
//line hypview/readers.qtpl:57
|
//line hypview/readers.qtpl:54
|
||||||
qw422016.E().S(lc.Get("ui.media_new"))
|
qw422016.E().S(lc.Get("ui.media_new"))
|
||||||
//line hypview/readers.qtpl:57
|
//line hypview/readers.qtpl:54
|
||||||
qw422016.N().S(`</legend>
|
qw422016.N().S(`</legend>
|
||||||
<p class="modal__confirmation-msg">`)
|
<p class="modal__confirmation-msg">`)
|
||||||
//line hypview/readers.qtpl:58
|
//line hypview/readers.qtpl:55
|
||||||
qw422016.E().S(lc.Get("ui.media_new_tip"))
|
qw422016.E().S(lc.Get("ui.media_new_tip"))
|
||||||
//line hypview/readers.qtpl:58
|
//line hypview/readers.qtpl:55
|
||||||
qw422016.N().S(`</p>
|
qw422016.N().S(`</p>
|
||||||
<label for="upload-binary__input"></label>
|
<label for="upload-binary__input"></label>
|
||||||
<input type="file" id="upload-binary__input" name="binary">
|
<input type="file" id="upload-binary__input" name="binary">
|
||||||
|
|
||||||
<button type="submit" class="btn stick-to-bottom" value="Upload">`)
|
<button type="submit" class="btn stick-to-bottom" value="Upload">`)
|
||||||
//line hypview/readers.qtpl:62
|
//line hypview/readers.qtpl:59
|
||||||
qw422016.E().S(lc.Get("ui.media_upload"))
|
qw422016.E().S(lc.Get("ui.media_upload"))
|
||||||
//line hypview/readers.qtpl:62
|
//line hypview/readers.qtpl:59
|
||||||
qw422016.N().S(`</button>
|
qw422016.N().S(`</button>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</form>
|
</form>
|
||||||
`)
|
`)
|
||||||
//line hypview/readers.qtpl:65
|
//line hypview/readers.qtpl:62
|
||||||
}
|
}
|
||||||
//line hypview/readers.qtpl:65
|
//line hypview/readers.qtpl:62
|
||||||
qw422016.N().S(`
|
qw422016.N().S(`
|
||||||
|
|
||||||
|
|
||||||
`)
|
`)
|
||||||
//line hypview/readers.qtpl:68
|
//line hypview/readers.qtpl:65
|
||||||
switch h := h.(type) {
|
switch h := h.(type) {
|
||||||
//line hypview/readers.qtpl:69
|
//line hypview/readers.qtpl:66
|
||||||
case *hyphae.MediaHypha:
|
case *hyphae.MediaHypha:
|
||||||
//line hypview/readers.qtpl:69
|
//line hypview/readers.qtpl:66
|
||||||
qw422016.N().S(`
|
qw422016.N().S(`
|
||||||
`)
|
`)
|
||||||
//line hypview/readers.qtpl:70
|
//line hypview/readers.qtpl:67
|
||||||
if u.CanProceed("remove-media") {
|
if u.CanProceed("remove-media") {
|
||||||
//line hypview/readers.qtpl:70
|
//line hypview/readers.qtpl:67
|
||||||
qw422016.N().S(`
|
qw422016.N().S(`
|
||||||
<form action="/remove-media/`)
|
<form action="/remove-media/`)
|
||||||
//line hypview/readers.qtpl:71
|
//line hypview/readers.qtpl:68
|
||||||
qw422016.E().S(h.CanonicalName())
|
qw422016.E().S(h.CanonicalName())
|
||||||
//line hypview/readers.qtpl:71
|
//line hypview/readers.qtpl:68
|
||||||
qw422016.N().S(`" method="post" class="modal amnt-menu-block" method="POST">
|
qw422016.N().S(`" method="post" class="modal amnt-menu-block" method="POST">
|
||||||
<fieldset class="modal__fieldset">
|
<fieldset class="modal__fieldset">
|
||||||
<legend class="modal__title modal__title_small">`)
|
<legend class="modal__title modal__title_small">`)
|
||||||
//line hypview/readers.qtpl:73
|
//line hypview/readers.qtpl:70
|
||||||
qw422016.E().S(lc.Get("ui.media_remove"))
|
qw422016.E().S(lc.Get("ui.media_remove"))
|
||||||
//line hypview/readers.qtpl:73
|
//line hypview/readers.qtpl:70
|
||||||
qw422016.N().S(`</legend>
|
qw422016.N().S(`</legend>
|
||||||
<p class="modal__confirmation-msg">`)
|
<p class="modal__confirmation-msg">`)
|
||||||
//line hypview/readers.qtpl:74
|
//line hypview/readers.qtpl:71
|
||||||
qw422016.E().S(lc.Get("ui.media_remove_tip"))
|
qw422016.E().S(lc.Get("ui.media_remove_tip"))
|
||||||
//line hypview/readers.qtpl:74
|
//line hypview/readers.qtpl:71
|
||||||
qw422016.N().S(`</p>
|
qw422016.N().S(`</p>
|
||||||
<button type="submit" class="btn" value="Remove media">`)
|
<button type="submit" class="btn" value="Remove media">`)
|
||||||
//line hypview/readers.qtpl:75
|
//line hypview/readers.qtpl:72
|
||||||
qw422016.E().S(lc.Get("ui.media_remove_button"))
|
qw422016.E().S(lc.Get("ui.media_remove_button"))
|
||||||
//line hypview/readers.qtpl:75
|
//line hypview/readers.qtpl:72
|
||||||
qw422016.N().S(`</button>
|
qw422016.N().S(`</button>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</form>
|
</form>
|
||||||
`)
|
`)
|
||||||
//line hypview/readers.qtpl:78
|
//line hypview/readers.qtpl:75
|
||||||
}
|
}
|
||||||
//line hypview/readers.qtpl:78
|
//line hypview/readers.qtpl:75
|
||||||
qw422016.N().S(`
|
qw422016.N().S(`
|
||||||
`)
|
`)
|
||||||
//line hypview/readers.qtpl:79
|
//line hypview/readers.qtpl:76
|
||||||
}
|
}
|
||||||
//line hypview/readers.qtpl:79
|
//line hypview/readers.qtpl:76
|
||||||
qw422016.N().S(`
|
qw422016.N().S(`
|
||||||
|
|
||||||
</section>
|
</section>
|
||||||
</main>
|
</main>
|
||||||
`)
|
`)
|
||||||
//line hypview/readers.qtpl:83
|
//line hypview/readers.qtpl:80
|
||||||
}
|
}
|
||||||
|
|
||||||
//line hypview/readers.qtpl:83
|
//line hypview/readers.qtpl:80
|
||||||
func WriteMediaMenu(qq422016 qtio422016.Writer, rq *http.Request, h hyphae.Hypha, u *user.User) {
|
func WriteMediaMenu(qq422016 qtio422016.Writer, rq *http.Request, h hyphae.Hypha, u *user.User) {
|
||||||
//line hypview/readers.qtpl:83
|
//line hypview/readers.qtpl:80
|
||||||
qw422016 := qt422016.AcquireWriter(qq422016)
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
||||||
//line hypview/readers.qtpl:83
|
//line hypview/readers.qtpl:80
|
||||||
StreamMediaMenu(qw422016, rq, h, u)
|
StreamMediaMenu(qw422016, rq, h, u)
|
||||||
//line hypview/readers.qtpl:83
|
//line hypview/readers.qtpl:80
|
||||||
qt422016.ReleaseWriter(qw422016)
|
qt422016.ReleaseWriter(qw422016)
|
||||||
//line hypview/readers.qtpl:83
|
//line hypview/readers.qtpl:80
|
||||||
}
|
}
|
||||||
|
|
||||||
//line hypview/readers.qtpl:83
|
//line hypview/readers.qtpl:80
|
||||||
func MediaMenu(rq *http.Request, h hyphae.Hypha, u *user.User) string {
|
func MediaMenu(rq *http.Request, h hyphae.Hypha, u *user.User) string {
|
||||||
//line hypview/readers.qtpl:83
|
//line hypview/readers.qtpl:80
|
||||||
qb422016 := qt422016.AcquireByteBuffer()
|
qb422016 := qt422016.AcquireByteBuffer()
|
||||||
//line hypview/readers.qtpl:83
|
//line hypview/readers.qtpl:80
|
||||||
WriteMediaMenu(qb422016, rq, h, u)
|
WriteMediaMenu(qb422016, rq, h, u)
|
||||||
//line hypview/readers.qtpl:83
|
//line hypview/readers.qtpl:80
|
||||||
qs422016 := string(qb422016.B)
|
qs422016 := string(qb422016.B)
|
||||||
//line hypview/readers.qtpl:83
|
//line hypview/readers.qtpl:80
|
||||||
qt422016.ReleaseByteBuffer(qb422016)
|
qt422016.ReleaseByteBuffer(qb422016)
|
||||||
//line hypview/readers.qtpl:83
|
//line hypview/readers.qtpl:80
|
||||||
return qs422016
|
return qs422016
|
||||||
|
//line hypview/readers.qtpl:80
|
||||||
|
}
|
||||||
|
|
||||||
//line hypview/readers.qtpl:83
|
//line hypview/readers.qtpl:83
|
||||||
}
|
|
||||||
|
|
||||||
// If `contents` == "", a helpful message is shown instead.
|
|
||||||
//
|
|
||||||
// If you rename .prevnext, change the docs too.
|
|
||||||
|
|
||||||
//line hypview/readers.qtpl:88
|
|
||||||
func StreamHypha(qw422016 *qt422016.Writer, meta viewutil.Meta, h hyphae.Hypha, contents string) {
|
|
||||||
//line hypview/readers.qtpl:88
|
|
||||||
qw422016.N().S(`
|
|
||||||
`)
|
|
||||||
//line hypview/readers.qtpl:90
|
|
||||||
subhyphae, prevHyphaName, nextHyphaName := tree.Tree(h.CanonicalName())
|
|
||||||
lc := meta.Lc
|
|
||||||
|
|
||||||
//line hypview/readers.qtpl:92
|
|
||||||
qw422016.N().S(`
|
|
||||||
<main class="main-width">
|
|
||||||
<section id="hypha">
|
|
||||||
`)
|
|
||||||
//line hypview/readers.qtpl:95
|
|
||||||
if meta.U.CanProceed("edit") {
|
|
||||||
//line hypview/readers.qtpl:95
|
|
||||||
qw422016.N().S(`
|
|
||||||
<div class="btn btn_navititle">
|
|
||||||
<a class="btn__link_navititle" href="/edit/`)
|
|
||||||
//line hypview/readers.qtpl:97
|
|
||||||
qw422016.E().S(h.CanonicalName())
|
|
||||||
//line hypview/readers.qtpl:97
|
|
||||||
qw422016.N().S(`">`)
|
|
||||||
//line hypview/readers.qtpl:97
|
|
||||||
qw422016.E().S(lc.Get("ui.edit_link"))
|
|
||||||
//line hypview/readers.qtpl:97
|
|
||||||
qw422016.N().S(`</a>
|
|
||||||
</div>
|
|
||||||
`)
|
|
||||||
//line hypview/readers.qtpl:99
|
|
||||||
}
|
|
||||||
//line hypview/readers.qtpl:99
|
|
||||||
qw422016.N().S(`
|
|
||||||
|
|
||||||
`)
|
|
||||||
//line hypview/readers.qtpl:101
|
|
||||||
if cfg.UseAuth && util.IsProfileName(h.CanonicalName()) && meta.U.Name == strings.TrimPrefix(h.CanonicalName(), cfg.UserHypha+"/") {
|
|
||||||
//line hypview/readers.qtpl:101
|
|
||||||
qw422016.N().S(`
|
|
||||||
<div class="btn btn_navititle">
|
|
||||||
<a class="btn__link_navititle" href="/logout">`)
|
|
||||||
//line hypview/readers.qtpl:103
|
|
||||||
qw422016.E().S(lc.Get("ui.logout_link"))
|
|
||||||
//line hypview/readers.qtpl:103
|
|
||||||
qw422016.N().S(`</a>
|
|
||||||
</div>
|
|
||||||
`)
|
|
||||||
//line hypview/readers.qtpl:105
|
|
||||||
if meta.U.Group == "admin" {
|
|
||||||
//line hypview/readers.qtpl:105
|
|
||||||
qw422016.N().S(`
|
|
||||||
<div class="btn btn_navititle">
|
|
||||||
<a class="btn__link_navititle" href="/admin">`)
|
|
||||||
//line hypview/readers.qtpl:107
|
|
||||||
qw422016.E().S(lc.Get("ui.admin_panel"))
|
|
||||||
//line hypview/readers.qtpl:107
|
|
||||||
qw422016.N().S(`<a>
|
|
||||||
</div>
|
|
||||||
`)
|
|
||||||
//line hypview/readers.qtpl:109
|
|
||||||
}
|
|
||||||
//line hypview/readers.qtpl:109
|
|
||||||
qw422016.N().S(`
|
|
||||||
`)
|
|
||||||
//line hypview/readers.qtpl:110
|
|
||||||
}
|
|
||||||
//line hypview/readers.qtpl:110
|
|
||||||
qw422016.N().S(`
|
|
||||||
|
|
||||||
`)
|
|
||||||
//line hypview/readers.qtpl:112
|
|
||||||
qw422016.N().S(NaviTitle(meta, h.CanonicalName()))
|
|
||||||
//line hypview/readers.qtpl:112
|
|
||||||
qw422016.N().S(`
|
|
||||||
`)
|
|
||||||
//line hypview/readers.qtpl:113
|
|
||||||
switch h.(type) {
|
|
||||||
//line hypview/readers.qtpl:114
|
|
||||||
case *hyphae.EmptyHypha:
|
|
||||||
//line hypview/readers.qtpl:114
|
|
||||||
qw422016.N().S(`
|
|
||||||
`)
|
|
||||||
//line hypview/readers.qtpl:115
|
|
||||||
qw422016.N().S(EmptyHypha(meta, h.CanonicalName()))
|
|
||||||
//line hypview/readers.qtpl:115
|
|
||||||
qw422016.N().S(`
|
|
||||||
`)
|
|
||||||
//line hypview/readers.qtpl:116
|
|
||||||
default:
|
|
||||||
//line hypview/readers.qtpl:116
|
|
||||||
qw422016.N().S(`
|
|
||||||
`)
|
|
||||||
//line hypview/readers.qtpl:117
|
|
||||||
qw422016.N().S(contents)
|
|
||||||
//line hypview/readers.qtpl:117
|
|
||||||
qw422016.N().S(`
|
|
||||||
`)
|
|
||||||
//line hypview/readers.qtpl:118
|
|
||||||
}
|
|
||||||
//line hypview/readers.qtpl:118
|
|
||||||
qw422016.N().S(`
|
|
||||||
</section>
|
|
||||||
<section class="prevnext">
|
|
||||||
`)
|
|
||||||
//line hypview/readers.qtpl:121
|
|
||||||
if prevHyphaName != "" {
|
|
||||||
//line hypview/readers.qtpl:121
|
|
||||||
qw422016.N().S(`
|
|
||||||
<a class="prevnext__el prevnext__prev" href="/hypha/`)
|
|
||||||
//line hypview/readers.qtpl:122
|
|
||||||
qw422016.E().S(prevHyphaName)
|
|
||||||
//line hypview/readers.qtpl:122
|
|
||||||
qw422016.N().S(`" rel="prev">← `)
|
|
||||||
//line hypview/readers.qtpl:122
|
|
||||||
qw422016.E().S(util.BeautifulName(path.Base(prevHyphaName)))
|
|
||||||
//line hypview/readers.qtpl:122
|
|
||||||
qw422016.N().S(`</a>
|
|
||||||
`)
|
|
||||||
//line hypview/readers.qtpl:123
|
|
||||||
}
|
|
||||||
//line hypview/readers.qtpl:123
|
|
||||||
qw422016.N().S(`
|
|
||||||
`)
|
|
||||||
//line hypview/readers.qtpl:124
|
|
||||||
if nextHyphaName != "" {
|
|
||||||
//line hypview/readers.qtpl:124
|
|
||||||
qw422016.N().S(`
|
|
||||||
<a class="prevnext__el prevnext__next" href="/hypha/`)
|
|
||||||
//line hypview/readers.qtpl:125
|
|
||||||
qw422016.E().S(nextHyphaName)
|
|
||||||
//line hypview/readers.qtpl:125
|
|
||||||
qw422016.N().S(`" rel="next">`)
|
|
||||||
//line hypview/readers.qtpl:125
|
|
||||||
qw422016.E().S(util.BeautifulName(path.Base(nextHyphaName)))
|
|
||||||
//line hypview/readers.qtpl:125
|
|
||||||
qw422016.N().S(` →</a>
|
|
||||||
`)
|
|
||||||
//line hypview/readers.qtpl:126
|
|
||||||
}
|
|
||||||
//line hypview/readers.qtpl:126
|
|
||||||
qw422016.N().S(`
|
|
||||||
</section>
|
|
||||||
`)
|
|
||||||
//line hypview/readers.qtpl:128
|
|
||||||
if strings.TrimSpace(subhyphae) != "" {
|
|
||||||
//line hypview/readers.qtpl:128
|
|
||||||
qw422016.N().S(`
|
|
||||||
<section class="subhyphae">
|
|
||||||
<h2 class="subhyphae__title">`)
|
|
||||||
//line hypview/readers.qtpl:130
|
|
||||||
qw422016.E().S(lc.Get("ui.subhyphae"))
|
|
||||||
//line hypview/readers.qtpl:130
|
|
||||||
qw422016.N().S(`</h2>
|
|
||||||
<nav class="subhyphae__nav">
|
|
||||||
<ul class="subhyphae__list">
|
|
||||||
`)
|
|
||||||
//line hypview/readers.qtpl:133
|
|
||||||
qw422016.N().S(subhyphae)
|
|
||||||
//line hypview/readers.qtpl:133
|
|
||||||
qw422016.N().S(`
|
|
||||||
</ul>
|
|
||||||
</nav>
|
|
||||||
</section>
|
|
||||||
`)
|
|
||||||
//line hypview/readers.qtpl:137
|
|
||||||
}
|
|
||||||
//line hypview/readers.qtpl:137
|
|
||||||
qw422016.N().S(`
|
|
||||||
<section id="hypha-bottom">
|
|
||||||
`)
|
|
||||||
//line hypview/readers.qtpl:139
|
|
||||||
streamhyphaInfo(qw422016, meta, h)
|
|
||||||
//line hypview/readers.qtpl:139
|
|
||||||
qw422016.N().S(`
|
|
||||||
</section>
|
|
||||||
</main>
|
|
||||||
`)
|
|
||||||
//line hypview/readers.qtpl:142
|
|
||||||
qw422016.N().S(categories.CategoryCard(meta, h.CanonicalName()))
|
|
||||||
//line hypview/readers.qtpl:142
|
|
||||||
qw422016.N().S(`
|
|
||||||
`)
|
|
||||||
//line hypview/readers.qtpl:143
|
|
||||||
streamviewScripts(qw422016)
|
|
||||||
//line hypview/readers.qtpl:143
|
|
||||||
qw422016.N().S(`
|
|
||||||
`)
|
|
||||||
//line hypview/readers.qtpl:144
|
|
||||||
}
|
|
||||||
|
|
||||||
//line hypview/readers.qtpl:144
|
|
||||||
func WriteHypha(qq422016 qtio422016.Writer, meta viewutil.Meta, h hyphae.Hypha, contents string) {
|
|
||||||
//line hypview/readers.qtpl:144
|
|
||||||
qw422016 := qt422016.AcquireWriter(qq422016)
|
|
||||||
//line hypview/readers.qtpl:144
|
|
||||||
StreamHypha(qw422016, meta, h, contents)
|
|
||||||
//line hypview/readers.qtpl:144
|
|
||||||
qt422016.ReleaseWriter(qw422016)
|
|
||||||
//line hypview/readers.qtpl:144
|
|
||||||
}
|
|
||||||
|
|
||||||
//line hypview/readers.qtpl:144
|
|
||||||
func Hypha(meta viewutil.Meta, h hyphae.Hypha, contents string) string {
|
|
||||||
//line hypview/readers.qtpl:144
|
|
||||||
qb422016 := qt422016.AcquireByteBuffer()
|
|
||||||
//line hypview/readers.qtpl:144
|
|
||||||
WriteHypha(qb422016, meta, h, contents)
|
|
||||||
//line hypview/readers.qtpl:144
|
|
||||||
qs422016 := string(qb422016.B)
|
|
||||||
//line hypview/readers.qtpl:144
|
|
||||||
qt422016.ReleaseByteBuffer(qb422016)
|
|
||||||
//line hypview/readers.qtpl:144
|
|
||||||
return qs422016
|
|
||||||
//line hypview/readers.qtpl:144
|
|
||||||
}
|
|
||||||
|
|
||||||
//line hypview/readers.qtpl:146
|
|
||||||
func StreamRevision(qw422016 *qt422016.Writer, meta viewutil.Meta, h hyphae.Hypha, contents, revHash string) {
|
func StreamRevision(qw422016 *qt422016.Writer, meta viewutil.Meta, h hyphae.Hypha, contents, revHash string) {
|
||||||
//line hypview/readers.qtpl:146
|
//line hypview/readers.qtpl:83
|
||||||
qw422016.N().S(`
|
qw422016.N().S(`
|
||||||
<main class="main-width">
|
<main class="main-width">
|
||||||
<section>
|
<section>
|
||||||
<p>`)
|
<p>`)
|
||||||
//line hypview/readers.qtpl:149
|
//line hypview/readers.qtpl:86
|
||||||
qw422016.E().S(meta.Lc.Get("ui.revision_warning"))
|
qw422016.E().S(meta.Lc.Get("ui.revision_warning"))
|
||||||
//line hypview/readers.qtpl:149
|
//line hypview/readers.qtpl:86
|
||||||
qw422016.N().S(` <a href="/rev-text/`)
|
qw422016.N().S(` <a href="/rev-text/`)
|
||||||
//line hypview/readers.qtpl:149
|
//line hypview/readers.qtpl:86
|
||||||
qw422016.E().S(revHash)
|
qw422016.E().S(revHash)
|
||||||
//line hypview/readers.qtpl:149
|
//line hypview/readers.qtpl:86
|
||||||
qw422016.N().S(`/`)
|
qw422016.N().S(`/`)
|
||||||
//line hypview/readers.qtpl:149
|
//line hypview/readers.qtpl:86
|
||||||
qw422016.E().S(h.CanonicalName())
|
qw422016.E().S(h.CanonicalName())
|
||||||
//line hypview/readers.qtpl:149
|
//line hypview/readers.qtpl:86
|
||||||
qw422016.N().S(`">`)
|
qw422016.N().S(`">`)
|
||||||
//line hypview/readers.qtpl:149
|
//line hypview/readers.qtpl:86
|
||||||
qw422016.E().S(meta.Lc.Get("ui.revision_link"))
|
qw422016.E().S(meta.Lc.Get("ui.revision_link"))
|
||||||
//line hypview/readers.qtpl:149
|
//line hypview/readers.qtpl:86
|
||||||
qw422016.N().S(`</a></p>
|
qw422016.N().S(`</a></p>
|
||||||
`)
|
`)
|
||||||
//line hypview/readers.qtpl:150
|
//line hypview/readers.qtpl:87
|
||||||
qw422016.N().S(NaviTitle(meta, h.CanonicalName()))
|
qw422016.N().S(NaviTitle(meta, h.CanonicalName()))
|
||||||
//line hypview/readers.qtpl:150
|
//line hypview/readers.qtpl:87
|
||||||
qw422016.N().S(`
|
qw422016.N().S(`
|
||||||
`)
|
`)
|
||||||
//line hypview/readers.qtpl:151
|
//line hypview/readers.qtpl:88
|
||||||
qw422016.N().S(contents)
|
qw422016.N().S(contents)
|
||||||
//line hypview/readers.qtpl:151
|
//line hypview/readers.qtpl:88
|
||||||
qw422016.N().S(`
|
qw422016.N().S(`
|
||||||
</section>
|
</section>
|
||||||
</main>
|
</main>
|
||||||
`)
|
`)
|
||||||
//line hypview/readers.qtpl:154
|
//line hypview/readers.qtpl:91
|
||||||
streamviewScripts(qw422016)
|
|
||||||
//line hypview/readers.qtpl:154
|
|
||||||
qw422016.N().S(`
|
|
||||||
`)
|
|
||||||
//line hypview/readers.qtpl:155
|
|
||||||
}
|
|
||||||
|
|
||||||
//line hypview/readers.qtpl:155
|
|
||||||
func WriteRevision(qq422016 qtio422016.Writer, meta viewutil.Meta, h hyphae.Hypha, contents, revHash string) {
|
|
||||||
//line hypview/readers.qtpl:155
|
|
||||||
qw422016 := qt422016.AcquireWriter(qq422016)
|
|
||||||
//line hypview/readers.qtpl:155
|
|
||||||
StreamRevision(qw422016, meta, h, contents, revHash)
|
|
||||||
//line hypview/readers.qtpl:155
|
|
||||||
qt422016.ReleaseWriter(qw422016)
|
|
||||||
//line hypview/readers.qtpl:155
|
|
||||||
}
|
|
||||||
|
|
||||||
//line hypview/readers.qtpl:155
|
|
||||||
func Revision(meta viewutil.Meta, h hyphae.Hypha, contents, revHash string) string {
|
|
||||||
//line hypview/readers.qtpl:155
|
|
||||||
qb422016 := qt422016.AcquireByteBuffer()
|
|
||||||
//line hypview/readers.qtpl:155
|
|
||||||
WriteRevision(qb422016, meta, h, contents, revHash)
|
|
||||||
//line hypview/readers.qtpl:155
|
|
||||||
qs422016 := string(qb422016.B)
|
|
||||||
//line hypview/readers.qtpl:155
|
|
||||||
qt422016.ReleaseByteBuffer(qb422016)
|
|
||||||
//line hypview/readers.qtpl:155
|
|
||||||
return qs422016
|
|
||||||
//line hypview/readers.qtpl:155
|
|
||||||
}
|
|
||||||
|
|
||||||
//line hypview/readers.qtpl:157
|
|
||||||
func streamviewScripts(qw422016 *qt422016.Writer) {
|
|
||||||
//line hypview/readers.qtpl:157
|
|
||||||
qw422016.N().S(`
|
|
||||||
`)
|
|
||||||
//line hypview/readers.qtpl:158
|
|
||||||
for _, scriptPath := range cfg.ViewScripts {
|
for _, scriptPath := range cfg.ViewScripts {
|
||||||
//line hypview/readers.qtpl:158
|
//line hypview/readers.qtpl:91
|
||||||
qw422016.N().S(`
|
qw422016.N().S(`
|
||||||
<script src="`)
|
<script src="`)
|
||||||
//line hypview/readers.qtpl:159
|
//line hypview/readers.qtpl:92
|
||||||
qw422016.E().S(scriptPath)
|
qw422016.E().S(scriptPath)
|
||||||
//line hypview/readers.qtpl:159
|
//line hypview/readers.qtpl:92
|
||||||
qw422016.N().S(`"></script>
|
qw422016.N().S(`"></script>
|
||||||
`)
|
`)
|
||||||
//line hypview/readers.qtpl:160
|
//line hypview/readers.qtpl:93
|
||||||
}
|
}
|
||||||
//line hypview/readers.qtpl:160
|
//line hypview/readers.qtpl:93
|
||||||
qw422016.N().S(`
|
qw422016.N().S(`
|
||||||
`)
|
`)
|
||||||
//line hypview/readers.qtpl:161
|
//line hypview/readers.qtpl:94
|
||||||
}
|
}
|
||||||
|
|
||||||
//line hypview/readers.qtpl:161
|
//line hypview/readers.qtpl:94
|
||||||
func writeviewScripts(qq422016 qtio422016.Writer) {
|
func WriteRevision(qq422016 qtio422016.Writer, meta viewutil.Meta, h hyphae.Hypha, contents, revHash string) {
|
||||||
//line hypview/readers.qtpl:161
|
//line hypview/readers.qtpl:94
|
||||||
qw422016 := qt422016.AcquireWriter(qq422016)
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
||||||
//line hypview/readers.qtpl:161
|
//line hypview/readers.qtpl:94
|
||||||
streamviewScripts(qw422016)
|
StreamRevision(qw422016, meta, h, contents, revHash)
|
||||||
//line hypview/readers.qtpl:161
|
//line hypview/readers.qtpl:94
|
||||||
qt422016.ReleaseWriter(qw422016)
|
qt422016.ReleaseWriter(qw422016)
|
||||||
//line hypview/readers.qtpl:161
|
//line hypview/readers.qtpl:94
|
||||||
}
|
}
|
||||||
|
|
||||||
//line hypview/readers.qtpl:161
|
//line hypview/readers.qtpl:94
|
||||||
func viewScripts() string {
|
func Revision(meta viewutil.Meta, h hyphae.Hypha, contents, revHash string) string {
|
||||||
//line hypview/readers.qtpl:161
|
//line hypview/readers.qtpl:94
|
||||||
qb422016 := qt422016.AcquireByteBuffer()
|
qb422016 := qt422016.AcquireByteBuffer()
|
||||||
//line hypview/readers.qtpl:161
|
//line hypview/readers.qtpl:94
|
||||||
writeviewScripts(qb422016)
|
WriteRevision(qb422016, meta, h, contents, revHash)
|
||||||
//line hypview/readers.qtpl:161
|
//line hypview/readers.qtpl:94
|
||||||
qs422016 := string(qb422016.B)
|
qs422016 := string(qb422016.B)
|
||||||
//line hypview/readers.qtpl:161
|
//line hypview/readers.qtpl:94
|
||||||
qt422016.ReleaseByteBuffer(qb422016)
|
qt422016.ReleaseByteBuffer(qb422016)
|
||||||
//line hypview/readers.qtpl:161
|
//line hypview/readers.qtpl:94
|
||||||
return qs422016
|
return qs422016
|
||||||
//line hypview/readers.qtpl:161
|
//line hypview/readers.qtpl:94
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,18 +4,19 @@ import (
|
|||||||
"bytes"
|
"bytes"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/bouncepaw/mycorrhiza/backlinks"
|
|
||||||
"github.com/bouncepaw/mycorrhiza/files"
|
|
||||||
"github.com/bouncepaw/mycorrhiza/history"
|
|
||||||
"github.com/bouncepaw/mycorrhiza/hyphae"
|
|
||||||
"github.com/bouncepaw/mycorrhiza/mimetype"
|
|
||||||
"github.com/bouncepaw/mycorrhiza/user"
|
|
||||||
"io"
|
"io"
|
||||||
"log"
|
"log"
|
||||||
"mime/multipart"
|
"mime/multipart"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"github.com/bouncepaw/mycorrhiza/history"
|
||||||
|
"github.com/bouncepaw/mycorrhiza/internal/backlinks"
|
||||||
|
"github.com/bouncepaw/mycorrhiza/internal/files"
|
||||||
|
"github.com/bouncepaw/mycorrhiza/internal/hyphae"
|
||||||
|
"github.com/bouncepaw/mycorrhiza/internal/mimetype"
|
||||||
|
"github.com/bouncepaw/mycorrhiza/internal/user"
|
||||||
)
|
)
|
||||||
|
|
||||||
func historyMessageForTextUpload(h hyphae.Hypha, userMessage string) string {
|
func historyMessageForTextUpload(h hyphae.Hypha, userMessage string) string {
|
||||||
|
|||||||
@ -117,7 +117,7 @@ func findOrCreateSubchild(name string, baseChild *child) *child {
|
|||||||
return &baseChild.children[len(baseChild.children)-1]
|
return &baseChild.children[len(baseChild.children)-1]
|
||||||
}
|
}
|
||||||
|
|
||||||
func subhyphaeMatrix(children []child) (html string) {
|
func subhyphaeMatrix(children []child) template.HTML {
|
||||||
sort.Slice(children, func(i, j int) bool {
|
sort.Slice(children, func(i, j int) bool {
|
||||||
return children[i].name < children[j].name
|
return children[i].name < children[j].name
|
||||||
})
|
})
|
||||||
@ -125,5 +125,5 @@ func subhyphaeMatrix(children []child) (html string) {
|
|||||||
for _, child := range children {
|
for _, child := range children {
|
||||||
childHTML(&child, &buf)
|
childHTML(&child, &buf)
|
||||||
}
|
}
|
||||||
return buf.String()
|
return template.HTML(buf.String())
|
||||||
}
|
}
|
||||||
|
|||||||
@ -20,7 +20,7 @@ type Page struct {
|
|||||||
TemplateRussian *template.Template
|
TemplateRussian *template.Template
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewPage(fs embed.FS, tmpl string, russianTranslation map[string]string) *Page {
|
func NewPage(fs embed.FS, russianTranslation map[string]string, tmpls ...string) *Page {
|
||||||
must := template.Must
|
must := template.Must
|
||||||
en := must(must(must(
|
en := must(must(must(
|
||||||
base.Clone()).
|
base.Clone()).
|
||||||
@ -32,7 +32,7 @@ func NewPage(fs embed.FS, tmpl string, russianTranslation map[string]string) *Pa
|
|||||||
{{define "wiki name"}}%s{{end}}
|
{{define "wiki name"}}%s{{end}}
|
||||||
{{define "user hypha"}}%s{{end}}
|
{{define "user hypha"}}%s{{end}}
|
||||||
`, cfg.WikiName, cfg.UserHypha))).
|
`, cfg.WikiName, cfg.UserHypha))).
|
||||||
ParseFS(fs, tmpl))
|
ParseFS(fs, tmpls...))
|
||||||
|
|
||||||
if cfg.UseAuth {
|
if cfg.UseAuth {
|
||||||
en = must(en.Parse(`
|
en = must(en.Parse(`
|
||||||
|
|||||||
87
web/pages.go
87
web/pages.go
@ -21,23 +21,43 @@ func initPages() {
|
|||||||
editUserChain = viewutil.CopyEnRuWith(fs, "views/admin-edit-user.html", adminTranslationRu)
|
editUserChain = viewutil.CopyEnRuWith(fs, "views/admin-edit-user.html", adminTranslationRu)
|
||||||
deleteUserChain = viewutil.CopyEnRuWith(fs, "views/admin-delete-user.html", adminTranslationRu)
|
deleteUserChain = viewutil.CopyEnRuWith(fs, "views/admin-delete-user.html", adminTranslationRu)
|
||||||
|
|
||||||
pageOrphans = newtmpl.NewPage(fs, "views/orphans.html", map[string]string{
|
pageOrphans = newtmpl.NewPage(fs, map[string]string{
|
||||||
|
"orphaned hyphae": "Гифы-сироты",
|
||||||
|
"orphan description": "Ниже перечислены гифы без ссылок на них.",
|
||||||
|
}, "views/orphans.html", map[string]string{
|
||||||
"orphaned hyphae": "Гифы-сироты",
|
"orphaned hyphae": "Гифы-сироты",
|
||||||
"orphan description": "Ниже перечислены гифы без ссылок на них.",
|
"orphan description": "Ниже перечислены гифы без ссылок на них.",
|
||||||
})
|
})
|
||||||
pageBacklinks = newtmpl.NewPage(fs, "views/backlinks.html", map[string]string{
|
pageBacklinks = newtmpl.NewPage(fs, map[string]string{
|
||||||
|
"backlinks to text": `Обратные ссылки на {{.}}`,
|
||||||
|
"backlinks to link": `Обратные ссылки на <a href="/hypha/{{.}}">{{beautifulName .}}</a>`,
|
||||||
|
"description": `Ниже перечислены гифы, на которых есть ссылка на эту гифу, трансклюзия этой гифы или эта гифа вставлена как изображение.`,
|
||||||
|
}, "views/backlinks.html", map[string]string{
|
||||||
"backlinks to text": `Обратные ссылки на {{.}}`,
|
"backlinks to text": `Обратные ссылки на {{.}}`,
|
||||||
"backlinks to link": `Обратные ссылки на <a href="/hypha/{{.}}">{{beautifulName .}}</a>`,
|
"backlinks to link": `Обратные ссылки на <a href="/hypha/{{.}}">{{beautifulName .}}</a>`,
|
||||||
"description": `Ниже перечислены гифы, на которых есть ссылка на эту гифу, трансклюзия этой гифы или эта гифа вставлена как изображение.`,
|
"description": `Ниже перечислены гифы, на которых есть ссылка на эту гифу, трансклюзия этой гифы или эта гифа вставлена как изображение.`,
|
||||||
})
|
})
|
||||||
pageUserList = newtmpl.NewPage(fs, "views/user-list.html", map[string]string{
|
pageUserList = newtmpl.NewPage(fs, map[string]string{
|
||||||
|
"title": "Список пользователей",
|
||||||
|
"administrators": "Администраторы",
|
||||||
|
"moderators": "Модераторы",
|
||||||
|
"editors": "Редакторы",
|
||||||
|
"readers": "Читатели",
|
||||||
|
}, "views/user-list.html", map[string]string{
|
||||||
"title": "Список пользователей",
|
"title": "Список пользователей",
|
||||||
"administrators": "Администраторы",
|
"administrators": "Администраторы",
|
||||||
"moderators": "Модераторы",
|
"moderators": "Модераторы",
|
||||||
"editors": "Редакторы",
|
"editors": "Редакторы",
|
||||||
"readers": "Читатели",
|
"readers": "Читатели",
|
||||||
})
|
})
|
||||||
pageChangePassword = newtmpl.NewPage(fs, "views/change-password.html", map[string]string{
|
pageChangePassword = newtmpl.NewPage(fs, map[string]string{
|
||||||
|
"change password": "Сменить пароль",
|
||||||
|
"confirm password": "Повторите пароль",
|
||||||
|
"current password": "Текущий пароль",
|
||||||
|
"non local password change": "Пароль можно поменять только местным аккаунтам. Telegram-аккаунтам нельзя.",
|
||||||
|
"password": "Пароль",
|
||||||
|
"submit": "Поменять",
|
||||||
|
}, "views/change-password.html", map[string]string{
|
||||||
"change password": "Сменить пароль",
|
"change password": "Сменить пароль",
|
||||||
"confirm password": "Повторите пароль",
|
"confirm password": "Повторите пароль",
|
||||||
"current password": "Текущий пароль",
|
"current password": "Текущий пароль",
|
||||||
@ -45,13 +65,52 @@ func initPages() {
|
|||||||
"password": "Пароль",
|
"password": "Пароль",
|
||||||
"submit": "Поменять",
|
"submit": "Поменять",
|
||||||
})
|
})
|
||||||
pageHyphaDelete = newtmpl.NewPage(fs, "views/hypha-delete.html", map[string]string{
|
pageHyphaDelete = newtmpl.NewPage(fs, map[string]string{
|
||||||
|
"delete hypha?": "Удалить {{beautifulName .}}?",
|
||||||
|
"delete [[hypha]]?": "Удалить <a href=\"/hypha/{{.}}\">{{beautifulName .}}</a>?",
|
||||||
|
"want to delete?": "Вы действительно хотите удалить эту гифу?",
|
||||||
|
"delete tip": "Нельзя отменить удаление гифы, но её история останется доступной.",
|
||||||
|
}, "views/hypha-delete.html", map[string]string{
|
||||||
"delete hypha?": "Удалить {{beautifulName .}}?",
|
"delete hypha?": "Удалить {{beautifulName .}}?",
|
||||||
"delete [[hypha]]?": "Удалить <a href=\"/hypha/{{.}}\">{{beautifulName .}}</a>?",
|
"delete [[hypha]]?": "Удалить <a href=\"/hypha/{{.}}\">{{beautifulName .}}</a>?",
|
||||||
"want to delete?": "Вы действительно хотите удалить эту гифу?",
|
"want to delete?": "Вы действительно хотите удалить эту гифу?",
|
||||||
"delete tip": "Нельзя отменить удаление гифы, но её история останется доступной.",
|
"delete tip": "Нельзя отменить удаление гифы, но её история останется доступной.",
|
||||||
})
|
})
|
||||||
pageHyphaEdit = newtmpl.NewPage(fs, "views/hypha-edit.html", map[string]string{
|
pageHyphaEdit = newtmpl.NewPage(fs, map[string]string{
|
||||||
|
"editing hypha": `Редактирование {{beautifulName .}}`,
|
||||||
|
"editing [[hypha]]": `Редактирование <a href="/hypha/{{.}}">{{beautifulName .}}</a>`,
|
||||||
|
"creating [[hypha]]": `Создание <a href="/hypha/{{.}}">{{beautifulName .}}</a>`,
|
||||||
|
"you're creating a new hypha": `Вы создаёте новую гифу.`,
|
||||||
|
"describe your changes": `Опишите ваши правки`,
|
||||||
|
"save": `Сохранить`,
|
||||||
|
"preview": `Предпросмотр`,
|
||||||
|
"previewing hypha": `Предпросмотр «{{beautifulName .}}»`,
|
||||||
|
"preview tip": `Заметьте, эта гифа ещё не сохранена. Вот её предпросмотр:`,
|
||||||
|
|
||||||
|
"markup": `Разметка`,
|
||||||
|
"link": `Ссылка`,
|
||||||
|
"link title": `Текст`,
|
||||||
|
"heading": `Заголовок`,
|
||||||
|
"bold": `Жирный`,
|
||||||
|
"italic": `Курсив`,
|
||||||
|
"highlight": `Выделение`,
|
||||||
|
"underline": `Подчеркивание`,
|
||||||
|
"mono": `Моноширинный`,
|
||||||
|
"super": `Надстрочный`,
|
||||||
|
"sub": `Подстрочный`,
|
||||||
|
"strike": `Зачёркнутый`,
|
||||||
|
"rocket": `Ссылка-ракета`,
|
||||||
|
"transclude": `Трансклюзия`,
|
||||||
|
"hr": `Гориз. черта`,
|
||||||
|
"code": `Код-блок`,
|
||||||
|
"bullets": `Маркир. список`,
|
||||||
|
"numbers": `Нумер. список`,
|
||||||
|
"mycomarkup help": `<a href="/help/en/mycomarkup" class="shy-link">Подробнее</a> о Микоразметке`,
|
||||||
|
"actions": `Действия`,
|
||||||
|
"current date": `Текущая дата`,
|
||||||
|
"current time": `Текущее время`,
|
||||||
|
"selflink": `Ссылка на вас`,
|
||||||
|
}, "views/hypha-edit.html", map[string]string{
|
||||||
"editing hypha": `Редактирование {{beautifulName .}}`,
|
"editing hypha": `Редактирование {{beautifulName .}}`,
|
||||||
"editing [[hypha]]": `Редактирование <a href="/hypha/{{.}}">{{beautifulName .}}</a>`,
|
"editing [[hypha]]": `Редактирование <a href="/hypha/{{.}}">{{beautifulName .}}</a>`,
|
||||||
"creating [[hypha]]": `Создание <a href="/hypha/{{.}}">{{beautifulName .}}</a>`,
|
"creating [[hypha]]": `Создание <a href="/hypha/{{.}}">{{beautifulName .}}</a>`,
|
||||||
@ -86,7 +145,19 @@ func initPages() {
|
|||||||
"current time": `Текущее время`,
|
"current time": `Текущее время`,
|
||||||
"selflink": `Ссылка на вас`,
|
"selflink": `Ссылка на вас`,
|
||||||
})
|
})
|
||||||
pageHyphaEmpty = newtmpl.NewPage(fs, "views/hypha-empty.html", map[string]string{
|
pageHyphaEmpty = newtmpl.NewPage(fs, map[string]string{
|
||||||
|
"empty heading": `Эта гифа не существует`,
|
||||||
|
"empty no rights": `У вас нет прав для создания новых гиф. Вы можете:`,
|
||||||
|
"empty log in": `Войти в свою учётную запись, если она у вас есть`,
|
||||||
|
"empty register": `Создать новую учётную запись`,
|
||||||
|
"write a text": `Написать текст`,
|
||||||
|
"write a text tip": `Напишите заметку, дневник, статью, рассказ или иной текст с помощью <a href="/help/en/mycomarkup" class="shy-link">Микоразметки</a>. Сохраняется полная история правок документа.`,
|
||||||
|
"write a text writing conventions": `Не забывайте следовать правилам оформления этой вики, если они имеются.`,
|
||||||
|
"write a text btn": `Создать`,
|
||||||
|
"upload a media": `Загрузить медиа`,
|
||||||
|
"upload a media tip": `Загрузите изображение, видео или аудио. Распространённые форматы можно просматривать из браузера, остальные можно только скачать и просмотреть локально. Позже вы можете дописать пояснение к этому медиа.`,
|
||||||
|
"upload a media btn": `Загрузить`,
|
||||||
|
}, "views/hypha-empty.html", map[string]string{
|
||||||
"empty heading": `Эта гифа не существует`,
|
"empty heading": `Эта гифа не существует`,
|
||||||
"empty no rights": `У вас нет прав для создания новых гиф. Вы можете:`,
|
"empty no rights": `У вас нет прав для создания новых гиф. Вы можете:`,
|
||||||
"empty log in": `Войти в свою учётную запись, если она у вас есть`,
|
"empty log in": `Войти в свою учётную запись, если она у вас есть`,
|
||||||
@ -99,5 +170,5 @@ func initPages() {
|
|||||||
"upload a media tip": `Загрузите изображение, видео или аудио. Распространённые форматы можно просматривать из браузера, остальные можно только скачать и просмотреть локально. Позже вы можете дописать пояснение к этому медиа.`,
|
"upload a media tip": `Загрузите изображение, видео или аудио. Распространённые форматы можно просматривать из браузера, остальные можно только скачать и просмотреть локально. Позже вы можете дописать пояснение к этому медиа.`,
|
||||||
"upload a media btn": `Загрузить`,
|
"upload a media btn": `Загрузить`,
|
||||||
})
|
})
|
||||||
pageHypha = newtmpl.NewPage(fs, "views/hypha.html", map[string]string{})
|
pageHypha = newtmpl.NewPage(fs, map[string]string{}, "views/hypha.html", map[string]string{})
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user