1
0
mirror of https://github.com/osmarks/mycorrhiza.git synced 2025-01-19 07:02:51 +00:00

Make history page easier to use

This commit is contained in:
bouncepaw 2020-11-29 22:06:45 +05:00
parent 05c12e8452
commit 3d20b3e77a
6 changed files with 184 additions and 140 deletions

View File

@ -7,8 +7,10 @@ import (
"regexp" "regexp"
"strconv" "strconv"
"strings" "strings"
"time"
"github.com/bouncepaw/mycorrhiza/templates" "github.com/bouncepaw/mycorrhiza/templates"
"github.com/bouncepaw/mycorrhiza/util"
) )
func RecentChanges(n int) string { func RecentChanges(n int) string {
@ -37,8 +39,8 @@ func Revisions(hyphaName string) ([]Revision, error) {
var ( var (
out, err = gitsh( out, err = gitsh(
"log", "--oneline", "--no-merges", "log", "--oneline", "--no-merges",
// Hash, Commiter email, Commiter time, Commit msg separated by tab // Hash, author email, author time, commit msg separated by tab
"--pretty=format:\"%h\t%ce\t%ct\t%s\"", "--pretty=format:\"%h\t%ae\t%at\t%s\"",
"--", hyphaName+".*", "--", hyphaName+".*",
) )
revs []Revision revs []Revision
@ -53,6 +55,58 @@ func Revisions(hyphaName string) ([]Revision, error) {
return revs, err return revs, err
} }
// HistoryWithRevisions returns an html representation of `revs` that is meant to be inserted in a history page.
func HistoryWithRevisions(hyphaName string, revs []Revision) (html string) {
var (
currentYear int
currentMonth time.Month
)
for i, rev := range revs {
if rev.Time.Month() != currentMonth || rev.Time.Year() != currentYear {
currentYear = rev.Time.Year()
currentMonth = rev.Time.Month()
if i != 0 {
html += `
</ul>
</section>`
}
html += fmt.Sprintf(`
<section class="history__month">
<a href="#%[1]d-%[2]d" class="history__month-anchor">
<h2 id="%[1]d-%[2]d" class="history__month-title">%[3]s</h2>
</a>
<ul class="history__entries">`,
currentYear, currentMonth,
strconv.Itoa(currentYear)+" "+rev.Time.Month().String())
}
html += rev.asHistoryEntry(hyphaName)
}
return html
}
func (rev *Revision) asHistoryEntry(hyphaName string) (html string) {
author := ""
if rev.Username != "anon" {
author = fmt.Sprintf(`
<span class="history-entry__author">by <a href="/page/%[1]s/%[2]s" rel="author">%[2]s</span>`, util.UserTree, rev.Username)
}
return fmt.Sprintf(`
<li class="history__entry">
<a class="history-entry" href="/rev/%[3]s/%[1]s">
<time class="history-entry__time">%[2]s</time>
<span class="history-entry__hash">%[3]s</span>
<span class="history-entry__msg">%[4]s</span>
</a>%[5]s
</li>
`, hyphaName, rev.timeHourMinute(), rev.Hash, rev.Message, author)
}
// Return time like 13:42
func (rev *Revision) timeHourMinute() string {
h, m, _ := rev.Time.Clock()
return strconv.Itoa(h) + ":" + strconv.Itoa(m)
}
// This regex is wrapped in "". For some reason, these quotes appear at some time and we have to get rid of them. // This regex is wrapped in "". For some reason, these quotes appear at some time and we have to get rid of them.
var revisionLinePattern = regexp.MustCompile("\"(.*)\t(.*)@.*\t(.*)\t(.*)\"") var revisionLinePattern = regexp.MustCompile("\"(.*)\t(.*)@.*\t(.*)\t(.*)\"")
@ -66,16 +120,6 @@ func parseRevisionLine(line string) Revision {
} }
} }
// Represent revision as a table row.
func (rev *Revision) AsHtmlTableRow(hyphaName string) string {
return fmt.Sprintf(`
<tr>
<td><time>%s</time></td>
<td><a href="/rev/%s/%s">%s</a></td>
<td>%s</td>
</tr>`, rev.TimeString(), rev.Hash, hyphaName, rev.Hash, rev.Message)
}
// See how the file with `filepath` looked at commit with `hash`. // See how the file with `filepath` looked at commit with `hash`.
func FileAtRevision(filepath, hash string) (string, error) { func FileAtRevision(filepath, hash string) (string, error) {
out, err := gitsh("show", hash+":"+filepath) out, err := gitsh("show", hash+":"+filepath)

View File

@ -57,19 +57,17 @@ func handlerRevision(w http.ResponseWriter, rq *http.Request) {
func handlerHistory(w http.ResponseWriter, rq *http.Request) { func handlerHistory(w http.ResponseWriter, rq *http.Request) {
log.Println(rq.URL) log.Println(rq.URL)
hyphaName := HyphaNameFromRq(rq, "history") hyphaName := HyphaNameFromRq(rq, "history")
var tbody string var list string
// History can be found for files that do not exist anymore. // History can be found for files that do not exist anymore.
revs, err := history.Revisions(hyphaName) revs, err := history.Revisions(hyphaName)
if err == nil { if err == nil {
for _, rev := range revs { list = history.HistoryWithRevisions(hyphaName, revs)
tbody += rev.AsHtmlTableRow(hyphaName)
}
} }
log.Println("Found", len(revs), "revisions for", hyphaName) log.Println("Found", len(revs), "revisions for", hyphaName)
util.HTTP200Page(w, util.HTTP200Page(w,
base(hyphaName, templates.HistoryHTML(rq, hyphaName, tbody))) base(hyphaName, templates.HistoryHTML(rq, hyphaName, list)))
} }
// handlerText serves raw source text of the hypha. // handlerText serves raw source text of the hypha.

View File

@ -33,7 +33,7 @@ func StreamDefaultCSS(qw422016 *qt422016.Writer) {
html {height:100%; padding:0; background-color:#ddd; html {height:100%; padding:0; background-color:#ddd;
background-image: url("data:image/svg+xml,%3Csvg width='42' height='44' viewBox='0 0 42 44' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='Page-1' fill='none' fill-rule='evenodd'%3E%3Cg id='brick-wall' fill='%23bbbbbb' fill-opacity='0.4'%3E%3Cpath d='M0 0h42v44H0V0zm1 1h40v20H1V1zM0 23h20v20H0V23zm22 0h20v20H22V23z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");} /* heropatterns.com */ background-image: url("data:image/svg+xml,%3Csvg width='42' height='44' viewBox='0 0 42 44' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='Page-1' fill='none' fill-rule='evenodd'%3E%3Cg id='brick-wall' fill='%23bbbbbb' fill-opacity='0.4'%3E%3Cpath d='M0 0h42v44H0V0zm1 1h40v20H1V1zM0 23h20v20H0V23zm22 0h20v20H22V23z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");} /* heropatterns.com */
body {height:100%; margin:0; font-size:16px; font-family:sans-serif;} body {height:100%; margin:0; font-size:16px; font-family:sans-serif;}
main {padding:1rem; background-color: white; box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.2); } main {padding:1rem; background-color: white; box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.2); border-radius: 0 0 .25rem .25rem; }
main > form {margin-bottom:1rem;} main > form {margin-bottom:1rem;}
textarea {font-size:15px;} textarea {font-size:15px;}
.edit {height:100%;} .edit {height:100%;}
@ -81,6 +81,13 @@ nav ul li {list-style-type:none;margin-right:1rem;}
.prevnext__next { float: right; text-align: right; } .prevnext__next { float: right; text-align: right; }
.page-separator { clear: both; } .page-separator { clear: both; }
.history__entries { background-color: #eee; margin: 0; padding: 0; border-radius: .25rem; }
.history__month-anchor { text-decoration: none; color: black; }
.history__entry { list-style-type: none; padding: .25rem; }
.history-entry { padding: .25rem; }
.history-entry__time { font-weight: bold; }
.history-entry__author { font-style: italic; }
`) `)
//line templates/asset.qtpl:2 //line templates/asset.qtpl:2
qw422016.N().S(` qw422016.N().S(`

View File

@ -8,7 +8,7 @@
html {height:100%; padding:0; background-color:#ddd; html {height:100%; padding:0; background-color:#ddd;
background-image: url("data:image/svg+xml,%3Csvg width='42' height='44' viewBox='0 0 42 44' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='Page-1' fill='none' fill-rule='evenodd'%3E%3Cg id='brick-wall' fill='%23bbbbbb' fill-opacity='0.4'%3E%3Cpath d='M0 0h42v44H0V0zm1 1h40v20H1V1zM0 23h20v20H0V23zm22 0h20v20H22V23z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");} /* heropatterns.com */ background-image: url("data:image/svg+xml,%3Csvg width='42' height='44' viewBox='0 0 42 44' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='Page-1' fill='none' fill-rule='evenodd'%3E%3Cg id='brick-wall' fill='%23bbbbbb' fill-opacity='0.4'%3E%3Cpath d='M0 0h42v44H0V0zm1 1h40v20H1V1zM0 23h20v20H0V23zm22 0h20v20H22V23z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");} /* heropatterns.com */
body {height:100%; margin:0; font-size:16px; font-family:sans-serif;} body {height:100%; margin:0; font-size:16px; font-family:sans-serif;}
main {padding:1rem; background-color: white; box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.2); } main {padding:1rem; background-color: white; box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.2); border-radius: 0 0 .25rem .25rem; }
main > form {margin-bottom:1rem;} main > form {margin-bottom:1rem;}
textarea {font-size:15px;} textarea {font-size:15px;}
.edit {height:100%;} .edit {height:100%;}
@ -56,3 +56,10 @@ nav ul li {list-style-type:none;margin-right:1rem;}
.prevnext__next { float: right; text-align: right; } .prevnext__next { float: right; text-align: right; }
.page-separator { clear: both; } .page-separator { clear: both; }
.history__entries { background-color: #eee; margin: 0; padding: 0; border-radius: .25rem; }
.history__month-anchor { text-decoration: none; color: black; }
.history__entry { list-style-type: none; padding: .25rem; }
.history-entry { padding: .25rem; }
.history-entry__time { font-weight: bold; }
.history-entry__author { font-style: italic; }

View File

@ -2,21 +2,13 @@
{% import "path" %} {% import "path" %}
{% import "github.com/bouncepaw/mycorrhiza/user" %} {% import "github.com/bouncepaw/mycorrhiza/user" %}
{% func HistoryHTML(rq *http.Request, hyphaName, tbody string) %} {% func HistoryHTML(rq *http.Request, hyphaName, list string) %}
<main> <main>
{%= navHTML(rq, hyphaName, "history") %} {%= navHTML(rq, hyphaName, "history") %}
<table> <article class="history">
<thead> <h1>History of {%s hyphaName %}</h1>
<tr> {%s= list %}
<th>Time</th> </article>
<th>Hash</th>
<th>Message</th>
</tr>
</thead>
<tbody>
{%s= tbody %}
</tbody>
</table>
</main> </main>
{% endfunc %} {% endfunc %}

View File

@ -27,7 +27,7 @@ var (
) )
//line templates/http_readers.qtpl:5 //line templates/http_readers.qtpl:5
func StreamHistoryHTML(qw422016 *qt422016.Writer, rq *http.Request, hyphaName, tbody string) { func StreamHistoryHTML(qw422016 *qt422016.Writer, rq *http.Request, hyphaName, list string) {
//line templates/http_readers.qtpl:5 //line templates/http_readers.qtpl:5
qw422016.N().S(` qw422016.N().S(`
<main> <main>
@ -36,209 +36,205 @@ func StreamHistoryHTML(qw422016 *qt422016.Writer, rq *http.Request, hyphaName, t
streamnavHTML(qw422016, rq, hyphaName, "history") streamnavHTML(qw422016, rq, hyphaName, "history")
//line templates/http_readers.qtpl:7 //line templates/http_readers.qtpl:7
qw422016.N().S(` qw422016.N().S(`
<table> <article class="history">
<thead> <h1>History of `)
<tr> //line templates/http_readers.qtpl:9
<th>Time</th> qw422016.E().S(hyphaName)
<th>Hash</th> //line templates/http_readers.qtpl:9
<th>Message</th> qw422016.N().S(`</h1>
</tr>
</thead>
<tbody>
`) `)
//line templates/http_readers.qtpl:17 //line templates/http_readers.qtpl:10
qw422016.N().S(tbody) qw422016.N().S(list)
//line templates/http_readers.qtpl:17 //line templates/http_readers.qtpl:10
qw422016.N().S(` qw422016.N().S(`
</tbody> </article>
</table>
</main> </main>
`) `)
//line templates/http_readers.qtpl:21 //line templates/http_readers.qtpl:13
} }
//line templates/http_readers.qtpl:21 //line templates/http_readers.qtpl:13
func WriteHistoryHTML(qq422016 qtio422016.Writer, rq *http.Request, hyphaName, tbody string) { func WriteHistoryHTML(qq422016 qtio422016.Writer, rq *http.Request, hyphaName, list string) {
//line templates/http_readers.qtpl:21 //line templates/http_readers.qtpl:13
qw422016 := qt422016.AcquireWriter(qq422016) qw422016 := qt422016.AcquireWriter(qq422016)
//line templates/http_readers.qtpl:21 //line templates/http_readers.qtpl:13
StreamHistoryHTML(qw422016, rq, hyphaName, tbody) StreamHistoryHTML(qw422016, rq, hyphaName, list)
//line templates/http_readers.qtpl:21 //line templates/http_readers.qtpl:13
qt422016.ReleaseWriter(qw422016) qt422016.ReleaseWriter(qw422016)
//line templates/http_readers.qtpl:21 //line templates/http_readers.qtpl:13
} }
//line templates/http_readers.qtpl:21 //line templates/http_readers.qtpl:13
func HistoryHTML(rq *http.Request, hyphaName, tbody string) string { func HistoryHTML(rq *http.Request, hyphaName, list string) string {
//line templates/http_readers.qtpl:21 //line templates/http_readers.qtpl:13
qb422016 := qt422016.AcquireByteBuffer() qb422016 := qt422016.AcquireByteBuffer()
//line templates/http_readers.qtpl:21 //line templates/http_readers.qtpl:13
WriteHistoryHTML(qb422016, rq, hyphaName, tbody) WriteHistoryHTML(qb422016, rq, hyphaName, list)
//line templates/http_readers.qtpl:21 //line templates/http_readers.qtpl:13
qs422016 := string(qb422016.B) qs422016 := string(qb422016.B)
//line templates/http_readers.qtpl:21 //line templates/http_readers.qtpl:13
qt422016.ReleaseByteBuffer(qb422016) qt422016.ReleaseByteBuffer(qb422016)
//line templates/http_readers.qtpl:21 //line templates/http_readers.qtpl:13
return qs422016 return qs422016
//line templates/http_readers.qtpl:21 //line templates/http_readers.qtpl:13
} }
//line templates/http_readers.qtpl:23 //line templates/http_readers.qtpl:15
func StreamRevisionHTML(qw422016 *qt422016.Writer, rq *http.Request, hyphaName, naviTitle, contents, tree, revHash string) { func StreamRevisionHTML(qw422016 *qt422016.Writer, rq *http.Request, hyphaName, naviTitle, contents, tree, revHash string) {
//line templates/http_readers.qtpl:23 //line templates/http_readers.qtpl:15
qw422016.N().S(` qw422016.N().S(`
<main> <main>
`) `)
//line templates/http_readers.qtpl:25 //line templates/http_readers.qtpl:17
streamnavHTML(qw422016, rq, hyphaName, "revision", revHash) streamnavHTML(qw422016, rq, hyphaName, "revision", revHash)
//line templates/http_readers.qtpl:25 //line templates/http_readers.qtpl:17
qw422016.N().S(` qw422016.N().S(`
<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 templates/http_readers.qtpl:28 //line templates/http_readers.qtpl:20
qw422016.N().S(naviTitle) qw422016.N().S(naviTitle)
//line templates/http_readers.qtpl:28 //line templates/http_readers.qtpl:20
qw422016.N().S(` qw422016.N().S(`
`) `)
//line templates/http_readers.qtpl:29 //line templates/http_readers.qtpl:21
qw422016.N().S(contents) qw422016.N().S(contents)
//line templates/http_readers.qtpl:29 //line templates/http_readers.qtpl:21
qw422016.N().S(` qw422016.N().S(`
</article> </article>
<hr/> <hr/>
<aside> <aside>
`) `)
//line templates/http_readers.qtpl:33 //line templates/http_readers.qtpl:25
qw422016.N().S(tree) qw422016.N().S(tree)
//line templates/http_readers.qtpl:33 //line templates/http_readers.qtpl:25
qw422016.N().S(` qw422016.N().S(`
</aside> </aside>
</main> </main>
`) `)
//line templates/http_readers.qtpl:36 //line templates/http_readers.qtpl:28
} }
//line templates/http_readers.qtpl:36 //line templates/http_readers.qtpl:28
func WriteRevisionHTML(qq422016 qtio422016.Writer, rq *http.Request, hyphaName, naviTitle, contents, tree, revHash string) { func WriteRevisionHTML(qq422016 qtio422016.Writer, rq *http.Request, hyphaName, naviTitle, contents, tree, revHash string) {
//line templates/http_readers.qtpl:36 //line templates/http_readers.qtpl:28
qw422016 := qt422016.AcquireWriter(qq422016) qw422016 := qt422016.AcquireWriter(qq422016)
//line templates/http_readers.qtpl:36 //line templates/http_readers.qtpl:28
StreamRevisionHTML(qw422016, rq, hyphaName, naviTitle, contents, tree, revHash) StreamRevisionHTML(qw422016, rq, hyphaName, naviTitle, contents, tree, revHash)
//line templates/http_readers.qtpl:36 //line templates/http_readers.qtpl:28
qt422016.ReleaseWriter(qw422016) qt422016.ReleaseWriter(qw422016)
//line templates/http_readers.qtpl:36 //line templates/http_readers.qtpl:28
} }
//line templates/http_readers.qtpl:36 //line templates/http_readers.qtpl:28
func RevisionHTML(rq *http.Request, hyphaName, naviTitle, contents, tree, revHash string) string { func RevisionHTML(rq *http.Request, hyphaName, naviTitle, contents, tree, revHash string) string {
//line templates/http_readers.qtpl:36 //line templates/http_readers.qtpl:28
qb422016 := qt422016.AcquireByteBuffer() qb422016 := qt422016.AcquireByteBuffer()
//line templates/http_readers.qtpl:36 //line templates/http_readers.qtpl:28
WriteRevisionHTML(qb422016, rq, hyphaName, naviTitle, contents, tree, revHash) WriteRevisionHTML(qb422016, rq, hyphaName, naviTitle, contents, tree, revHash)
//line templates/http_readers.qtpl:36 //line templates/http_readers.qtpl:28
qs422016 := string(qb422016.B) qs422016 := string(qb422016.B)
//line templates/http_readers.qtpl:36 //line templates/http_readers.qtpl:28
qt422016.ReleaseByteBuffer(qb422016) qt422016.ReleaseByteBuffer(qb422016)
//line templates/http_readers.qtpl:36 //line templates/http_readers.qtpl:28
return qs422016 return qs422016
//line templates/http_readers.qtpl:36 //line templates/http_readers.qtpl:28
} }
// If `contents` == "", a helpful message is shown instead. // If `contents` == "", a helpful message is shown instead.
//line templates/http_readers.qtpl:39 //line templates/http_readers.qtpl:31
func StreamPageHTML(qw422016 *qt422016.Writer, rq *http.Request, hyphaName, naviTitle, contents, tree, prevHyphaName, nextHyphaName string) { func StreamPageHTML(qw422016 *qt422016.Writer, rq *http.Request, hyphaName, naviTitle, contents, tree, prevHyphaName, nextHyphaName string) {
//line templates/http_readers.qtpl:39 //line templates/http_readers.qtpl:31
qw422016.N().S(` qw422016.N().S(`
<main> <main>
`) `)
//line templates/http_readers.qtpl:41 //line templates/http_readers.qtpl:33
streamnavHTML(qw422016, rq, hyphaName, "page") streamnavHTML(qw422016, rq, hyphaName, "page")
//line templates/http_readers.qtpl:41 //line templates/http_readers.qtpl:33
qw422016.N().S(` qw422016.N().S(`
<article> <article>
`) `)
//line templates/http_readers.qtpl:43 //line templates/http_readers.qtpl:35
qw422016.N().S(naviTitle) qw422016.N().S(naviTitle)
//line templates/http_readers.qtpl:43 //line templates/http_readers.qtpl:35
qw422016.N().S(` qw422016.N().S(`
`) `)
//line templates/http_readers.qtpl:44 //line templates/http_readers.qtpl:36
if contents == "" { if contents == "" {
//line templates/http_readers.qtpl:44 //line templates/http_readers.qtpl:36
qw422016.N().S(` qw422016.N().S(`
<p>This hypha has no text. Why not <a href="/edit/`) <p>This hypha has no text. Why not <a href="/edit/`)
//line templates/http_readers.qtpl:45 //line templates/http_readers.qtpl:37
qw422016.E().S(hyphaName) qw422016.E().S(hyphaName)
//line templates/http_readers.qtpl:45 //line templates/http_readers.qtpl:37
qw422016.N().S(`">create it</a>?</p> qw422016.N().S(`">create it</a>?</p>
`) `)
//line templates/http_readers.qtpl:46 //line templates/http_readers.qtpl:38
} else { } else {
//line templates/http_readers.qtpl:46 //line templates/http_readers.qtpl:38
qw422016.N().S(` qw422016.N().S(`
`) `)
//line templates/http_readers.qtpl:47 //line templates/http_readers.qtpl:39
qw422016.N().S(contents) qw422016.N().S(contents)
//line templates/http_readers.qtpl:47 //line templates/http_readers.qtpl:39
qw422016.N().S(` qw422016.N().S(`
`) `)
//line templates/http_readers.qtpl:48 //line templates/http_readers.qtpl:40
} }
//line templates/http_readers.qtpl:48 //line templates/http_readers.qtpl:40
qw422016.N().S(` qw422016.N().S(`
</article> </article>
<section class="prevnext"> <section class="prevnext">
`) `)
//line templates/http_readers.qtpl:51 //line templates/http_readers.qtpl:43
if prevHyphaName != "" { if prevHyphaName != "" {
//line templates/http_readers.qtpl:51 //line templates/http_readers.qtpl:43
qw422016.N().S(` qw422016.N().S(`
<a class="prevnext__el prevnext__prev" href="/page/`) <a class="prevnext__el prevnext__prev" href="/page/`)
//line templates/http_readers.qtpl:52 //line templates/http_readers.qtpl:44
qw422016.E().S(prevHyphaName) qw422016.E().S(prevHyphaName)
//line templates/http_readers.qtpl:52 //line templates/http_readers.qtpl:44
qw422016.N().S(`">← `) qw422016.N().S(`">← `)
//line templates/http_readers.qtpl:52 //line templates/http_readers.qtpl:44
qw422016.E().S(path.Base(prevHyphaName)) qw422016.E().S(path.Base(prevHyphaName))
//line templates/http_readers.qtpl:52 //line templates/http_readers.qtpl:44
qw422016.N().S(`</a> qw422016.N().S(`</a>
`) `)
//line templates/http_readers.qtpl:53 //line templates/http_readers.qtpl:45
} }
//line templates/http_readers.qtpl:53 //line templates/http_readers.qtpl:45
qw422016.N().S(` qw422016.N().S(`
`) `)
//line templates/http_readers.qtpl:54 //line templates/http_readers.qtpl:46
if nextHyphaName != "" { if nextHyphaName != "" {
//line templates/http_readers.qtpl:54 //line templates/http_readers.qtpl:46
qw422016.N().S(` qw422016.N().S(`
<a class="prevnext__el prevnext__next" href="/page/`) <a class="prevnext__el prevnext__next" href="/page/`)
//line templates/http_readers.qtpl:55 //line templates/http_readers.qtpl:47
qw422016.E().S(nextHyphaName) qw422016.E().S(nextHyphaName)
//line templates/http_readers.qtpl:55 //line templates/http_readers.qtpl:47
qw422016.N().S(`">`) qw422016.N().S(`">`)
//line templates/http_readers.qtpl:55 //line templates/http_readers.qtpl:47
qw422016.E().S(path.Base(nextHyphaName)) qw422016.E().S(path.Base(nextHyphaName))
//line templates/http_readers.qtpl:55 //line templates/http_readers.qtpl:47
qw422016.N().S(` </a> qw422016.N().S(` </a>
`) `)
//line templates/http_readers.qtpl:56 //line templates/http_readers.qtpl:48
} }
//line templates/http_readers.qtpl:56 //line templates/http_readers.qtpl:48
qw422016.N().S(` qw422016.N().S(`
</section> </section>
<hr class="page-separator"/> <hr class="page-separator"/>
`) `)
//line templates/http_readers.qtpl:59 //line templates/http_readers.qtpl:51
if u := user.FromRequest(rq).OrAnon(); !user.AuthUsed || u.Group > user.UserAnon { if u := user.FromRequest(rq).OrAnon(); !user.AuthUsed || u.Group > user.UserAnon {
//line templates/http_readers.qtpl:59 //line templates/http_readers.qtpl:51
qw422016.N().S(` qw422016.N().S(`
<form action="/upload-binary/`) <form action="/upload-binary/`)
//line templates/http_readers.qtpl:60 //line templates/http_readers.qtpl:52
qw422016.E().S(hyphaName) qw422016.E().S(hyphaName)
//line templates/http_readers.qtpl:60 //line templates/http_readers.qtpl:52
qw422016.N().S(`" qw422016.N().S(`"
method="post" enctype="multipart/form-data"> method="post" enctype="multipart/form-data">
<label for="upload-binary__input">Upload a new attachment</label> <label for="upload-binary__input">Upload a new attachment</label>
@ -248,44 +244,44 @@ func StreamPageHTML(qw422016 *qt422016.Writer, rq *http.Request, hyphaName, navi
</form> </form>
<hr/> <hr/>
`) `)
//line templates/http_readers.qtpl:68 //line templates/http_readers.qtpl:60
} }
//line templates/http_readers.qtpl:68 //line templates/http_readers.qtpl:60
qw422016.N().S(` qw422016.N().S(`
<aside> <aside>
`) `)
//line templates/http_readers.qtpl:70 //line templates/http_readers.qtpl:62
qw422016.N().S(tree) qw422016.N().S(tree)
//line templates/http_readers.qtpl:70 //line templates/http_readers.qtpl:62
qw422016.N().S(` qw422016.N().S(`
</aside> </aside>
</main> </main>
`) `)
//line templates/http_readers.qtpl:73 //line templates/http_readers.qtpl:65
} }
//line templates/http_readers.qtpl:73 //line templates/http_readers.qtpl:65
func WritePageHTML(qq422016 qtio422016.Writer, rq *http.Request, hyphaName, naviTitle, contents, tree, prevHyphaName, nextHyphaName string) { func WritePageHTML(qq422016 qtio422016.Writer, rq *http.Request, hyphaName, naviTitle, contents, tree, prevHyphaName, nextHyphaName string) {
//line templates/http_readers.qtpl:73 //line templates/http_readers.qtpl:65
qw422016 := qt422016.AcquireWriter(qq422016) qw422016 := qt422016.AcquireWriter(qq422016)
//line templates/http_readers.qtpl:73 //line templates/http_readers.qtpl:65
StreamPageHTML(qw422016, rq, hyphaName, naviTitle, contents, tree, prevHyphaName, nextHyphaName) StreamPageHTML(qw422016, rq, hyphaName, naviTitle, contents, tree, prevHyphaName, nextHyphaName)
//line templates/http_readers.qtpl:73 //line templates/http_readers.qtpl:65
qt422016.ReleaseWriter(qw422016) qt422016.ReleaseWriter(qw422016)
//line templates/http_readers.qtpl:73 //line templates/http_readers.qtpl:65
} }
//line templates/http_readers.qtpl:73 //line templates/http_readers.qtpl:65
func PageHTML(rq *http.Request, hyphaName, naviTitle, contents, tree, prevHyphaName, nextHyphaName string) string { func PageHTML(rq *http.Request, hyphaName, naviTitle, contents, tree, prevHyphaName, nextHyphaName string) string {
//line templates/http_readers.qtpl:73 //line templates/http_readers.qtpl:65
qb422016 := qt422016.AcquireByteBuffer() qb422016 := qt422016.AcquireByteBuffer()
//line templates/http_readers.qtpl:73 //line templates/http_readers.qtpl:65
WritePageHTML(qb422016, rq, hyphaName, naviTitle, contents, tree, prevHyphaName, nextHyphaName) WritePageHTML(qb422016, rq, hyphaName, naviTitle, contents, tree, prevHyphaName, nextHyphaName)
//line templates/http_readers.qtpl:73 //line templates/http_readers.qtpl:65
qs422016 := string(qb422016.B) qs422016 := string(qb422016.B)
//line templates/http_readers.qtpl:73 //line templates/http_readers.qtpl:65
qt422016.ReleaseByteBuffer(qb422016) qt422016.ReleaseByteBuffer(qb422016)
//line templates/http_readers.qtpl:73 //line templates/http_readers.qtpl:65
return qs422016 return qs422016
//line templates/http_readers.qtpl:73 //line templates/http_readers.qtpl:65
} }