2020-08-31 17:52:26 +00:00
|
|
|
// Code generated by qtc from "http_readers.qtpl". DO NOT EDIT.
|
|
|
|
// See https://github.com/valyala/quicktemplate for details.
|
|
|
|
|
|
|
|
//line templates/http_readers.qtpl:1
|
|
|
|
package templates
|
|
|
|
|
|
|
|
//line templates/http_readers.qtpl:1
|
2020-11-16 15:26:03 +00:00
|
|
|
import "net/http"
|
|
|
|
|
|
|
|
//line templates/http_readers.qtpl:2
|
|
|
|
import "github.com/bouncepaw/mycorrhiza/user"
|
|
|
|
|
|
|
|
//line templates/http_readers.qtpl:4
|
2020-08-31 17:52:26 +00:00
|
|
|
import (
|
|
|
|
qtio422016 "io"
|
|
|
|
|
|
|
|
qt422016 "github.com/valyala/quicktemplate"
|
|
|
|
)
|
|
|
|
|
2020-11-16 15:26:03 +00:00
|
|
|
//line templates/http_readers.qtpl:4
|
2020-08-31 17:52:26 +00:00
|
|
|
var (
|
|
|
|
_ = qtio422016.Copy
|
|
|
|
_ = qt422016.AcquireByteBuffer
|
|
|
|
)
|
|
|
|
|
2020-11-16 15:26:03 +00:00
|
|
|
//line templates/http_readers.qtpl:4
|
|
|
|
func StreamHistoryHTML(qw422016 *qt422016.Writer, rq *http.Request, hyphaName, tbody string) {
|
|
|
|
//line templates/http_readers.qtpl:4
|
2020-08-31 17:52:26 +00:00
|
|
|
qw422016.N().S(`
|
2020-10-02 15:31:59 +00:00
|
|
|
<main>
|
|
|
|
`)
|
2020-11-16 15:26:03 +00:00
|
|
|
//line templates/http_readers.qtpl:6
|
|
|
|
streamnavHTML(qw422016, rq, hyphaName, "history")
|
|
|
|
//line templates/http_readers.qtpl:6
|
2020-10-02 15:31:59 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
<table>
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th>Time</th>
|
|
|
|
<th>Hash</th>
|
|
|
|
<th>Message</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
`)
|
2020-11-16 15:26:03 +00:00
|
|
|
//line templates/http_readers.qtpl:16
|
2020-08-31 17:52:26 +00:00
|
|
|
qw422016.N().S(tbody)
|
2020-11-16 15:26:03 +00:00
|
|
|
//line templates/http_readers.qtpl:16
|
2020-08-31 17:52:26 +00:00
|
|
|
qw422016.N().S(`
|
2020-10-02 15:31:59 +00:00
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</main>
|
2020-08-31 17:52:26 +00:00
|
|
|
`)
|
2020-11-16 15:26:03 +00:00
|
|
|
//line templates/http_readers.qtpl:20
|
2020-08-31 17:52:26 +00:00
|
|
|
}
|
|
|
|
|
2020-11-16 15:26:03 +00:00
|
|
|
//line templates/http_readers.qtpl:20
|
|
|
|
func WriteHistoryHTML(qq422016 qtio422016.Writer, rq *http.Request, hyphaName, tbody string) {
|
|
|
|
//line templates/http_readers.qtpl:20
|
2020-08-31 17:52:26 +00:00
|
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
2020-11-16 15:26:03 +00:00
|
|
|
//line templates/http_readers.qtpl:20
|
|
|
|
StreamHistoryHTML(qw422016, rq, hyphaName, tbody)
|
|
|
|
//line templates/http_readers.qtpl:20
|
2020-08-31 17:52:26 +00:00
|
|
|
qt422016.ReleaseWriter(qw422016)
|
2020-11-16 15:26:03 +00:00
|
|
|
//line templates/http_readers.qtpl:20
|
2020-08-31 17:52:26 +00:00
|
|
|
}
|
|
|
|
|
2020-11-16 15:26:03 +00:00
|
|
|
//line templates/http_readers.qtpl:20
|
|
|
|
func HistoryHTML(rq *http.Request, hyphaName, tbody string) string {
|
|
|
|
//line templates/http_readers.qtpl:20
|
2020-08-31 17:52:26 +00:00
|
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
2020-11-16 15:26:03 +00:00
|
|
|
//line templates/http_readers.qtpl:20
|
|
|
|
WriteHistoryHTML(qb422016, rq, hyphaName, tbody)
|
|
|
|
//line templates/http_readers.qtpl:20
|
2020-08-31 17:52:26 +00:00
|
|
|
qs422016 := string(qb422016.B)
|
2020-11-16 15:26:03 +00:00
|
|
|
//line templates/http_readers.qtpl:20
|
2020-08-31 17:52:26 +00:00
|
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
2020-11-16 15:26:03 +00:00
|
|
|
//line templates/http_readers.qtpl:20
|
2020-08-31 17:52:26 +00:00
|
|
|
return qs422016
|
2020-11-16 15:26:03 +00:00
|
|
|
//line templates/http_readers.qtpl:20
|
2020-08-31 17:52:26 +00:00
|
|
|
}
|
|
|
|
|
2020-11-16 15:26:03 +00:00
|
|
|
//line templates/http_readers.qtpl:22
|
|
|
|
func StreamRevisionHTML(qw422016 *qt422016.Writer, rq *http.Request, hyphaName, naviTitle, contents, tree, revHash string) {
|
|
|
|
//line templates/http_readers.qtpl:22
|
2020-08-31 17:52:26 +00:00
|
|
|
qw422016.N().S(`
|
2020-10-02 15:31:59 +00:00
|
|
|
<main>
|
|
|
|
`)
|
2020-11-16 15:26:03 +00:00
|
|
|
//line templates/http_readers.qtpl:24
|
|
|
|
streamnavHTML(qw422016, rq, hyphaName, "revision", revHash)
|
|
|
|
//line templates/http_readers.qtpl:24
|
2020-10-02 15:31:59 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
<article>
|
|
|
|
<p>Please note that viewing binary parts of hyphae is not supported in history for now.</p>
|
|
|
|
`)
|
2020-11-16 15:26:03 +00:00
|
|
|
//line templates/http_readers.qtpl:27
|
2020-08-31 17:52:26 +00:00
|
|
|
qw422016.N().S(naviTitle)
|
2020-11-16 15:26:03 +00:00
|
|
|
//line templates/http_readers.qtpl:27
|
2020-08-31 17:52:26 +00:00
|
|
|
qw422016.N().S(`
|
2020-10-02 15:31:59 +00:00
|
|
|
`)
|
2020-11-16 15:26:03 +00:00
|
|
|
//line templates/http_readers.qtpl:28
|
2020-08-31 17:52:26 +00:00
|
|
|
qw422016.N().S(contents)
|
2020-11-16 15:26:03 +00:00
|
|
|
//line templates/http_readers.qtpl:28
|
2020-08-31 17:52:26 +00:00
|
|
|
qw422016.N().S(`
|
2020-10-02 15:31:59 +00:00
|
|
|
</article>
|
|
|
|
<hr/>
|
|
|
|
<aside>
|
|
|
|
`)
|
2020-11-16 15:26:03 +00:00
|
|
|
//line templates/http_readers.qtpl:32
|
2020-08-31 17:52:26 +00:00
|
|
|
qw422016.N().S(tree)
|
2020-11-16 15:26:03 +00:00
|
|
|
//line templates/http_readers.qtpl:32
|
2020-08-31 17:52:26 +00:00
|
|
|
qw422016.N().S(`
|
2020-10-02 15:31:59 +00:00
|
|
|
</aside>
|
|
|
|
</main>
|
2020-08-31 17:52:26 +00:00
|
|
|
`)
|
2020-11-16 15:26:03 +00:00
|
|
|
//line templates/http_readers.qtpl:35
|
2020-08-31 17:52:26 +00:00
|
|
|
}
|
|
|
|
|
2020-11-16 15:26:03 +00:00
|
|
|
//line templates/http_readers.qtpl:35
|
|
|
|
func WriteRevisionHTML(qq422016 qtio422016.Writer, rq *http.Request, hyphaName, naviTitle, contents, tree, revHash string) {
|
|
|
|
//line templates/http_readers.qtpl:35
|
2020-08-31 17:52:26 +00:00
|
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
2020-11-16 15:26:03 +00:00
|
|
|
//line templates/http_readers.qtpl:35
|
|
|
|
StreamRevisionHTML(qw422016, rq, hyphaName, naviTitle, contents, tree, revHash)
|
|
|
|
//line templates/http_readers.qtpl:35
|
2020-08-31 17:52:26 +00:00
|
|
|
qt422016.ReleaseWriter(qw422016)
|
2020-11-16 15:26:03 +00:00
|
|
|
//line templates/http_readers.qtpl:35
|
2020-08-31 17:52:26 +00:00
|
|
|
}
|
|
|
|
|
2020-11-16 15:26:03 +00:00
|
|
|
//line templates/http_readers.qtpl:35
|
|
|
|
func RevisionHTML(rq *http.Request, hyphaName, naviTitle, contents, tree, revHash string) string {
|
|
|
|
//line templates/http_readers.qtpl:35
|
2020-08-31 17:52:26 +00:00
|
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
2020-11-16 15:26:03 +00:00
|
|
|
//line templates/http_readers.qtpl:35
|
|
|
|
WriteRevisionHTML(qb422016, rq, hyphaName, naviTitle, contents, tree, revHash)
|
|
|
|
//line templates/http_readers.qtpl:35
|
2020-08-31 17:52:26 +00:00
|
|
|
qs422016 := string(qb422016.B)
|
2020-11-16 15:26:03 +00:00
|
|
|
//line templates/http_readers.qtpl:35
|
2020-08-31 17:52:26 +00:00
|
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
2020-11-16 15:26:03 +00:00
|
|
|
//line templates/http_readers.qtpl:35
|
2020-08-31 17:52:26 +00:00
|
|
|
return qs422016
|
2020-11-16 15:26:03 +00:00
|
|
|
//line templates/http_readers.qtpl:35
|
2020-08-31 17:52:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// If `contents` == "", a helpful message is shown instead.
|
|
|
|
|
2020-11-16 15:26:03 +00:00
|
|
|
//line templates/http_readers.qtpl:38
|
|
|
|
func StreamPageHTML(qw422016 *qt422016.Writer, rq *http.Request, hyphaName, naviTitle, contents, tree string) {
|
|
|
|
//line templates/http_readers.qtpl:38
|
2020-08-31 17:52:26 +00:00
|
|
|
qw422016.N().S(`
|
2020-10-02 15:31:59 +00:00
|
|
|
<main>
|
|
|
|
`)
|
2020-11-16 15:26:03 +00:00
|
|
|
//line templates/http_readers.qtpl:40
|
|
|
|
streamnavHTML(qw422016, rq, hyphaName, "page")
|
|
|
|
//line templates/http_readers.qtpl:40
|
2020-10-02 15:31:59 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
<article>
|
|
|
|
`)
|
2020-11-16 15:26:03 +00:00
|
|
|
//line templates/http_readers.qtpl:42
|
2020-08-31 17:52:26 +00:00
|
|
|
qw422016.N().S(naviTitle)
|
2020-11-16 15:26:03 +00:00
|
|
|
//line templates/http_readers.qtpl:42
|
2020-08-31 17:52:26 +00:00
|
|
|
qw422016.N().S(`
|
2020-10-02 15:31:59 +00:00
|
|
|
`)
|
2020-11-16 15:26:03 +00:00
|
|
|
//line templates/http_readers.qtpl:43
|
2020-08-31 17:52:26 +00:00
|
|
|
if contents == "" {
|
2020-11-16 15:26:03 +00:00
|
|
|
//line templates/http_readers.qtpl:43
|
2020-08-31 17:52:26 +00:00
|
|
|
qw422016.N().S(`
|
2020-10-02 15:31:59 +00:00
|
|
|
<p>This hypha has no text. Why not <a href="/edit/`)
|
2020-11-16 15:26:03 +00:00
|
|
|
//line templates/http_readers.qtpl:44
|
2020-08-31 17:52:26 +00:00
|
|
|
qw422016.E().S(hyphaName)
|
2020-11-16 15:26:03 +00:00
|
|
|
//line templates/http_readers.qtpl:44
|
2020-08-31 17:52:26 +00:00
|
|
|
qw422016.N().S(`">create it</a>?</p>
|
2020-10-02 15:31:59 +00:00
|
|
|
`)
|
2020-11-16 15:26:03 +00:00
|
|
|
//line templates/http_readers.qtpl:45
|
2020-08-31 17:52:26 +00:00
|
|
|
} else {
|
2020-11-16 15:26:03 +00:00
|
|
|
//line templates/http_readers.qtpl:45
|
2020-08-31 17:52:26 +00:00
|
|
|
qw422016.N().S(`
|
2020-10-02 15:31:59 +00:00
|
|
|
`)
|
2020-11-16 15:26:03 +00:00
|
|
|
//line templates/http_readers.qtpl:46
|
2020-08-31 17:52:26 +00:00
|
|
|
qw422016.N().S(contents)
|
2020-11-16 15:26:03 +00:00
|
|
|
//line templates/http_readers.qtpl:46
|
2020-08-31 17:52:26 +00:00
|
|
|
qw422016.N().S(`
|
2020-10-02 15:31:59 +00:00
|
|
|
`)
|
2020-11-16 15:26:03 +00:00
|
|
|
//line templates/http_readers.qtpl:47
|
2020-08-31 17:52:26 +00:00
|
|
|
}
|
2020-11-16 15:26:03 +00:00
|
|
|
//line templates/http_readers.qtpl:47
|
2020-08-31 17:52:26 +00:00
|
|
|
qw422016.N().S(`
|
2020-10-02 15:31:59 +00:00
|
|
|
</article>
|
|
|
|
<hr/>
|
2020-11-16 15:26:03 +00:00
|
|
|
`)
|
|
|
|
//line templates/http_readers.qtpl:50
|
2020-11-18 13:27:18 +00:00
|
|
|
if u := user.FromRequest(rq).OrAnon(); !user.AuthUsed || u.Group > user.UserAnon {
|
2020-11-16 15:26:03 +00:00
|
|
|
//line templates/http_readers.qtpl:50
|
|
|
|
qw422016.N().S(`
|
2020-10-02 15:31:59 +00:00
|
|
|
<form action="/upload-binary/`)
|
2020-11-16 15:26:03 +00:00
|
|
|
//line templates/http_readers.qtpl:51
|
|
|
|
qw422016.E().S(hyphaName)
|
|
|
|
//line templates/http_readers.qtpl:51
|
|
|
|
qw422016.N().S(`"
|
2020-10-02 15:31:59 +00:00
|
|
|
method="post" enctype="multipart/form-data">
|
2020-11-18 13:27:18 +00:00
|
|
|
<label for="upload-binary__input">Upload a new attachment</label>
|
2020-10-02 15:31:59 +00:00
|
|
|
<br>
|
|
|
|
<input type="file" id="upload-binary__input" name="binary"/>
|
|
|
|
<input type="submit"/>
|
|
|
|
</form>
|
|
|
|
<hr/>
|
2020-11-16 15:26:03 +00:00
|
|
|
`)
|
|
|
|
//line templates/http_readers.qtpl:59
|
|
|
|
}
|
|
|
|
//line templates/http_readers.qtpl:59
|
|
|
|
qw422016.N().S(`
|
2020-10-02 15:31:59 +00:00
|
|
|
<aside>
|
|
|
|
`)
|
2020-11-16 15:26:03 +00:00
|
|
|
//line templates/http_readers.qtpl:61
|
2020-08-31 17:52:26 +00:00
|
|
|
qw422016.N().S(tree)
|
2020-11-16 15:26:03 +00:00
|
|
|
//line templates/http_readers.qtpl:61
|
2020-08-31 17:52:26 +00:00
|
|
|
qw422016.N().S(`
|
2020-10-02 15:31:59 +00:00
|
|
|
</aside>
|
|
|
|
</main>
|
2020-08-31 17:52:26 +00:00
|
|
|
`)
|
2020-11-16 15:26:03 +00:00
|
|
|
//line templates/http_readers.qtpl:64
|
2020-08-31 17:52:26 +00:00
|
|
|
}
|
|
|
|
|
2020-11-16 15:26:03 +00:00
|
|
|
//line templates/http_readers.qtpl:64
|
|
|
|
func WritePageHTML(qq422016 qtio422016.Writer, rq *http.Request, hyphaName, naviTitle, contents, tree string) {
|
|
|
|
//line templates/http_readers.qtpl:64
|
2020-08-31 17:52:26 +00:00
|
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
2020-11-16 15:26:03 +00:00
|
|
|
//line templates/http_readers.qtpl:64
|
|
|
|
StreamPageHTML(qw422016, rq, hyphaName, naviTitle, contents, tree)
|
|
|
|
//line templates/http_readers.qtpl:64
|
2020-08-31 17:52:26 +00:00
|
|
|
qt422016.ReleaseWriter(qw422016)
|
2020-11-16 15:26:03 +00:00
|
|
|
//line templates/http_readers.qtpl:64
|
2020-08-31 17:52:26 +00:00
|
|
|
}
|
|
|
|
|
2020-11-16 15:26:03 +00:00
|
|
|
//line templates/http_readers.qtpl:64
|
|
|
|
func PageHTML(rq *http.Request, hyphaName, naviTitle, contents, tree string) string {
|
|
|
|
//line templates/http_readers.qtpl:64
|
2020-08-31 17:52:26 +00:00
|
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
2020-11-16 15:26:03 +00:00
|
|
|
//line templates/http_readers.qtpl:64
|
|
|
|
WritePageHTML(qb422016, rq, hyphaName, naviTitle, contents, tree)
|
|
|
|
//line templates/http_readers.qtpl:64
|
2020-08-31 17:52:26 +00:00
|
|
|
qs422016 := string(qb422016.B)
|
2020-11-16 15:26:03 +00:00
|
|
|
//line templates/http_readers.qtpl:64
|
2020-08-31 17:52:26 +00:00
|
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
2020-11-16 15:26:03 +00:00
|
|
|
//line templates/http_readers.qtpl:64
|
2020-08-31 17:52:26 +00:00
|
|
|
return qs422016
|
2020-11-16 15:26:03 +00:00
|
|
|
//line templates/http_readers.qtpl:64
|
2020-08-31 17:52:26 +00:00
|
|
|
}
|