1
0
mirror of https://github.com/osmarks/mycorrhiza.git synced 2025-12-12 03:18:08 +00:00

Let wiki admins specify custom script URLs in the config file

See devconfig.ini for an example.
This commit is contained in:
Timur Ismagilov
2021-05-22 23:05:14 +05:00
parent 24380f3775
commit 06ac565e76
8 changed files with 652 additions and 420 deletions

View File

@@ -17,3 +17,8 @@ FixedAuthCredentialsPath = mycocredentials.json
UseRegistration = true UseRegistration = true
RegistrationCredentialsPath = mycoregistration.json RegistrationCredentialsPath = mycoregistration.json
LimitRegistration = 3 LimitRegistration = 3
[CustomScripts]
OmnipresentScripts = https://lesarbr.es/do-the-roll.js
ViewScripts = https://cdnjs.cloudflare.com/ajax/libs/prism/1.23.0/components/prism-core.min.js,https://cdnjs.cloudflare.com/ajax/libs/prism/1.23.0/plugins/autoloader/prism-autoloader.min.js
EditScripts = https://example.org

View File

@@ -29,6 +29,10 @@ var (
UseRegistration bool UseRegistration bool
RegistrationCredentialsPath string RegistrationCredentialsPath string
LimitRegistration int LimitRegistration int
OmnipresentScripts []string
ViewScripts []string
EditScripts []string
) )
// These variables are set before reading the config file, they are set in main.parseCliArgs. // These variables are set before reading the config file, they are set in main.parseCliArgs.
@@ -46,6 +50,7 @@ type Config struct {
Hyphae Hyphae
Network Network
Authorization Authorization
CustomScripts
} }
// Hyphae is a section of Config which has fields related to special hyphae. // Hyphae is a section of Config which has fields related to special hyphae.
@@ -62,6 +67,16 @@ type Network struct {
GeminiCertificatePath string GeminiCertificatePath string
} }
// CustomScripts is a section with paths to JavaScript files that are loaded on specified pages.
type CustomScripts struct {
// OmnipresentScripts: everywhere...
OmnipresentScripts []string `delim:","`
// ViewScripts: /hypha, /rev
ViewScripts []string `delim:","`
// Edit: /edit
EditScripts []string `delim:","`
}
// Authorization is a section of Config that has fields related to authorization and authentication. // Authorization is a section of Config that has fields related to authorization and authentication.
type Authorization struct { type Authorization struct {
UseFixedAuth bool UseFixedAuth bool
@@ -97,6 +112,11 @@ func ReadConfigFile() {
RegistrationCredentialsPath: "", RegistrationCredentialsPath: "",
LimitRegistration: 0, LimitRegistration: 0,
}, },
CustomScripts: CustomScripts{
OmnipresentScripts: []string{},
ViewScripts: []string{},
EditScripts: []string{},
},
} }
if ConfigFilePath != "" { if ConfigFilePath != "" {
@@ -126,6 +146,9 @@ func ReadConfigFile() {
UseRegistration = cfg.UseRegistration UseRegistration = cfg.UseRegistration
RegistrationCredentialsPath = cfg.RegistrationCredentialsPath RegistrationCredentialsPath = cfg.RegistrationCredentialsPath
LimitRegistration = int(cfg.LimitRegistration) LimitRegistration = int(cfg.LimitRegistration)
OmnipresentScripts = cfg.OmnipresentScripts
ViewScripts = cfg.ViewScripts
EditScripts = cfg.EditScripts
// This URL makes much more sense. // This URL makes much more sense.
if URL == "" { if URL == "" {

View File

@@ -1,4 +1,6 @@
{% import "net/http" %} {% import "net/http" %}
{% import "github.com/bouncepaw/mycorrhiza/cfg" %}
{% import "github.com/bouncepaw/mycorrhiza/util" %} {% import "github.com/bouncepaw/mycorrhiza/util" %}
{% import "github.com/bouncepaw/mycorrhiza/user" %} {% import "github.com/bouncepaw/mycorrhiza/user" %}
@@ -83,6 +85,7 @@
</main> </main>
{%s= Toolbar(user.FromRequest(rq)) %} {%s= Toolbar(user.FromRequest(rq)) %}
</div> </div>
{%= editScripts() %}
{% endfunc %} {% endfunc %}
{% func PreviewHTML(rq *http.Request, hyphaName, textAreaFill, warning string, renderedPage string) %} {% func PreviewHTML(rq *http.Request, hyphaName, textAreaFill, warning string, renderedPage string) %}
@@ -104,4 +107,11 @@
</main> </main>
{%s= Toolbar(user.FromRequest(rq)) %} {%s= Toolbar(user.FromRequest(rq)) %}
</div> </div>
{%= editScripts() %}
{% endfunc %}
{% func editScripts() %}
{% for _, scriptPath := range cfg.EditScripts %}
<script src="{%s scriptPath %}"></script>
{% endfor %}
{% endfunc %} {% endfunc %}

View File

@@ -7,34 +7,37 @@ package views
//line views/mutators.qtpl:1 //line views/mutators.qtpl:1
import "net/http" import "net/http"
//line views/mutators.qtpl:2 //line views/mutators.qtpl:3
import "github.com/bouncepaw/mycorrhiza/cfg"
//line views/mutators.qtpl:4
import "github.com/bouncepaw/mycorrhiza/util" import "github.com/bouncepaw/mycorrhiza/util"
//line views/mutators.qtpl:3 //line views/mutators.qtpl:5
import "github.com/bouncepaw/mycorrhiza/user" import "github.com/bouncepaw/mycorrhiza/user"
//line views/mutators.qtpl:5 //line views/mutators.qtpl:7
import ( import (
qtio422016 "io" qtio422016 "io"
qt422016 "github.com/valyala/quicktemplate" qt422016 "github.com/valyala/quicktemplate"
) )
//line views/mutators.qtpl:5 //line views/mutators.qtpl:7
var ( var (
_ = qtio422016.Copy _ = qtio422016.Copy
_ = qt422016.AcquireByteBuffer _ = qt422016.AcquireByteBuffer
) )
//line views/mutators.qtpl:5 //line views/mutators.qtpl:7
func StreamToolbar(qw422016 *qt422016.Writer, u *user.User) { func StreamToolbar(qw422016 *qt422016.Writer, u *user.User) {
//line views/mutators.qtpl:5 //line views/mutators.qtpl:7
qw422016.N().S(` qw422016.N().S(`
<aside class="edit-toolbar layout-card"> <aside class="edit-toolbar layout-card">
<h2 class="edit-toolbar__title layout-card__title">Markup</h2> <h2 class="edit-toolbar__title layout-card__title">Markup</h2>
<section class="edit-toolbar__buttons"> <section class="edit-toolbar__buttons">
`) `)
//line views/mutators.qtpl:9 //line views/mutators.qtpl:11
for _, el := range []struct { for _, el := range []struct {
class string class string
onclick string onclick string
@@ -59,36 +62,36 @@ func StreamToolbar(qw422016 *qt422016.Writer, u *user.User) {
{"bulletedlist", "insertBulletedList()", "* bullet list"}, {"bulletedlist", "insertBulletedList()", "* bullet list"},
{"numberedlist", "insertNumberedList()", "*. number list"}, {"numberedlist", "insertNumberedList()", "*. number list"},
} { } {
//line views/mutators.qtpl:32 //line views/mutators.qtpl:34
qw422016.N().S(` qw422016.N().S(`
<button <button
class="edit-toolbar__btn edit-toolbar__`) class="edit-toolbar__btn edit-toolbar__`)
//line views/mutators.qtpl:34 //line views/mutators.qtpl:36
qw422016.E().S(el.class) qw422016.E().S(el.class)
//line views/mutators.qtpl:34 //line views/mutators.qtpl:36
qw422016.N().S(`" qw422016.N().S(`"
onclick="`) onclick="`)
//line views/mutators.qtpl:35 //line views/mutators.qtpl:37
qw422016.E().S(el.onclick) qw422016.E().S(el.onclick)
//line views/mutators.qtpl:35 //line views/mutators.qtpl:37
qw422016.N().S(`"> qw422016.N().S(`">
`) `)
//line views/mutators.qtpl:36 //line views/mutators.qtpl:38
qw422016.N().S(el.display) qw422016.N().S(el.display)
//line views/mutators.qtpl:36 //line views/mutators.qtpl:38
qw422016.N().S(` qw422016.N().S(`
</button> </button>
`) `)
//line views/mutators.qtpl:38 //line views/mutators.qtpl:40
} }
//line views/mutators.qtpl:38 //line views/mutators.qtpl:40
qw422016.N().S(` qw422016.N().S(`
</section> </section>
<p class="edit-toolbar__ad"><a href="https://mycorrhiza.lesarbr.es/hypha/mycomarkup" target="_blank">Learn more</a> about mycomarkup</p> <p class="edit-toolbar__ad"><a href="https://mycorrhiza.lesarbr.es/hypha/mycomarkup" target="_blank">Learn more</a> about mycomarkup</p>
<h2 class="edit-toolbar__title layout-card__title">Actions</h2> <h2 class="edit-toolbar__title layout-card__title">Actions</h2>
<section class="edit-toolbar__buttons"> <section class="edit-toolbar__buttons">
`) `)
//line views/mutators.qtpl:43 //line views/mutators.qtpl:45
for _, el := range []struct { for _, el := range []struct {
class string class string
onclick string onclick string
@@ -97,34 +100,34 @@ func StreamToolbar(qw422016 *qt422016.Writer, u *user.User) {
{"date", "insertDate()", "Insert current date"}, {"date", "insertDate()", "Insert current date"},
{"time", "insertTimeUTC()", "Insert current time"}, {"time", "insertTimeUTC()", "Insert current time"},
} { } {
//line views/mutators.qtpl:50 //line views/mutators.qtpl:52
qw422016.N().S(` qw422016.N().S(`
<button <button
class="edit-toolbar__btn edit-toolbar__`) class="edit-toolbar__btn edit-toolbar__`)
//line views/mutators.qtpl:52 //line views/mutators.qtpl:54
qw422016.E().S(el.class) qw422016.E().S(el.class)
//line views/mutators.qtpl:52 //line views/mutators.qtpl:54
qw422016.N().S(`" qw422016.N().S(`"
onclick="`) onclick="`)
//line views/mutators.qtpl:53 //line views/mutators.qtpl:55
qw422016.E().S(el.onclick) qw422016.E().S(el.onclick)
//line views/mutators.qtpl:53 //line views/mutators.qtpl:55
qw422016.N().S(`"> qw422016.N().S(`">
`) `)
//line views/mutators.qtpl:54 //line views/mutators.qtpl:56
qw422016.N().S(el.display) qw422016.N().S(el.display)
//line views/mutators.qtpl:54 //line views/mutators.qtpl:56
qw422016.N().S(` qw422016.N().S(`
</button> </button>
`) `)
//line views/mutators.qtpl:56 //line views/mutators.qtpl:58
} }
//line views/mutators.qtpl:56 //line views/mutators.qtpl:58
qw422016.N().S(` qw422016.N().S(`
`) `)
//line views/mutators.qtpl:57 //line views/mutators.qtpl:59
if u.Group != "anon" { if u.Group != "anon" {
//line views/mutators.qtpl:57 //line views/mutators.qtpl:59
qw422016.N().S(` qw422016.N().S(`
<button <button
class="edit-toolbar__btn edit-toolbar__user-link" class="edit-toolbar__btn edit-toolbar__user-link"
@@ -132,201 +135,260 @@ func StreamToolbar(qw422016 *qt422016.Writer, u *user.User) {
Link yourself Link yourself
</button> </button>
`) `)
//line views/mutators.qtpl:63 //line views/mutators.qtpl:65
} }
//line views/mutators.qtpl:63 //line views/mutators.qtpl:65
qw422016.N().S(` qw422016.N().S(`
</section> </section>
</aside> </aside>
<script src="/static/toolbar.js"></script> <script src="/static/toolbar.js"></script>
`) `)
//line views/mutators.qtpl:67 //line views/mutators.qtpl:69
} }
//line views/mutators.qtpl:67 //line views/mutators.qtpl:69
func WriteToolbar(qq422016 qtio422016.Writer, u *user.User) { func WriteToolbar(qq422016 qtio422016.Writer, u *user.User) {
//line views/mutators.qtpl:67 //line views/mutators.qtpl:69
qw422016 := qt422016.AcquireWriter(qq422016) qw422016 := qt422016.AcquireWriter(qq422016)
//line views/mutators.qtpl:67 //line views/mutators.qtpl:69
StreamToolbar(qw422016, u) StreamToolbar(qw422016, u)
//line views/mutators.qtpl:67 //line views/mutators.qtpl:69
qt422016.ReleaseWriter(qw422016) qt422016.ReleaseWriter(qw422016)
//line views/mutators.qtpl:67 //line views/mutators.qtpl:69
} }
//line views/mutators.qtpl:67 //line views/mutators.qtpl:69
func Toolbar(u *user.User) string { func Toolbar(u *user.User) string {
//line views/mutators.qtpl:67 //line views/mutators.qtpl:69
qb422016 := qt422016.AcquireByteBuffer() qb422016 := qt422016.AcquireByteBuffer()
//line views/mutators.qtpl:67 //line views/mutators.qtpl:69
WriteToolbar(qb422016, u) WriteToolbar(qb422016, u)
//line views/mutators.qtpl:67 //line views/mutators.qtpl:69
qs422016 := string(qb422016.B) qs422016 := string(qb422016.B)
//line views/mutators.qtpl:67 //line views/mutators.qtpl:69
qt422016.ReleaseByteBuffer(qb422016) qt422016.ReleaseByteBuffer(qb422016)
//line views/mutators.qtpl:67 //line views/mutators.qtpl:69
return qs422016 return qs422016
//line views/mutators.qtpl:67 //line views/mutators.qtpl:69
} }
//line views/mutators.qtpl:69 //line views/mutators.qtpl:71
func StreamEditHTML(qw422016 *qt422016.Writer, rq *http.Request, hyphaName, textAreaFill, warning string) { func StreamEditHTML(qw422016 *qt422016.Writer, rq *http.Request, hyphaName, textAreaFill, warning string) {
//line views/mutators.qtpl:69 //line views/mutators.qtpl:71
qw422016.N().S(` qw422016.N().S(`
`) `)
//line views/mutators.qtpl:70 //line views/mutators.qtpl:72
qw422016.N().S(NavHTML(rq, hyphaName, "edit")) qw422016.N().S(NavHTML(rq, hyphaName, "edit"))
//line views/mutators.qtpl:70 //line views/mutators.qtpl:72
qw422016.N().S(` qw422016.N().S(`
<div class="layout"> <div class="layout">
<main class="main-width edit edit_no-preview"> <main class="main-width edit edit_no-preview">
<h1 class="edit__title">Edit `) <h1 class="edit__title">Edit `)
//line views/mutators.qtpl:73 //line views/mutators.qtpl:75
qw422016.E().S(util.BeautifulName(hyphaName)) qw422016.E().S(util.BeautifulName(hyphaName))
//line views/mutators.qtpl:73 //line views/mutators.qtpl:75
qw422016.N().S(`</h1> qw422016.N().S(`</h1>
`) `)
//line views/mutators.qtpl:74 //line views/mutators.qtpl:76
qw422016.N().S(warning) qw422016.N().S(warning)
//line views/mutators.qtpl:74 //line views/mutators.qtpl:76
qw422016.N().S(` qw422016.N().S(`
<form method="post" class="edit-form" <form method="post" class="edit-form"
action="/upload-text/`) action="/upload-text/`)
//line views/mutators.qtpl:76 //line views/mutators.qtpl:78
qw422016.E().S(hyphaName) qw422016.E().S(hyphaName)
//line views/mutators.qtpl:76 //line views/mutators.qtpl:78
qw422016.N().S(`"> qw422016.N().S(`">
<textarea name="text" class="edit-form__textarea">`) <textarea name="text" class="edit-form__textarea">`)
//line views/mutators.qtpl:77 //line views/mutators.qtpl:79
qw422016.E().S(textAreaFill) qw422016.E().S(textAreaFill)
//line views/mutators.qtpl:77 //line views/mutators.qtpl:79
qw422016.N().S(`</textarea> qw422016.N().S(`</textarea>
<br/> <br/>
<input type="submit" name="action" value="Save" class="edit-form__save"/> <input type="submit" name="action" value="Save" class="edit-form__save"/>
<input type="submit" name="action" value="Preview" class="edit-form__preview"> <input type="submit" name="action" value="Preview" class="edit-form__preview">
<a href="/page/`) <a href="/page/`)
//line views/mutators.qtpl:81 //line views/mutators.qtpl:83
qw422016.E().S(hyphaName) qw422016.E().S(hyphaName)
//line views/mutators.qtpl:81 //line views/mutators.qtpl:83
qw422016.N().S(`" class="edit-form__cancel">Cancel</a> qw422016.N().S(`" class="edit-form__cancel">Cancel</a>
</form> </form>
</main> </main>
`) `)
//line views/mutators.qtpl:84 //line views/mutators.qtpl:86
qw422016.N().S(Toolbar(user.FromRequest(rq))) qw422016.N().S(Toolbar(user.FromRequest(rq)))
//line views/mutators.qtpl:84 //line views/mutators.qtpl:86
qw422016.N().S(` qw422016.N().S(`
</div> </div>
`) `)
//line views/mutators.qtpl:86
}
//line views/mutators.qtpl:86
func WriteEditHTML(qq422016 qtio422016.Writer, rq *http.Request, hyphaName, textAreaFill, warning string) {
//line views/mutators.qtpl:86
qw422016 := qt422016.AcquireWriter(qq422016)
//line views/mutators.qtpl:86
StreamEditHTML(qw422016, rq, hyphaName, textAreaFill, warning)
//line views/mutators.qtpl:86
qt422016.ReleaseWriter(qw422016)
//line views/mutators.qtpl:86
}
//line views/mutators.qtpl:86
func EditHTML(rq *http.Request, hyphaName, textAreaFill, warning string) string {
//line views/mutators.qtpl:86
qb422016 := qt422016.AcquireByteBuffer()
//line views/mutators.qtpl:86
WriteEditHTML(qb422016, rq, hyphaName, textAreaFill, warning)
//line views/mutators.qtpl:86
qs422016 := string(qb422016.B)
//line views/mutators.qtpl:86
qt422016.ReleaseByteBuffer(qb422016)
//line views/mutators.qtpl:86
return qs422016
//line views/mutators.qtpl:86
}
//line views/mutators.qtpl:88 //line views/mutators.qtpl:88
func StreamPreviewHTML(qw422016 *qt422016.Writer, rq *http.Request, hyphaName, textAreaFill, warning string, renderedPage string) { streameditScripts(qw422016)
//line views/mutators.qtpl:88 //line views/mutators.qtpl:88
qw422016.N().S(` qw422016.N().S(`
`) `)
//line views/mutators.qtpl:89 //line views/mutators.qtpl:89
qw422016.N().S(NavHTML(rq, hyphaName, "edit")) }
//line views/mutators.qtpl:89 //line views/mutators.qtpl:89
func WriteEditHTML(qq422016 qtio422016.Writer, rq *http.Request, hyphaName, textAreaFill, warning string) {
//line views/mutators.qtpl:89
qw422016 := qt422016.AcquireWriter(qq422016)
//line views/mutators.qtpl:89
StreamEditHTML(qw422016, rq, hyphaName, textAreaFill, warning)
//line views/mutators.qtpl:89
qt422016.ReleaseWriter(qw422016)
//line views/mutators.qtpl:89
}
//line views/mutators.qtpl:89
func EditHTML(rq *http.Request, hyphaName, textAreaFill, warning string) string {
//line views/mutators.qtpl:89
qb422016 := qt422016.AcquireByteBuffer()
//line views/mutators.qtpl:89
WriteEditHTML(qb422016, rq, hyphaName, textAreaFill, warning)
//line views/mutators.qtpl:89
qs422016 := string(qb422016.B)
//line views/mutators.qtpl:89
qt422016.ReleaseByteBuffer(qb422016)
//line views/mutators.qtpl:89
return qs422016
//line views/mutators.qtpl:89
}
//line views/mutators.qtpl:91
func StreamPreviewHTML(qw422016 *qt422016.Writer, rq *http.Request, hyphaName, textAreaFill, warning string, renderedPage string) {
//line views/mutators.qtpl:91
qw422016.N().S(`
`)
//line views/mutators.qtpl:92
qw422016.N().S(NavHTML(rq, hyphaName, "edit"))
//line views/mutators.qtpl:92
qw422016.N().S(` qw422016.N().S(`
<div class="layout"> <div class="layout">
<main class="main-width edit edit_with-preview"> <main class="main-width edit edit_with-preview">
<h1>Edit `) <h1>Edit `)
//line views/mutators.qtpl:92 //line views/mutators.qtpl:95
qw422016.E().S(util.BeautifulName(hyphaName)) qw422016.E().S(util.BeautifulName(hyphaName))
//line views/mutators.qtpl:92 //line views/mutators.qtpl:95
qw422016.N().S(` (preview)</h1> qw422016.N().S(` (preview)</h1>
`) `)
//line views/mutators.qtpl:93 //line views/mutators.qtpl:96
qw422016.N().S(warning) qw422016.N().S(warning)
//line views/mutators.qtpl:93 //line views/mutators.qtpl:96
qw422016.N().S(` qw422016.N().S(`
<form method="post" class="edit-form" <form method="post" class="edit-form"
action="/upload-text/`) action="/upload-text/`)
//line views/mutators.qtpl:95 //line views/mutators.qtpl:98
qw422016.E().S(hyphaName) qw422016.E().S(hyphaName)
//line views/mutators.qtpl:95 //line views/mutators.qtpl:98
qw422016.N().S(`"> qw422016.N().S(`">
<textarea class="edit-form__textarea" name="text">`) <textarea class="edit-form__textarea" name="text">`)
//line views/mutators.qtpl:96 //line views/mutators.qtpl:99
qw422016.E().S(textAreaFill) qw422016.E().S(textAreaFill)
//line views/mutators.qtpl:96 //line views/mutators.qtpl:99
qw422016.N().S(`</textarea> qw422016.N().S(`</textarea>
<br/> <br/>
<input type="submit" name="action" value="Save" class="edit-form__save"/> <input type="submit" name="action" value="Save" class="edit-form__save"/>
<input type="submit" name="action" value="Preview" class="edit-form__preview"> <input type="submit" name="action" value="Preview" class="edit-form__preview">
<a href="/page/`) <a href="/page/`)
//line views/mutators.qtpl:100 //line views/mutators.qtpl:103
qw422016.E().S(hyphaName) qw422016.E().S(hyphaName)
//line views/mutators.qtpl:100 //line views/mutators.qtpl:103
qw422016.N().S(`" class="edit-form__cancel">Cancel</a> qw422016.N().S(`" class="edit-form__cancel">Cancel</a>
</form> </form>
<p class="warning">Note that the hypha is not saved yet. You can preview the changes ↓</p> <p class="warning">Note that the hypha is not saved yet. You can preview the changes ↓</p>
<article class="edit__preview">`) <article class="edit__preview">`)
//line views/mutators.qtpl:103 //line views/mutators.qtpl:106
qw422016.N().S(renderedPage) qw422016.N().S(renderedPage)
//line views/mutators.qtpl:103 //line views/mutators.qtpl:106
qw422016.N().S(`</article> qw422016.N().S(`</article>
</main> </main>
`) `)
//line views/mutators.qtpl:105 //line views/mutators.qtpl:108
qw422016.N().S(Toolbar(user.FromRequest(rq))) qw422016.N().S(Toolbar(user.FromRequest(rq)))
//line views/mutators.qtpl:105 //line views/mutators.qtpl:108
qw422016.N().S(` qw422016.N().S(`
</div> </div>
`) `)
//line views/mutators.qtpl:107 //line views/mutators.qtpl:110
streameditScripts(qw422016)
//line views/mutators.qtpl:110
qw422016.N().S(`
`)
//line views/mutators.qtpl:111
} }
//line views/mutators.qtpl:107 //line views/mutators.qtpl:111
func WritePreviewHTML(qq422016 qtio422016.Writer, rq *http.Request, hyphaName, textAreaFill, warning string, renderedPage string) { func WritePreviewHTML(qq422016 qtio422016.Writer, rq *http.Request, hyphaName, textAreaFill, warning string, renderedPage string) {
//line views/mutators.qtpl:107 //line views/mutators.qtpl:111
qw422016 := qt422016.AcquireWriter(qq422016) qw422016 := qt422016.AcquireWriter(qq422016)
//line views/mutators.qtpl:107 //line views/mutators.qtpl:111
StreamPreviewHTML(qw422016, rq, hyphaName, textAreaFill, warning, renderedPage) StreamPreviewHTML(qw422016, rq, hyphaName, textAreaFill, warning, renderedPage)
//line views/mutators.qtpl:107 //line views/mutators.qtpl:111
qt422016.ReleaseWriter(qw422016) qt422016.ReleaseWriter(qw422016)
//line views/mutators.qtpl:107 //line views/mutators.qtpl:111
} }
//line views/mutators.qtpl:107 //line views/mutators.qtpl:111
func PreviewHTML(rq *http.Request, hyphaName, textAreaFill, warning string, renderedPage string) string { func PreviewHTML(rq *http.Request, hyphaName, textAreaFill, warning string, renderedPage string) string {
//line views/mutators.qtpl:107 //line views/mutators.qtpl:111
qb422016 := qt422016.AcquireByteBuffer() qb422016 := qt422016.AcquireByteBuffer()
//line views/mutators.qtpl:107 //line views/mutators.qtpl:111
WritePreviewHTML(qb422016, rq, hyphaName, textAreaFill, warning, renderedPage) WritePreviewHTML(qb422016, rq, hyphaName, textAreaFill, warning, renderedPage)
//line views/mutators.qtpl:107 //line views/mutators.qtpl:111
qs422016 := string(qb422016.B) qs422016 := string(qb422016.B)
//line views/mutators.qtpl:107 //line views/mutators.qtpl:111
qt422016.ReleaseByteBuffer(qb422016) qt422016.ReleaseByteBuffer(qb422016)
//line views/mutators.qtpl:107 //line views/mutators.qtpl:111
return qs422016 return qs422016
//line views/mutators.qtpl:107 //line views/mutators.qtpl:111
}
//line views/mutators.qtpl:113
func streameditScripts(qw422016 *qt422016.Writer) {
//line views/mutators.qtpl:113
qw422016.N().S(`
`)
//line views/mutators.qtpl:114
for _, scriptPath := range cfg.EditScripts {
//line views/mutators.qtpl:114
qw422016.N().S(`
<script src="`)
//line views/mutators.qtpl:115
qw422016.E().S(scriptPath)
//line views/mutators.qtpl:115
qw422016.N().S(`"></script>
`)
//line views/mutators.qtpl:116
}
//line views/mutators.qtpl:116
qw422016.N().S(`
`)
//line views/mutators.qtpl:117
}
//line views/mutators.qtpl:117
func writeeditScripts(qq422016 qtio422016.Writer) {
//line views/mutators.qtpl:117
qw422016 := qt422016.AcquireWriter(qq422016)
//line views/mutators.qtpl:117
streameditScripts(qw422016)
//line views/mutators.qtpl:117
qt422016.ReleaseWriter(qw422016)
//line views/mutators.qtpl:117
}
//line views/mutators.qtpl:117
func editScripts() string {
//line views/mutators.qtpl:117
qb422016 := qt422016.AcquireByteBuffer()
//line views/mutators.qtpl:117
writeeditScripts(qb422016)
//line views/mutators.qtpl:117
qs422016 := string(qb422016.B)
//line views/mutators.qtpl:117
qt422016.ReleaseByteBuffer(qb422016)
//line views/mutators.qtpl:117
return qs422016
//line views/mutators.qtpl:117
} }

View File

@@ -3,6 +3,7 @@
{% import "path" %} {% import "path" %}
{% import "os" %} {% import "os" %}
{% import "github.com/bouncepaw/mycorrhiza/cfg" %}
{% import "github.com/bouncepaw/mycorrhiza/hyphae" %} {% import "github.com/bouncepaw/mycorrhiza/hyphae" %}
{% import "github.com/bouncepaw/mycorrhiza/mimetype" %} {% import "github.com/bouncepaw/mycorrhiza/mimetype" %}
{% import "github.com/bouncepaw/mycorrhiza/tree" %} {% import "github.com/bouncepaw/mycorrhiza/tree" %}
@@ -100,6 +101,7 @@ If `contents` == "", a helpful message is shown instead.
</main> </main>
{%= RelativeHyphaeHTML(relatives) %} {%= RelativeHyphaeHTML(relatives) %}
</div> </div>
{%= viewScripts() %}
{% endfunc %} {% endfunc %}
{% func RevisionHTML(rq *http.Request, h *hyphae.Hypha, contents, revHash string) %} {% func RevisionHTML(rq *http.Request, h *hyphae.Hypha, contents, revHash string) %}
@@ -118,4 +120,11 @@ If `contents` == "", a helpful message is shown instead.
</main> </main>
{%= RelativeHyphaeHTML(relatives) %} {%= RelativeHyphaeHTML(relatives) %}
</div> </div>
{%= viewScripts() %}
{% endfunc %}
{% func viewScripts() %}
{% for _, scriptPath := range cfg.ViewScripts %}
<script src="{%s scriptPath %}"></script>
{% endfor %}
{% endfunc %} {% endfunc %}

View File

@@ -17,139 +17,142 @@ import "path"
import "os" import "os"
//line views/readers.qtpl:6 //line views/readers.qtpl:6
import "github.com/bouncepaw/mycorrhiza/hyphae" import "github.com/bouncepaw/mycorrhiza/cfg"
//line views/readers.qtpl:7 //line views/readers.qtpl:7
import "github.com/bouncepaw/mycorrhiza/mimetype" import "github.com/bouncepaw/mycorrhiza/hyphae"
//line views/readers.qtpl:8 //line views/readers.qtpl:8
import "github.com/bouncepaw/mycorrhiza/tree" import "github.com/bouncepaw/mycorrhiza/mimetype"
//line views/readers.qtpl:9 //line views/readers.qtpl:9
import "github.com/bouncepaw/mycorrhiza/user" import "github.com/bouncepaw/mycorrhiza/tree"
//line views/readers.qtpl:10 //line views/readers.qtpl:10
import "github.com/bouncepaw/mycorrhiza/user"
//line views/readers.qtpl:11
import "github.com/bouncepaw/mycorrhiza/util" import "github.com/bouncepaw/mycorrhiza/util"
//line views/readers.qtpl:12 //line views/readers.qtpl:13
import ( import (
qtio422016 "io" qtio422016 "io"
qt422016 "github.com/valyala/quicktemplate" qt422016 "github.com/valyala/quicktemplate"
) )
//line views/readers.qtpl:12 //line views/readers.qtpl:13
var ( var (
_ = qtio422016.Copy _ = qtio422016.Copy
_ = qt422016.AcquireByteBuffer _ = qt422016.AcquireByteBuffer
) )
//line views/readers.qtpl:12 //line views/readers.qtpl:13
func StreamAttachmentMenuHTML(qw422016 *qt422016.Writer, rq *http.Request, h *hyphae.Hypha, u *user.User) { func StreamAttachmentMenuHTML(qw422016 *qt422016.Writer, rq *http.Request, h *hyphae.Hypha, u *user.User) {
//line views/readers.qtpl:12 //line views/readers.qtpl:13
qw422016.N().S(` qw422016.N().S(`
`) `)
//line views/readers.qtpl:13 //line views/readers.qtpl:14
StreamNavHTML(qw422016, rq, h.Name, "attachment") StreamNavHTML(qw422016, rq, h.Name, "attachment")
//line views/readers.qtpl:13 //line views/readers.qtpl:14
qw422016.N().S(` qw422016.N().S(`
<div class="layout"> <div class="layout">
<main class="main-width"> <main class="main-width">
<h1>Attachment of `) <h1>Attachment of `)
//line views/readers.qtpl:16 //line views/readers.qtpl:17
qw422016.E().S(util.BeautifulName(h.Name)) qw422016.E().S(util.BeautifulName(h.Name))
//line views/readers.qtpl:16 //line views/readers.qtpl:17
qw422016.N().S(`</h1> qw422016.N().S(`</h1>
`) `)
//line views/readers.qtpl:17 //line views/readers.qtpl:18
if h.BinaryPath == "" { if h.BinaryPath == "" {
//line views/readers.qtpl:17 //line views/readers.qtpl:18
qw422016.N().S(` qw422016.N().S(`
<p class="warning">This hypha has no attachment, you can upload it here.</p> <p class="warning">This hypha has no attachment, you can upload it here.</p>
`) `)
//line views/readers.qtpl:19 //line views/readers.qtpl:20
} else { } else {
//line views/readers.qtpl:19 //line views/readers.qtpl:20
qw422016.N().S(` qw422016.N().S(`
<p class="warning">You can manage the hypha's attachment on this page.</p> <p class="warning">You can manage the hypha's attachment on this page.</p>
`) `)
//line views/readers.qtpl:21 //line views/readers.qtpl:22
} }
//line views/readers.qtpl:21 //line views/readers.qtpl:22
qw422016.N().S(` qw422016.N().S(`
<section class="amnt-grid"> <section class="amnt-grid">
`) `)
//line views/readers.qtpl:25 //line views/readers.qtpl:26
if h.BinaryPath != "" { if h.BinaryPath != "" {
//line views/readers.qtpl:25 //line views/readers.qtpl:26
qw422016.N().S(` qw422016.N().S(`
`) `)
//line views/readers.qtpl:27 //line views/readers.qtpl:28
mime := mimetype.FromExtension(path.Ext(h.BinaryPath)) mime := mimetype.FromExtension(path.Ext(h.BinaryPath))
fileinfo, err := os.Stat(h.BinaryPath) fileinfo, err := os.Stat(h.BinaryPath)
//line views/readers.qtpl:28 //line views/readers.qtpl:29
qw422016.N().S(` qw422016.N().S(`
`) `)
//line views/readers.qtpl:29 //line views/readers.qtpl:30
if err == nil { if err == nil {
//line views/readers.qtpl:29 //line views/readers.qtpl:30
qw422016.N().S(` qw422016.N().S(`
<fieldset class="amnt-menu-block"> <fieldset class="amnt-menu-block">
<legend class="modal__title modal__title_small">Stat</legend> <legend class="modal__title modal__title_small">Stat</legend>
<p class="modal__confirmation-msg"><b>File size:</b> `) <p class="modal__confirmation-msg"><b>File size:</b> `)
//line views/readers.qtpl:32 //line views/readers.qtpl:33
qw422016.N().DL(fileinfo.Size()) qw422016.N().DL(fileinfo.Size())
//line views/readers.qtpl:32 //line views/readers.qtpl:33
qw422016.N().S(` bytes</p> qw422016.N().S(` bytes</p>
<p><b>MIME type:</b> `) <p><b>MIME type:</b> `)
//line views/readers.qtpl:33 //line views/readers.qtpl:34
qw422016.E().S(mime) qw422016.E().S(mime)
//line views/readers.qtpl:33 //line views/readers.qtpl:34
qw422016.N().S(`</p> qw422016.N().S(`</p>
</fieldset> </fieldset>
`) `)
//line views/readers.qtpl:35 //line views/readers.qtpl:36
} }
//line views/readers.qtpl:35 //line views/readers.qtpl:36
qw422016.N().S(` qw422016.N().S(`
`) `)
//line views/readers.qtpl:37 //line views/readers.qtpl:38
if strings.HasPrefix(mime, "image/") { if strings.HasPrefix(mime, "image/") {
//line views/readers.qtpl:37 //line views/readers.qtpl:38
qw422016.N().S(` qw422016.N().S(`
<fieldset class="amnt-menu-block"> <fieldset class="amnt-menu-block">
<legend class="modal__title modal__title_small">Include</legend> <legend class="modal__title modal__title_small">Include</legend>
<p class="modal__confirmation-msg">This attachment is an image. To include it n a hypha, use a syntax like this:</p> <p class="modal__confirmation-msg">This attachment is an image. To include it n a hypha, use a syntax like this:</p>
<pre class="codebleck"><code>img { `) <pre class="codebleck"><code>img { `)
//line views/readers.qtpl:41 //line views/readers.qtpl:42
qw422016.E().S(h.Name) qw422016.E().S(h.Name)
//line views/readers.qtpl:41 //line views/readers.qtpl:42
qw422016.N().S(` }</code></pre> qw422016.N().S(` }</code></pre>
</fieldset> </fieldset>
`) `)
//line views/readers.qtpl:43 //line views/readers.qtpl:44
} }
//line views/readers.qtpl:43 //line views/readers.qtpl:44
qw422016.N().S(` qw422016.N().S(`
`) `)
//line views/readers.qtpl:44 //line views/readers.qtpl:45
} }
//line views/readers.qtpl:44 //line views/readers.qtpl:45
qw422016.N().S(` qw422016.N().S(`
`) `)
//line views/readers.qtpl:46 //line views/readers.qtpl:47
if u.CanProceed("upload-binary") { if u.CanProceed("upload-binary") {
//line views/readers.qtpl:46 //line views/readers.qtpl:47
qw422016.N().S(` qw422016.N().S(`
<form action="/upload-binary/`) <form action="/upload-binary/`)
//line views/readers.qtpl:47 //line views/readers.qtpl:48
qw422016.E().S(h.Name) qw422016.E().S(h.Name)
//line views/readers.qtpl:47 //line views/readers.qtpl:48
qw422016.N().S(`" qw422016.N().S(`"
method="post" enctype="multipart/form-data" method="post" enctype="multipart/form-data"
class="modal amnt-menu-block"> class="modal amnt-menu-block">
@@ -161,20 +164,20 @@ func StreamAttachmentMenuHTML(qw422016 *qt422016.Writer, rq *http.Request, h *hy
</fieldset> </fieldset>
</form> </form>
`) `)
//line views/readers.qtpl:57 //line views/readers.qtpl:58
} }
//line views/readers.qtpl:57 //line views/readers.qtpl:58
qw422016.N().S(` qw422016.N().S(`
`) `)
//line views/readers.qtpl:59 //line views/readers.qtpl:60
if h.BinaryPath != "" && u.CanProceed("unattach-confirm") { if h.BinaryPath != "" && u.CanProceed("unattach-confirm") {
//line views/readers.qtpl:59 //line views/readers.qtpl:60
qw422016.N().S(` qw422016.N().S(`
<form action="/unattach-confirm/`) <form action="/unattach-confirm/`)
//line views/readers.qtpl:60 //line views/readers.qtpl:61
qw422016.E().S(h.Name) qw422016.E().S(h.Name)
//line views/readers.qtpl:60 //line views/readers.qtpl:61
qw422016.N().S(`" method="post" class="modal amnt-menu-block"> qw422016.N().S(`" method="post" class="modal amnt-menu-block">
<fieldset class="modal__fieldset"> <fieldset class="modal__fieldset">
<legend class="modal__title modal__title_small">Unattach</legend> <legend class="modal__title modal__title_small">Unattach</legend>
@@ -183,246 +186,305 @@ func StreamAttachmentMenuHTML(qw422016 *qt422016.Writer, rq *http.Request, h *hy
</fieldset> </fieldset>
</form> </form>
`) `)
//line views/readers.qtpl:67 //line views/readers.qtpl:68
} }
//line views/readers.qtpl:67 //line views/readers.qtpl:68
qw422016.N().S(` qw422016.N().S(`
</section> </section>
</main> </main>
</div> </div>
`) `)
//line views/readers.qtpl:72 //line views/readers.qtpl:73
} }
//line views/readers.qtpl:72 //line views/readers.qtpl:73
func WriteAttachmentMenuHTML(qq422016 qtio422016.Writer, rq *http.Request, h *hyphae.Hypha, u *user.User) { func WriteAttachmentMenuHTML(qq422016 qtio422016.Writer, rq *http.Request, h *hyphae.Hypha, u *user.User) {
//line views/readers.qtpl:72 //line views/readers.qtpl:73
qw422016 := qt422016.AcquireWriter(qq422016) qw422016 := qt422016.AcquireWriter(qq422016)
//line views/readers.qtpl:72 //line views/readers.qtpl:73
StreamAttachmentMenuHTML(qw422016, rq, h, u) StreamAttachmentMenuHTML(qw422016, rq, h, u)
//line views/readers.qtpl:72 //line views/readers.qtpl:73
qt422016.ReleaseWriter(qw422016) qt422016.ReleaseWriter(qw422016)
//line views/readers.qtpl:72 //line views/readers.qtpl:73
} }
//line views/readers.qtpl:72 //line views/readers.qtpl:73
func AttachmentMenuHTML(rq *http.Request, h *hyphae.Hypha, u *user.User) string { func AttachmentMenuHTML(rq *http.Request, h *hyphae.Hypha, u *user.User) string {
//line views/readers.qtpl:72 //line views/readers.qtpl:73
qb422016 := qt422016.AcquireByteBuffer() qb422016 := qt422016.AcquireByteBuffer()
//line views/readers.qtpl:72 //line views/readers.qtpl:73
WriteAttachmentMenuHTML(qb422016, rq, h, u) WriteAttachmentMenuHTML(qb422016, rq, h, u)
//line views/readers.qtpl:72 //line views/readers.qtpl:73
qs422016 := string(qb422016.B) qs422016 := string(qb422016.B)
//line views/readers.qtpl:72 //line views/readers.qtpl:73
qt422016.ReleaseByteBuffer(qb422016) qt422016.ReleaseByteBuffer(qb422016)
//line views/readers.qtpl:72 //line views/readers.qtpl:73
return qs422016 return qs422016
//line views/readers.qtpl:72 //line views/readers.qtpl:73
} }
// If `contents` == "", a helpful message is shown instead. // If `contents` == "", a helpful message is shown instead.
//line views/readers.qtpl:75 //line views/readers.qtpl:76
func StreamHyphaHTML(qw422016 *qt422016.Writer, rq *http.Request, h *hyphae.Hypha, contents string) { func StreamHyphaHTML(qw422016 *qt422016.Writer, rq *http.Request, h *hyphae.Hypha, contents string) {
//line views/readers.qtpl:75 //line views/readers.qtpl:76
qw422016.N().S(` qw422016.N().S(`
`) `)
//line views/readers.qtpl:77 //line views/readers.qtpl:78
relatives, subhyphae, prevHyphaName, nextHyphaName := tree.Tree(h.Name) relatives, subhyphae, prevHyphaName, nextHyphaName := tree.Tree(h.Name)
u := user.FromRequest(rq) u := user.FromRequest(rq)
//line views/readers.qtpl:79 //line views/readers.qtpl:80
qw422016.N().S(` qw422016.N().S(`
`) `)
//line views/readers.qtpl:80 //line views/readers.qtpl:81
StreamNavHTML(qw422016, rq, h.Name, "page") StreamNavHTML(qw422016, rq, h.Name, "page")
//line views/readers.qtpl:80 //line views/readers.qtpl:81
qw422016.N().S(` qw422016.N().S(`
<div class="layout"> <div class="layout">
<main class="main-width"> <main class="main-width">
<article> <article>
`) `)
//line views/readers.qtpl:84 //line views/readers.qtpl:85
qw422016.N().S(NaviTitleHTML(h)) qw422016.N().S(NaviTitleHTML(h))
//line views/readers.qtpl:84 //line views/readers.qtpl:85
qw422016.N().S(` qw422016.N().S(`
`) `)
//line views/readers.qtpl:85 //line views/readers.qtpl:86
if h.Exists { if h.Exists {
//line views/readers.qtpl:85 //line views/readers.qtpl:86
qw422016.N().S(` qw422016.N().S(`
`) `)
//line views/readers.qtpl:86 //line views/readers.qtpl:87
qw422016.N().S(contents) qw422016.N().S(contents)
//line views/readers.qtpl:86 //line views/readers.qtpl:87
qw422016.N().S(` qw422016.N().S(`
`) `)
//line views/readers.qtpl:87 //line views/readers.qtpl:88
} else { } else {
//line views/readers.qtpl:87 //line views/readers.qtpl:88
qw422016.N().S(` qw422016.N().S(`
`) `)
//line views/readers.qtpl:88 //line views/readers.qtpl:89
streamnonExistentHyphaNotice(qw422016, h, u) streamnonExistentHyphaNotice(qw422016, h, u)
//line views/readers.qtpl:88 //line views/readers.qtpl:89
qw422016.N().S(` qw422016.N().S(`
`) `)
//line views/readers.qtpl:89 //line views/readers.qtpl:90
} }
//line views/readers.qtpl:89 //line views/readers.qtpl:90
qw422016.N().S(` qw422016.N().S(`
</article> </article>
<section class="prevnext"> <section class="prevnext">
`) `)
//line views/readers.qtpl:92 //line views/readers.qtpl:93
if prevHyphaName != "" { if prevHyphaName != "" {
//line views/readers.qtpl:92 //line views/readers.qtpl:93
qw422016.N().S(` qw422016.N().S(`
<a class="prevnext__el prevnext__prev" href="/hypha/`) <a class="prevnext__el prevnext__prev" href="/hypha/`)
//line views/readers.qtpl:93 //line views/readers.qtpl:94
qw422016.E().S(prevHyphaName) qw422016.E().S(prevHyphaName)
//line views/readers.qtpl:93 //line views/readers.qtpl:94
qw422016.N().S(`" rel="prev">← `) qw422016.N().S(`" rel="prev">← `)
//line views/readers.qtpl:93 //line views/readers.qtpl:94
qw422016.E().S(util.BeautifulName(path.Base(prevHyphaName))) qw422016.E().S(util.BeautifulName(path.Base(prevHyphaName)))
//line views/readers.qtpl:93 //line views/readers.qtpl:94
qw422016.N().S(`</a> qw422016.N().S(`</a>
`) `)
//line views/readers.qtpl:94 //line views/readers.qtpl:95
} }
//line views/readers.qtpl:94 //line views/readers.qtpl:95
qw422016.N().S(` qw422016.N().S(`
`) `)
//line views/readers.qtpl:95 //line views/readers.qtpl:96
if nextHyphaName != "" { if nextHyphaName != "" {
//line views/readers.qtpl:95 //line views/readers.qtpl:96
qw422016.N().S(` qw422016.N().S(`
<a class="prevnext__el prevnext__next" href="/hypha/`) <a class="prevnext__el prevnext__next" href="/hypha/`)
//line views/readers.qtpl:96 //line views/readers.qtpl:97
qw422016.E().S(nextHyphaName) qw422016.E().S(nextHyphaName)
//line views/readers.qtpl:96 //line views/readers.qtpl:97
qw422016.N().S(`" rel="next">`) qw422016.N().S(`" rel="next">`)
//line views/readers.qtpl:96 //line views/readers.qtpl:97
qw422016.E().S(util.BeautifulName(path.Base(nextHyphaName))) qw422016.E().S(util.BeautifulName(path.Base(nextHyphaName)))
//line views/readers.qtpl:96 //line views/readers.qtpl:97
qw422016.N().S(` →</a> qw422016.N().S(` →</a>
`) `)
//line views/readers.qtpl:97 //line views/readers.qtpl:98
} }
//line views/readers.qtpl:97 //line views/readers.qtpl:98
qw422016.N().S(` qw422016.N().S(`
</section> </section>
`) `)
//line views/readers.qtpl:99 //line views/readers.qtpl:100
StreamSubhyphaeHTML(qw422016, subhyphae) StreamSubhyphaeHTML(qw422016, subhyphae)
//line views/readers.qtpl:99 //line views/readers.qtpl:100
qw422016.N().S(` qw422016.N().S(`
</main> </main>
`) `)
//line views/readers.qtpl:101 //line views/readers.qtpl:102
StreamRelativeHyphaeHTML(qw422016, relatives) StreamRelativeHyphaeHTML(qw422016, relatives)
//line views/readers.qtpl:101 //line views/readers.qtpl:102
qw422016.N().S(` qw422016.N().S(`
</div> </div>
`) `)
//line views/readers.qtpl:103 //line views/readers.qtpl:104
} streamviewScripts(qw422016)
//line views/readers.qtpl:104
//line views/readers.qtpl:103
func WriteHyphaHTML(qq422016 qtio422016.Writer, rq *http.Request, h *hyphae.Hypha, contents string) {
//line views/readers.qtpl:103
qw422016 := qt422016.AcquireWriter(qq422016)
//line views/readers.qtpl:103
StreamHyphaHTML(qw422016, rq, h, contents)
//line views/readers.qtpl:103
qt422016.ReleaseWriter(qw422016)
//line views/readers.qtpl:103
}
//line views/readers.qtpl:103
func HyphaHTML(rq *http.Request, h *hyphae.Hypha, contents string) string {
//line views/readers.qtpl:103
qb422016 := qt422016.AcquireByteBuffer()
//line views/readers.qtpl:103
WriteHyphaHTML(qb422016, rq, h, contents)
//line views/readers.qtpl:103
qs422016 := string(qb422016.B)
//line views/readers.qtpl:103
qt422016.ReleaseByteBuffer(qb422016)
//line views/readers.qtpl:103
return qs422016
//line views/readers.qtpl:103
}
//line views/readers.qtpl:105
func StreamRevisionHTML(qw422016 *qt422016.Writer, rq *http.Request, h *hyphae.Hypha, contents, revHash string) {
//line views/readers.qtpl:105
qw422016.N().S(` qw422016.N().S(`
`) `)
//line views/readers.qtpl:105
}
//line views/readers.qtpl:105
func WriteHyphaHTML(qq422016 qtio422016.Writer, rq *http.Request, h *hyphae.Hypha, contents string) {
//line views/readers.qtpl:105
qw422016 := qt422016.AcquireWriter(qq422016)
//line views/readers.qtpl:105
StreamHyphaHTML(qw422016, rq, h, contents)
//line views/readers.qtpl:105
qt422016.ReleaseWriter(qw422016)
//line views/readers.qtpl:105
}
//line views/readers.qtpl:105
func HyphaHTML(rq *http.Request, h *hyphae.Hypha, contents string) string {
//line views/readers.qtpl:105
qb422016 := qt422016.AcquireByteBuffer()
//line views/readers.qtpl:105
WriteHyphaHTML(qb422016, rq, h, contents)
//line views/readers.qtpl:105
qs422016 := string(qb422016.B)
//line views/readers.qtpl:105
qt422016.ReleaseByteBuffer(qb422016)
//line views/readers.qtpl:105
return qs422016
//line views/readers.qtpl:105
}
//line views/readers.qtpl:107 //line views/readers.qtpl:107
func StreamRevisionHTML(qw422016 *qt422016.Writer, rq *http.Request, h *hyphae.Hypha, contents, revHash string) {
//line views/readers.qtpl:107
qw422016.N().S(`
`)
//line views/readers.qtpl:109
relatives, subhyphae, _, _ := tree.Tree(h.Name) relatives, subhyphae, _, _ := tree.Tree(h.Name)
//line views/readers.qtpl:108 //line views/readers.qtpl:110
qw422016.N().S(` qw422016.N().S(`
`) `)
//line views/readers.qtpl:109 //line views/readers.qtpl:111
StreamNavHTML(qw422016, rq, h.Name, "revision", revHash) StreamNavHTML(qw422016, rq, h.Name, "revision", revHash)
//line views/readers.qtpl:109 //line views/readers.qtpl:111
qw422016.N().S(` qw422016.N().S(`
<div class="layout"> <div class="layout">
<main class="main-width"> <main class="main-width">
<article> <article>
<p>Please note that viewing binary parts of hyphae is not supported in history for now.</p> <p>Please note that viewing binary parts of hyphae is not supported in history for now.</p>
`) `)
//line views/readers.qtpl:114 //line views/readers.qtpl:116
qw422016.N().S(NaviTitleHTML(h)) qw422016.N().S(NaviTitleHTML(h))
//line views/readers.qtpl:114 //line views/readers.qtpl:116
qw422016.N().S(` qw422016.N().S(`
`) `)
//line views/readers.qtpl:115 //line views/readers.qtpl:117
qw422016.N().S(contents) qw422016.N().S(contents)
//line views/readers.qtpl:115 //line views/readers.qtpl:117
qw422016.N().S(` qw422016.N().S(`
</article> </article>
`) `)
//line views/readers.qtpl:117 //line views/readers.qtpl:119
StreamSubhyphaeHTML(qw422016, subhyphae) StreamSubhyphaeHTML(qw422016, subhyphae)
//line views/readers.qtpl:117 //line views/readers.qtpl:119
qw422016.N().S(` qw422016.N().S(`
</main> </main>
`) `)
//line views/readers.qtpl:119 //line views/readers.qtpl:121
StreamRelativeHyphaeHTML(qw422016, relatives) StreamRelativeHyphaeHTML(qw422016, relatives)
//line views/readers.qtpl:119 //line views/readers.qtpl:121
qw422016.N().S(` qw422016.N().S(`
</div> </div>
`) `)
//line views/readers.qtpl:121 //line views/readers.qtpl:123
streamviewScripts(qw422016)
//line views/readers.qtpl:123
qw422016.N().S(`
`)
//line views/readers.qtpl:124
} }
//line views/readers.qtpl:121 //line views/readers.qtpl:124
func WriteRevisionHTML(qq422016 qtio422016.Writer, rq *http.Request, h *hyphae.Hypha, contents, revHash string) { func WriteRevisionHTML(qq422016 qtio422016.Writer, rq *http.Request, h *hyphae.Hypha, contents, revHash string) {
//line views/readers.qtpl:121 //line views/readers.qtpl:124
qw422016 := qt422016.AcquireWriter(qq422016) qw422016 := qt422016.AcquireWriter(qq422016)
//line views/readers.qtpl:121 //line views/readers.qtpl:124
StreamRevisionHTML(qw422016, rq, h, contents, revHash) StreamRevisionHTML(qw422016, rq, h, contents, revHash)
//line views/readers.qtpl:121 //line views/readers.qtpl:124
qt422016.ReleaseWriter(qw422016) qt422016.ReleaseWriter(qw422016)
//line views/readers.qtpl:121 //line views/readers.qtpl:124
} }
//line views/readers.qtpl:121 //line views/readers.qtpl:124
func RevisionHTML(rq *http.Request, h *hyphae.Hypha, contents, revHash string) string { func RevisionHTML(rq *http.Request, h *hyphae.Hypha, contents, revHash string) string {
//line views/readers.qtpl:121 //line views/readers.qtpl:124
qb422016 := qt422016.AcquireByteBuffer() qb422016 := qt422016.AcquireByteBuffer()
//line views/readers.qtpl:121 //line views/readers.qtpl:124
WriteRevisionHTML(qb422016, rq, h, contents, revHash) WriteRevisionHTML(qb422016, rq, h, contents, revHash)
//line views/readers.qtpl:121 //line views/readers.qtpl:124
qs422016 := string(qb422016.B) qs422016 := string(qb422016.B)
//line views/readers.qtpl:121 //line views/readers.qtpl:124
qt422016.ReleaseByteBuffer(qb422016) qt422016.ReleaseByteBuffer(qb422016)
//line views/readers.qtpl:121 //line views/readers.qtpl:124
return qs422016 return qs422016
//line views/readers.qtpl:121 //line views/readers.qtpl:124
}
//line views/readers.qtpl:126
func streamviewScripts(qw422016 *qt422016.Writer) {
//line views/readers.qtpl:126
qw422016.N().S(`
`)
//line views/readers.qtpl:127
for _, scriptPath := range cfg.ViewScripts {
//line views/readers.qtpl:127
qw422016.N().S(`
<script src="`)
//line views/readers.qtpl:128
qw422016.E().S(scriptPath)
//line views/readers.qtpl:128
qw422016.N().S(`"></script>
`)
//line views/readers.qtpl:129
}
//line views/readers.qtpl:129
qw422016.N().S(`
`)
//line views/readers.qtpl:130
}
//line views/readers.qtpl:130
func writeviewScripts(qq422016 qtio422016.Writer) {
//line views/readers.qtpl:130
qw422016 := qt422016.AcquireWriter(qq422016)
//line views/readers.qtpl:130
streamviewScripts(qw422016)
//line views/readers.qtpl:130
qt422016.ReleaseWriter(qw422016)
//line views/readers.qtpl:130
}
//line views/readers.qtpl:130
func viewScripts() string {
//line views/readers.qtpl:130
qb422016 := qt422016.AcquireByteBuffer()
//line views/readers.qtpl:130
writeviewScripts(qb422016)
//line views/readers.qtpl:130
qs422016 := string(qb422016.B)
//line views/readers.qtpl:130
qt422016.ReleaseByteBuffer(qb422016)
//line views/readers.qtpl:130
return qs422016
//line views/readers.qtpl:130
} }

View File

@@ -26,6 +26,7 @@
</nav> </nav>
</header> </header>
{%s= body %} {%s= body %}
{%= omnipresentScripts() %}
</body> </body>
</html> </html>
{% endfunc %} {% endfunc %}
@@ -152,3 +153,9 @@ for u := range user.YieldUsers() {
</main> </main>
</div> </div>
{% endfunc %} {% endfunc %}
{% func omnipresentScripts() %}
{% for _, scriptPath := range cfg.OmnipresentScripts %}
<script src="{%s scriptPath %}"></script>
{% endfor %}
{% endfunc %}

View File

@@ -90,48 +90,53 @@ func StreamBaseHTML(qw422016 *qt422016.Writer, title, body string, u *user.User,
//line views/stuff.qtpl:28 //line views/stuff.qtpl:28
qw422016.N().S(body) qw422016.N().S(body)
//line views/stuff.qtpl:28 //line views/stuff.qtpl:28
qw422016.N().S(`
`)
//line views/stuff.qtpl:29
streamomnipresentScripts(qw422016)
//line views/stuff.qtpl:29
qw422016.N().S(` qw422016.N().S(`
</body> </body>
</html> </html>
`) `)
//line views/stuff.qtpl:31 //line views/stuff.qtpl:32
} }
//line views/stuff.qtpl:31 //line views/stuff.qtpl:32
func WriteBaseHTML(qq422016 qtio422016.Writer, title, body string, u *user.User, headElements ...string) { func WriteBaseHTML(qq422016 qtio422016.Writer, title, body string, u *user.User, headElements ...string) {
//line views/stuff.qtpl:31 //line views/stuff.qtpl:32
qw422016 := qt422016.AcquireWriter(qq422016) qw422016 := qt422016.AcquireWriter(qq422016)
//line views/stuff.qtpl:31 //line views/stuff.qtpl:32
StreamBaseHTML(qw422016, title, body, u, headElements...) StreamBaseHTML(qw422016, title, body, u, headElements...)
//line views/stuff.qtpl:31 //line views/stuff.qtpl:32
qt422016.ReleaseWriter(qw422016) qt422016.ReleaseWriter(qw422016)
//line views/stuff.qtpl:31 //line views/stuff.qtpl:32
} }
//line views/stuff.qtpl:31 //line views/stuff.qtpl:32
func BaseHTML(title, body string, u *user.User, headElements ...string) string { func BaseHTML(title, body string, u *user.User, headElements ...string) string {
//line views/stuff.qtpl:31 //line views/stuff.qtpl:32
qb422016 := qt422016.AcquireByteBuffer() qb422016 := qt422016.AcquireByteBuffer()
//line views/stuff.qtpl:31 //line views/stuff.qtpl:32
WriteBaseHTML(qb422016, title, body, u, headElements...) WriteBaseHTML(qb422016, title, body, u, headElements...)
//line views/stuff.qtpl:31 //line views/stuff.qtpl:32
qs422016 := string(qb422016.B) qs422016 := string(qb422016.B)
//line views/stuff.qtpl:31 //line views/stuff.qtpl:32
qt422016.ReleaseByteBuffer(qb422016) qt422016.ReleaseByteBuffer(qb422016)
//line views/stuff.qtpl:31 //line views/stuff.qtpl:32
return qs422016 return qs422016
//line views/stuff.qtpl:31 //line views/stuff.qtpl:32
} }
//line views/stuff.qtpl:33 //line views/stuff.qtpl:34
func StreamUserListHTML(qw422016 *qt422016.Writer) { func StreamUserListHTML(qw422016 *qt422016.Writer) {
//line views/stuff.qtpl:33 //line views/stuff.qtpl:34
qw422016.N().S(` qw422016.N().S(`
<div class="layout"> <div class="layout">
<main class="main-width user-list"> <main class="main-width user-list">
<h1>List of users</h1> <h1>List of users</h1>
`) `)
//line views/stuff.qtpl:38 //line views/stuff.qtpl:39
var ( var (
admins = make([]string, 0) admins = make([]string, 0)
moderators = make([]string, 0) moderators = make([]string, 0)
@@ -148,303 +153,303 @@ func StreamUserListHTML(qw422016 *qt422016.Writer) {
} }
} }
//line views/stuff.qtpl:53 //line views/stuff.qtpl:54
qw422016.N().S(` qw422016.N().S(`
<section> <section>
<h2>Admins</h2> <h2>Admins</h2>
<ol>`) <ol>`)
//line views/stuff.qtpl:56 //line views/stuff.qtpl:57
for _, name := range admins { for _, name := range admins {
//line views/stuff.qtpl:56 //line views/stuff.qtpl:57
qw422016.N().S(` qw422016.N().S(`
<li><a href="/page/`) <li><a href="/page/`)
//line views/stuff.qtpl:57 //line views/stuff.qtpl:58
qw422016.E().S(cfg.UserHypha) qw422016.E().S(cfg.UserHypha)
//line views/stuff.qtpl:57 //line views/stuff.qtpl:58
qw422016.N().S(`/`) qw422016.N().S(`/`)
//line views/stuff.qtpl:57 //line views/stuff.qtpl:58
qw422016.E().S(name) qw422016.E().S(name)
//line views/stuff.qtpl:57 //line views/stuff.qtpl:58
qw422016.N().S(`">`) qw422016.N().S(`">`)
//line views/stuff.qtpl:57 //line views/stuff.qtpl:58
qw422016.E().S(name) qw422016.E().S(name)
//line views/stuff.qtpl:57 //line views/stuff.qtpl:58
qw422016.N().S(`</a></li> qw422016.N().S(`</a></li>
`) `)
//line views/stuff.qtpl:58 //line views/stuff.qtpl:59
} }
//line views/stuff.qtpl:58 //line views/stuff.qtpl:59
qw422016.N().S(`</ol> qw422016.N().S(`</ol>
</section> </section>
<section> <section>
<h2>Moderators</h2> <h2>Moderators</h2>
<ol>`) <ol>`)
//line views/stuff.qtpl:62 //line views/stuff.qtpl:63
for _, name := range moderators { for _, name := range moderators {
//line views/stuff.qtpl:62 //line views/stuff.qtpl:63
qw422016.N().S(` qw422016.N().S(`
<li><a href="/page/`) <li><a href="/page/`)
//line views/stuff.qtpl:63 //line views/stuff.qtpl:64
qw422016.E().S(cfg.UserHypha) qw422016.E().S(cfg.UserHypha)
//line views/stuff.qtpl:63 //line views/stuff.qtpl:64
qw422016.N().S(`/`) qw422016.N().S(`/`)
//line views/stuff.qtpl:63 //line views/stuff.qtpl:64
qw422016.E().S(name) qw422016.E().S(name)
//line views/stuff.qtpl:63 //line views/stuff.qtpl:64
qw422016.N().S(`">`) qw422016.N().S(`">`)
//line views/stuff.qtpl:63 //line views/stuff.qtpl:64
qw422016.E().S(name) qw422016.E().S(name)
//line views/stuff.qtpl:63 //line views/stuff.qtpl:64
qw422016.N().S(`</a></li> qw422016.N().S(`</a></li>
`) `)
//line views/stuff.qtpl:64 //line views/stuff.qtpl:65
} }
//line views/stuff.qtpl:64 //line views/stuff.qtpl:65
qw422016.N().S(`</ol> qw422016.N().S(`</ol>
</section> </section>
<section> <section>
<h2>Editors</h2> <h2>Editors</h2>
<ol>`) <ol>`)
//line views/stuff.qtpl:68 //line views/stuff.qtpl:69
for _, name := range editors { for _, name := range editors {
//line views/stuff.qtpl:68 //line views/stuff.qtpl:69
qw422016.N().S(` qw422016.N().S(`
<li><a href="/page/`) <li><a href="/page/`)
//line views/stuff.qtpl:69 //line views/stuff.qtpl:70
qw422016.E().S(cfg.UserHypha) qw422016.E().S(cfg.UserHypha)
//line views/stuff.qtpl:69 //line views/stuff.qtpl:70
qw422016.N().S(`/`) qw422016.N().S(`/`)
//line views/stuff.qtpl:69 //line views/stuff.qtpl:70
qw422016.E().S(name) qw422016.E().S(name)
//line views/stuff.qtpl:69 //line views/stuff.qtpl:70
qw422016.N().S(`">`) qw422016.N().S(`">`)
//line views/stuff.qtpl:69 //line views/stuff.qtpl:70
qw422016.E().S(name) qw422016.E().S(name)
//line views/stuff.qtpl:69 //line views/stuff.qtpl:70
qw422016.N().S(`</a></li> qw422016.N().S(`</a></li>
`) `)
//line views/stuff.qtpl:70 //line views/stuff.qtpl:71
} }
//line views/stuff.qtpl:70 //line views/stuff.qtpl:71
qw422016.N().S(`</ol> qw422016.N().S(`</ol>
</section> </section>
</main> </main>
</div> </div>
`) `)
//line views/stuff.qtpl:74 //line views/stuff.qtpl:75
} }
//line views/stuff.qtpl:74 //line views/stuff.qtpl:75
func WriteUserListHTML(qq422016 qtio422016.Writer) { func WriteUserListHTML(qq422016 qtio422016.Writer) {
//line views/stuff.qtpl:74 //line views/stuff.qtpl:75
qw422016 := qt422016.AcquireWriter(qq422016) qw422016 := qt422016.AcquireWriter(qq422016)
//line views/stuff.qtpl:74 //line views/stuff.qtpl:75
StreamUserListHTML(qw422016) StreamUserListHTML(qw422016)
//line views/stuff.qtpl:74 //line views/stuff.qtpl:75
qt422016.ReleaseWriter(qw422016) qt422016.ReleaseWriter(qw422016)
//line views/stuff.qtpl:74 //line views/stuff.qtpl:75
} }
//line views/stuff.qtpl:74 //line views/stuff.qtpl:75
func UserListHTML() string { func UserListHTML() string {
//line views/stuff.qtpl:74 //line views/stuff.qtpl:75
qb422016 := qt422016.AcquireByteBuffer() qb422016 := qt422016.AcquireByteBuffer()
//line views/stuff.qtpl:74 //line views/stuff.qtpl:75
WriteUserListHTML(qb422016) WriteUserListHTML(qb422016)
//line views/stuff.qtpl:74 //line views/stuff.qtpl:75
qs422016 := string(qb422016.B) qs422016 := string(qb422016.B)
//line views/stuff.qtpl:74 //line views/stuff.qtpl:75
qt422016.ReleaseByteBuffer(qb422016) qt422016.ReleaseByteBuffer(qb422016)
//line views/stuff.qtpl:74 //line views/stuff.qtpl:75
return qs422016 return qs422016
//line views/stuff.qtpl:74 //line views/stuff.qtpl:75
} }
//line views/stuff.qtpl:76 //line views/stuff.qtpl:77
func StreamHyphaListHTML(qw422016 *qt422016.Writer) { func StreamHyphaListHTML(qw422016 *qt422016.Writer) {
//line views/stuff.qtpl:76 //line views/stuff.qtpl:77
qw422016.N().S(` qw422016.N().S(`
<div class="layout"> <div class="layout">
<main class="main-width"> <main class="main-width">
<h1>List of hyphae</h1> <h1>List of hyphae</h1>
<p>This wiki has `) <p>This wiki has `)
//line views/stuff.qtpl:80 //line views/stuff.qtpl:81
qw422016.N().D(hyphae.Count()) qw422016.N().D(hyphae.Count())
//line views/stuff.qtpl:80 //line views/stuff.qtpl:81
qw422016.N().S(` hyphae.</p> qw422016.N().S(` hyphae.</p>
<ul class="hypha-list"> <ul class="hypha-list">
`) `)
//line views/stuff.qtpl:82 //line views/stuff.qtpl:83
for h := range hyphae.YieldExistingHyphae() { for h := range hyphae.YieldExistingHyphae() {
//line views/stuff.qtpl:82 //line views/stuff.qtpl:83
qw422016.N().S(` qw422016.N().S(`
<li class="hypha-list__entry"> <li class="hypha-list__entry">
<a class="hypha-list__link" href="/hypha/`) <a class="hypha-list__link" href="/hypha/`)
//line views/stuff.qtpl:84 //line views/stuff.qtpl:85
qw422016.E().S(h.Name) qw422016.E().S(h.Name)
//line views/stuff.qtpl:84 //line views/stuff.qtpl:85
qw422016.N().S(`">`) qw422016.N().S(`">`)
//line views/stuff.qtpl:84 //line views/stuff.qtpl:85
qw422016.E().S(util.BeautifulName(h.Name)) qw422016.E().S(util.BeautifulName(h.Name))
//line views/stuff.qtpl:84 //line views/stuff.qtpl:85
qw422016.N().S(`</a> qw422016.N().S(`</a>
`) `)
//line views/stuff.qtpl:85 //line views/stuff.qtpl:86
if h.BinaryPath != "" { if h.BinaryPath != "" {
//line views/stuff.qtpl:85 //line views/stuff.qtpl:86
qw422016.N().S(` qw422016.N().S(`
<span class="hypha-list__amnt-type">`) <span class="hypha-list__amnt-type">`)
//line views/stuff.qtpl:86 //line views/stuff.qtpl:87
qw422016.E().S(filepath.Ext(h.BinaryPath)[1:]) qw422016.E().S(filepath.Ext(h.BinaryPath)[1:])
//line views/stuff.qtpl:86 //line views/stuff.qtpl:87
qw422016.N().S(`</span> qw422016.N().S(`</span>
`) `)
//line views/stuff.qtpl:87 //line views/stuff.qtpl:88
} }
//line views/stuff.qtpl:87 //line views/stuff.qtpl:88
qw422016.N().S(` qw422016.N().S(`
</li> </li>
`) `)
//line views/stuff.qtpl:89 //line views/stuff.qtpl:90
} }
//line views/stuff.qtpl:89 //line views/stuff.qtpl:90
qw422016.N().S(` qw422016.N().S(`
</ul> </ul>
</main> </main>
</div> </div>
`) `)
//line views/stuff.qtpl:93 //line views/stuff.qtpl:94
} }
//line views/stuff.qtpl:93 //line views/stuff.qtpl:94
func WriteHyphaListHTML(qq422016 qtio422016.Writer) { func WriteHyphaListHTML(qq422016 qtio422016.Writer) {
//line views/stuff.qtpl:93 //line views/stuff.qtpl:94
qw422016 := qt422016.AcquireWriter(qq422016) qw422016 := qt422016.AcquireWriter(qq422016)
//line views/stuff.qtpl:93 //line views/stuff.qtpl:94
StreamHyphaListHTML(qw422016) StreamHyphaListHTML(qw422016)
//line views/stuff.qtpl:93 //line views/stuff.qtpl:94
qt422016.ReleaseWriter(qw422016) qt422016.ReleaseWriter(qw422016)
//line views/stuff.qtpl:93 //line views/stuff.qtpl:94
} }
//line views/stuff.qtpl:93 //line views/stuff.qtpl:94
func HyphaListHTML() string { func HyphaListHTML() string {
//line views/stuff.qtpl:93 //line views/stuff.qtpl:94
qb422016 := qt422016.AcquireByteBuffer() qb422016 := qt422016.AcquireByteBuffer()
//line views/stuff.qtpl:93 //line views/stuff.qtpl:94
WriteHyphaListHTML(qb422016) WriteHyphaListHTML(qb422016)
//line views/stuff.qtpl:93 //line views/stuff.qtpl:94
qs422016 := string(qb422016.B) qs422016 := string(qb422016.B)
//line views/stuff.qtpl:93 //line views/stuff.qtpl:94
qt422016.ReleaseByteBuffer(qb422016) qt422016.ReleaseByteBuffer(qb422016)
//line views/stuff.qtpl:93 //line views/stuff.qtpl:94
return qs422016 return qs422016
//line views/stuff.qtpl:93 //line views/stuff.qtpl:94
} }
//line views/stuff.qtpl:95 //line views/stuff.qtpl:96
func StreamAboutHTML(qw422016 *qt422016.Writer) { func StreamAboutHTML(qw422016 *qt422016.Writer) {
//line views/stuff.qtpl:95 //line views/stuff.qtpl:96
qw422016.N().S(` qw422016.N().S(`
<div class="layout"> <div class="layout">
<main class="main-width"> <main class="main-width">
<section> <section>
<h1>About `) <h1>About `)
//line views/stuff.qtpl:99 //line views/stuff.qtpl:100
qw422016.E().S(cfg.WikiName) qw422016.E().S(cfg.WikiName)
//line views/stuff.qtpl:99 //line views/stuff.qtpl:100
qw422016.N().S(`</h1> qw422016.N().S(`</h1>
<ul> <ul>
<li><b><a href="https://mycorrhiza.lesarbr.es">MycorrhizaWiki</a> version:</b> 1.2.0 indev</li> <li><b><a href="https://mycorrhiza.lesarbr.es">MycorrhizaWiki</a> version:</b> 1.2.0 indev</li>
`) `)
//line views/stuff.qtpl:102 //line views/stuff.qtpl:103
if user.AuthUsed { if user.AuthUsed {
//line views/stuff.qtpl:102 //line views/stuff.qtpl:103
qw422016.N().S(` <li><b>User count:</b> `) qw422016.N().S(` <li><b>User count:</b> `)
//line views/stuff.qtpl:103 //line views/stuff.qtpl:104
qw422016.N().D(user.Count()) qw422016.N().D(user.Count())
//line views/stuff.qtpl:103 //line views/stuff.qtpl:104
qw422016.N().S(`</li> qw422016.N().S(`</li>
<li><b>Home page:</b> <a href="/">`) <li><b>Home page:</b> <a href="/">`)
//line views/stuff.qtpl:104 //line views/stuff.qtpl:105
qw422016.E().S(cfg.HomeHypha) qw422016.E().S(cfg.HomeHypha)
//line views/stuff.qtpl:104 //line views/stuff.qtpl:105
qw422016.N().S(`</a></li> qw422016.N().S(`</a></li>
<li><b>Administrators:</b>`) <li><b>Administrators:</b>`)
//line views/stuff.qtpl:105 //line views/stuff.qtpl:106
for i, username := range user.ListUsersWithGroup("admin") { for i, username := range user.ListUsersWithGroup("admin") {
//line views/stuff.qtpl:106 //line views/stuff.qtpl:107
if i > 0 { if i > 0 {
//line views/stuff.qtpl:106 //line views/stuff.qtpl:107
qw422016.N().S(`<span aria-hidden="true">, </span> qw422016.N().S(`<span aria-hidden="true">, </span>
`) `)
//line views/stuff.qtpl:107 //line views/stuff.qtpl:108
} }
//line views/stuff.qtpl:107 //line views/stuff.qtpl:108
qw422016.N().S(` <a href="/page/`) qw422016.N().S(` <a href="/page/`)
//line views/stuff.qtpl:108 //line views/stuff.qtpl:109
qw422016.E().S(cfg.UserHypha) qw422016.E().S(cfg.UserHypha)
//line views/stuff.qtpl:108 //line views/stuff.qtpl:109
qw422016.N().S(`/`) qw422016.N().S(`/`)
//line views/stuff.qtpl:108 //line views/stuff.qtpl:109
qw422016.E().S(username) qw422016.E().S(username)
//line views/stuff.qtpl:108 //line views/stuff.qtpl:109
qw422016.N().S(`">`) qw422016.N().S(`">`)
//line views/stuff.qtpl:108 //line views/stuff.qtpl:109
qw422016.E().S(username) qw422016.E().S(username)
//line views/stuff.qtpl:108 //line views/stuff.qtpl:109
qw422016.N().S(`</a>`) qw422016.N().S(`</a>`)
//line views/stuff.qtpl:108 //line views/stuff.qtpl:109
} }
//line views/stuff.qtpl:108 //line views/stuff.qtpl:109
qw422016.N().S(`</li> qw422016.N().S(`</li>
`) `)
//line views/stuff.qtpl:109 //line views/stuff.qtpl:110
} else { } else {
//line views/stuff.qtpl:109 //line views/stuff.qtpl:110
qw422016.N().S(` <li>This wiki does not use authorization</li> qw422016.N().S(` <li>This wiki does not use authorization</li>
`) `)
//line views/stuff.qtpl:111 //line views/stuff.qtpl:112
} }
//line views/stuff.qtpl:111 //line views/stuff.qtpl:112
qw422016.N().S(` </ul> qw422016.N().S(` </ul>
<p>See <a href="/list">/list</a> for information about hyphae on this wiki.</p> <p>See <a href="/list">/list</a> for information about hyphae on this wiki.</p>
</section> </section>
</main> </main>
</div> </div>
`) `)
//line views/stuff.qtpl:117 //line views/stuff.qtpl:118
} }
//line views/stuff.qtpl:117 //line views/stuff.qtpl:118
func WriteAboutHTML(qq422016 qtio422016.Writer) { func WriteAboutHTML(qq422016 qtio422016.Writer) {
//line views/stuff.qtpl:117 //line views/stuff.qtpl:118
qw422016 := qt422016.AcquireWriter(qq422016) qw422016 := qt422016.AcquireWriter(qq422016)
//line views/stuff.qtpl:117 //line views/stuff.qtpl:118
StreamAboutHTML(qw422016) StreamAboutHTML(qw422016)
//line views/stuff.qtpl:117 //line views/stuff.qtpl:118
qt422016.ReleaseWriter(qw422016) qt422016.ReleaseWriter(qw422016)
//line views/stuff.qtpl:117 //line views/stuff.qtpl:118
} }
//line views/stuff.qtpl:117 //line views/stuff.qtpl:118
func AboutHTML() string { func AboutHTML() string {
//line views/stuff.qtpl:117 //line views/stuff.qtpl:118
qb422016 := qt422016.AcquireByteBuffer() qb422016 := qt422016.AcquireByteBuffer()
//line views/stuff.qtpl:117 //line views/stuff.qtpl:118
WriteAboutHTML(qb422016) WriteAboutHTML(qb422016)
//line views/stuff.qtpl:117 //line views/stuff.qtpl:118
qs422016 := string(qb422016.B) qs422016 := string(qb422016.B)
//line views/stuff.qtpl:117 //line views/stuff.qtpl:118
qt422016.ReleaseByteBuffer(qb422016) qt422016.ReleaseByteBuffer(qb422016)
//line views/stuff.qtpl:117 //line views/stuff.qtpl:118
return qs422016 return qs422016
//line views/stuff.qtpl:117 //line views/stuff.qtpl:118
} }
//line views/stuff.qtpl:119 //line views/stuff.qtpl:120
func StreamAdminPanelHTML(qw422016 *qt422016.Writer) { func StreamAdminPanelHTML(qw422016 *qt422016.Writer) {
//line views/stuff.qtpl:119 //line views/stuff.qtpl:120
qw422016.N().S(` qw422016.N().S(`
<div class="layout"> <div class="layout">
<main class="main-width"> <main class="main-width">
@@ -481,31 +486,80 @@ func StreamAdminPanelHTML(qw422016 *qt422016.Writer) {
</main> </main>
</div> </div>
`) `)
//line views/stuff.qtpl:154 //line views/stuff.qtpl:155
} }
//line views/stuff.qtpl:154 //line views/stuff.qtpl:155
func WriteAdminPanelHTML(qq422016 qtio422016.Writer) { func WriteAdminPanelHTML(qq422016 qtio422016.Writer) {
//line views/stuff.qtpl:154 //line views/stuff.qtpl:155
qw422016 := qt422016.AcquireWriter(qq422016) qw422016 := qt422016.AcquireWriter(qq422016)
//line views/stuff.qtpl:154 //line views/stuff.qtpl:155
StreamAdminPanelHTML(qw422016) StreamAdminPanelHTML(qw422016)
//line views/stuff.qtpl:154 //line views/stuff.qtpl:155
qt422016.ReleaseWriter(qw422016) qt422016.ReleaseWriter(qw422016)
//line views/stuff.qtpl:154 //line views/stuff.qtpl:155
} }
//line views/stuff.qtpl:154 //line views/stuff.qtpl:155
func AdminPanelHTML() string { func AdminPanelHTML() string {
//line views/stuff.qtpl:154 //line views/stuff.qtpl:155
qb422016 := qt422016.AcquireByteBuffer() qb422016 := qt422016.AcquireByteBuffer()
//line views/stuff.qtpl:154 //line views/stuff.qtpl:155
WriteAdminPanelHTML(qb422016) WriteAdminPanelHTML(qb422016)
//line views/stuff.qtpl:154 //line views/stuff.qtpl:155
qs422016 := string(qb422016.B) qs422016 := string(qb422016.B)
//line views/stuff.qtpl:154 //line views/stuff.qtpl:155
qt422016.ReleaseByteBuffer(qb422016) qt422016.ReleaseByteBuffer(qb422016)
//line views/stuff.qtpl:154 //line views/stuff.qtpl:155
return qs422016 return qs422016
//line views/stuff.qtpl:154 //line views/stuff.qtpl:155
}
//line views/stuff.qtpl:157
func streamomnipresentScripts(qw422016 *qt422016.Writer) {
//line views/stuff.qtpl:157
qw422016.N().S(`
`)
//line views/stuff.qtpl:158
for _, scriptPath := range cfg.OmnipresentScripts {
//line views/stuff.qtpl:158
qw422016.N().S(`
<script src="`)
//line views/stuff.qtpl:159
qw422016.E().S(scriptPath)
//line views/stuff.qtpl:159
qw422016.N().S(`"></script>
`)
//line views/stuff.qtpl:160
}
//line views/stuff.qtpl:160
qw422016.N().S(`
`)
//line views/stuff.qtpl:161
}
//line views/stuff.qtpl:161
func writeomnipresentScripts(qq422016 qtio422016.Writer) {
//line views/stuff.qtpl:161
qw422016 := qt422016.AcquireWriter(qq422016)
//line views/stuff.qtpl:161
streamomnipresentScripts(qw422016)
//line views/stuff.qtpl:161
qt422016.ReleaseWriter(qw422016)
//line views/stuff.qtpl:161
}
//line views/stuff.qtpl:161
func omnipresentScripts() string {
//line views/stuff.qtpl:161
qb422016 := qt422016.AcquireByteBuffer()
//line views/stuff.qtpl:161
writeomnipresentScripts(qb422016)
//line views/stuff.qtpl:161
qs422016 := string(qb422016.B)
//line views/stuff.qtpl:161
qt422016.ReleaseByteBuffer(qb422016)
//line views/stuff.qtpl:161
return qs422016
//line views/stuff.qtpl:161
} }