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:
parent
05c12e8452
commit
3d20b3e77a
@ -7,8 +7,10 @@ import (
|
||||
"regexp"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/bouncepaw/mycorrhiza/templates"
|
||||
"github.com/bouncepaw/mycorrhiza/util"
|
||||
)
|
||||
|
||||
func RecentChanges(n int) string {
|
||||
@ -37,8 +39,8 @@ func Revisions(hyphaName string) ([]Revision, error) {
|
||||
var (
|
||||
out, err = gitsh(
|
||||
"log", "--oneline", "--no-merges",
|
||||
// Hash, Commiter email, Commiter time, Commit msg separated by tab
|
||||
"--pretty=format:\"%h\t%ce\t%ct\t%s\"",
|
||||
// Hash, author email, author time, commit msg separated by tab
|
||||
"--pretty=format:\"%h\t%ae\t%at\t%s\"",
|
||||
"--", hyphaName+".*",
|
||||
)
|
||||
revs []Revision
|
||||
@ -53,6 +55,58 @@ func Revisions(hyphaName string) ([]Revision, error) {
|
||||
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.
|
||||
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`.
|
||||
func FileAtRevision(filepath, hash string) (string, error) {
|
||||
out, err := gitsh("show", hash+":"+filepath)
|
||||
|
@ -57,19 +57,17 @@ func handlerRevision(w http.ResponseWriter, rq *http.Request) {
|
||||
func handlerHistory(w http.ResponseWriter, rq *http.Request) {
|
||||
log.Println(rq.URL)
|
||||
hyphaName := HyphaNameFromRq(rq, "history")
|
||||
var tbody string
|
||||
var list string
|
||||
|
||||
// History can be found for files that do not exist anymore.
|
||||
revs, err := history.Revisions(hyphaName)
|
||||
if err == nil {
|
||||
for _, rev := range revs {
|
||||
tbody += rev.AsHtmlTableRow(hyphaName)
|
||||
}
|
||||
list = history.HistoryWithRevisions(hyphaName, revs)
|
||||
}
|
||||
log.Println("Found", len(revs), "revisions for", hyphaName)
|
||||
|
||||
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.
|
||||
|
@ -33,7 +33,7 @@ func StreamDefaultCSS(qw422016 *qt422016.Writer) {
|
||||
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 */
|
||||
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;}
|
||||
textarea {font-size:15px;}
|
||||
.edit {height:100%;}
|
||||
@ -81,6 +81,13 @@ nav ul li {list-style-type:none;margin-right:1rem;}
|
||||
.prevnext__next { float: right; text-align: right; }
|
||||
|
||||
.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
|
||||
qw422016.N().S(`
|
||||
|
@ -8,7 +8,7 @@
|
||||
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 */
|
||||
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;}
|
||||
textarea {font-size:15px;}
|
||||
.edit {height:100%;}
|
||||
@ -56,3 +56,10 @@ nav ul li {list-style-type:none;margin-right:1rem;}
|
||||
.prevnext__next { float: right; text-align: right; }
|
||||
|
||||
.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; }
|
||||
|
||||
|
@ -2,21 +2,13 @@
|
||||
{% import "path" %}
|
||||
{% import "github.com/bouncepaw/mycorrhiza/user" %}
|
||||
|
||||
{% func HistoryHTML(rq *http.Request, hyphaName, tbody string) %}
|
||||
{% func HistoryHTML(rq *http.Request, hyphaName, list string) %}
|
||||
<main>
|
||||
{%= navHTML(rq, hyphaName, "history") %}
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Time</th>
|
||||
<th>Hash</th>
|
||||
<th>Message</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{%s= tbody %}
|
||||
</tbody>
|
||||
</table>
|
||||
<article class="history">
|
||||
<h1>History of {%s hyphaName %}</h1>
|
||||
{%s= list %}
|
||||
</article>
|
||||
</main>
|
||||
{% endfunc %}
|
||||
|
||||
|
@ -27,7 +27,7 @@ var (
|
||||
)
|
||||
|
||||
//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
|
||||
qw422016.N().S(`
|
||||
<main>
|
||||
@ -36,209 +36,205 @@ func StreamHistoryHTML(qw422016 *qt422016.Writer, rq *http.Request, hyphaName, t
|
||||
streamnavHTML(qw422016, rq, hyphaName, "history")
|
||||
//line templates/http_readers.qtpl:7
|
||||
qw422016.N().S(`
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Time</th>
|
||||
<th>Hash</th>
|
||||
<th>Message</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<article class="history">
|
||||
<h1>History of `)
|
||||
//line templates/http_readers.qtpl:9
|
||||
qw422016.E().S(hyphaName)
|
||||
//line templates/http_readers.qtpl:9
|
||||
qw422016.N().S(`</h1>
|
||||
`)
|
||||
//line templates/http_readers.qtpl:17
|
||||
qw422016.N().S(tbody)
|
||||
//line templates/http_readers.qtpl:17
|
||||
//line templates/http_readers.qtpl:10
|
||||
qw422016.N().S(list)
|
||||
//line templates/http_readers.qtpl:10
|
||||
qw422016.N().S(`
|
||||
</tbody>
|
||||
</table>
|
||||
</article>
|
||||
</main>
|
||||
`)
|
||||
//line templates/http_readers.qtpl:21
|
||||
//line templates/http_readers.qtpl:13
|
||||
}
|
||||
|
||||
//line templates/http_readers.qtpl:21
|
||||
func WriteHistoryHTML(qq422016 qtio422016.Writer, rq *http.Request, hyphaName, tbody string) {
|
||||
//line templates/http_readers.qtpl:21
|
||||
//line templates/http_readers.qtpl:13
|
||||
func WriteHistoryHTML(qq422016 qtio422016.Writer, rq *http.Request, hyphaName, list string) {
|
||||
//line templates/http_readers.qtpl:13
|
||||
qw422016 := qt422016.AcquireWriter(qq422016)
|
||||
//line templates/http_readers.qtpl:21
|
||||
StreamHistoryHTML(qw422016, rq, hyphaName, tbody)
|
||||
//line templates/http_readers.qtpl:21
|
||||
//line templates/http_readers.qtpl:13
|
||||
StreamHistoryHTML(qw422016, rq, hyphaName, list)
|
||||
//line templates/http_readers.qtpl:13
|
||||
qt422016.ReleaseWriter(qw422016)
|
||||
//line templates/http_readers.qtpl:21
|
||||
//line templates/http_readers.qtpl:13
|
||||
}
|
||||
|
||||
//line templates/http_readers.qtpl:21
|
||||
func HistoryHTML(rq *http.Request, hyphaName, tbody string) string {
|
||||
//line templates/http_readers.qtpl:21
|
||||
//line templates/http_readers.qtpl:13
|
||||
func HistoryHTML(rq *http.Request, hyphaName, list string) string {
|
||||
//line templates/http_readers.qtpl:13
|
||||
qb422016 := qt422016.AcquireByteBuffer()
|
||||
//line templates/http_readers.qtpl:21
|
||||
WriteHistoryHTML(qb422016, rq, hyphaName, tbody)
|
||||
//line templates/http_readers.qtpl:21
|
||||
//line templates/http_readers.qtpl:13
|
||||
WriteHistoryHTML(qb422016, rq, hyphaName, list)
|
||||
//line templates/http_readers.qtpl:13
|
||||
qs422016 := string(qb422016.B)
|
||||
//line templates/http_readers.qtpl:21
|
||||
//line templates/http_readers.qtpl:13
|
||||
qt422016.ReleaseByteBuffer(qb422016)
|
||||
//line templates/http_readers.qtpl:21
|
||||
//line templates/http_readers.qtpl:13
|
||||
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) {
|
||||
//line templates/http_readers.qtpl:23
|
||||
//line templates/http_readers.qtpl:15
|
||||
qw422016.N().S(`
|
||||
<main>
|
||||
`)
|
||||
//line templates/http_readers.qtpl:25
|
||||
//line templates/http_readers.qtpl:17
|
||||
streamnavHTML(qw422016, rq, hyphaName, "revision", revHash)
|
||||
//line templates/http_readers.qtpl:25
|
||||
//line templates/http_readers.qtpl:17
|
||||
qw422016.N().S(`
|
||||
<article>
|
||||
<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)
|
||||
//line templates/http_readers.qtpl:28
|
||||
//line templates/http_readers.qtpl:20
|
||||
qw422016.N().S(`
|
||||
`)
|
||||
//line templates/http_readers.qtpl:29
|
||||
//line templates/http_readers.qtpl:21
|
||||
qw422016.N().S(contents)
|
||||
//line templates/http_readers.qtpl:29
|
||||
//line templates/http_readers.qtpl:21
|
||||
qw422016.N().S(`
|
||||
</article>
|
||||
<hr/>
|
||||
<aside>
|
||||
`)
|
||||
//line templates/http_readers.qtpl:33
|
||||
//line templates/http_readers.qtpl:25
|
||||
qw422016.N().S(tree)
|
||||
//line templates/http_readers.qtpl:33
|
||||
//line templates/http_readers.qtpl:25
|
||||
qw422016.N().S(`
|
||||
</aside>
|
||||
</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) {
|
||||
//line templates/http_readers.qtpl:36
|
||||
//line templates/http_readers.qtpl:28
|
||||
qw422016 := qt422016.AcquireWriter(qq422016)
|
||||
//line templates/http_readers.qtpl:36
|
||||
//line templates/http_readers.qtpl:28
|
||||
StreamRevisionHTML(qw422016, rq, hyphaName, naviTitle, contents, tree, revHash)
|
||||
//line templates/http_readers.qtpl:36
|
||||
//line templates/http_readers.qtpl:28
|
||||
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 {
|
||||
//line templates/http_readers.qtpl:36
|
||||
//line templates/http_readers.qtpl:28
|
||||
qb422016 := qt422016.AcquireByteBuffer()
|
||||
//line templates/http_readers.qtpl:36
|
||||
//line templates/http_readers.qtpl:28
|
||||
WriteRevisionHTML(qb422016, rq, hyphaName, naviTitle, contents, tree, revHash)
|
||||
//line templates/http_readers.qtpl:36
|
||||
//line templates/http_readers.qtpl:28
|
||||
qs422016 := string(qb422016.B)
|
||||
//line templates/http_readers.qtpl:36
|
||||
//line templates/http_readers.qtpl:28
|
||||
qt422016.ReleaseByteBuffer(qb422016)
|
||||
//line templates/http_readers.qtpl:36
|
||||
//line templates/http_readers.qtpl:28
|
||||
return qs422016
|
||||
//line templates/http_readers.qtpl:36
|
||||
//line templates/http_readers.qtpl:28
|
||||
}
|
||||
|
||||
// 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) {
|
||||
//line templates/http_readers.qtpl:39
|
||||
//line templates/http_readers.qtpl:31
|
||||
qw422016.N().S(`
|
||||
<main>
|
||||
`)
|
||||
//line templates/http_readers.qtpl:41
|
||||
//line templates/http_readers.qtpl:33
|
||||
streamnavHTML(qw422016, rq, hyphaName, "page")
|
||||
//line templates/http_readers.qtpl:41
|
||||
//line templates/http_readers.qtpl:33
|
||||
qw422016.N().S(`
|
||||
<article>
|
||||
`)
|
||||
//line templates/http_readers.qtpl:43
|
||||
//line templates/http_readers.qtpl:35
|
||||
qw422016.N().S(naviTitle)
|
||||
//line templates/http_readers.qtpl:43
|
||||
//line templates/http_readers.qtpl:35
|
||||
qw422016.N().S(`
|
||||
`)
|
||||
//line templates/http_readers.qtpl:44
|
||||
//line templates/http_readers.qtpl:36
|
||||
if contents == "" {
|
||||
//line templates/http_readers.qtpl:44
|
||||
//line templates/http_readers.qtpl:36
|
||||
qw422016.N().S(`
|
||||
<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)
|
||||
//line templates/http_readers.qtpl:45
|
||||
//line templates/http_readers.qtpl:37
|
||||
qw422016.N().S(`">create it</a>?</p>
|
||||
`)
|
||||
//line templates/http_readers.qtpl:46
|
||||
//line templates/http_readers.qtpl:38
|
||||
} else {
|
||||
//line templates/http_readers.qtpl:46
|
||||
//line templates/http_readers.qtpl:38
|
||||
qw422016.N().S(`
|
||||
`)
|
||||
//line templates/http_readers.qtpl:47
|
||||
//line templates/http_readers.qtpl:39
|
||||
qw422016.N().S(contents)
|
||||
//line templates/http_readers.qtpl:47
|
||||
//line templates/http_readers.qtpl:39
|
||||
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(`
|
||||
</article>
|
||||
<section class="prevnext">
|
||||
`)
|
||||
//line templates/http_readers.qtpl:51
|
||||
//line templates/http_readers.qtpl:43
|
||||
if prevHyphaName != "" {
|
||||
//line templates/http_readers.qtpl:51
|
||||
//line templates/http_readers.qtpl:43
|
||||
qw422016.N().S(`
|
||||
<a class="prevnext__el prevnext__prev" href="/page/`)
|
||||
//line templates/http_readers.qtpl:52
|
||||
//line templates/http_readers.qtpl:44
|
||||
qw422016.E().S(prevHyphaName)
|
||||
//line templates/http_readers.qtpl:52
|
||||
//line templates/http_readers.qtpl:44
|
||||
qw422016.N().S(`">← `)
|
||||
//line templates/http_readers.qtpl:52
|
||||
//line templates/http_readers.qtpl:44
|
||||
qw422016.E().S(path.Base(prevHyphaName))
|
||||
//line templates/http_readers.qtpl:52
|
||||
//line templates/http_readers.qtpl:44
|
||||
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(`
|
||||
`)
|
||||
//line templates/http_readers.qtpl:54
|
||||
//line templates/http_readers.qtpl:46
|
||||
if nextHyphaName != "" {
|
||||
//line templates/http_readers.qtpl:54
|
||||
//line templates/http_readers.qtpl:46
|
||||
qw422016.N().S(`
|
||||
<a class="prevnext__el prevnext__next" href="/page/`)
|
||||
//line templates/http_readers.qtpl:55
|
||||
//line templates/http_readers.qtpl:47
|
||||
qw422016.E().S(nextHyphaName)
|
||||
//line templates/http_readers.qtpl:55
|
||||
//line templates/http_readers.qtpl:47
|
||||
qw422016.N().S(`">`)
|
||||
//line templates/http_readers.qtpl:55
|
||||
//line templates/http_readers.qtpl:47
|
||||
qw422016.E().S(path.Base(nextHyphaName))
|
||||
//line templates/http_readers.qtpl:55
|
||||
//line templates/http_readers.qtpl:47
|
||||
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(`
|
||||
</section>
|
||||
<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 {
|
||||
//line templates/http_readers.qtpl:59
|
||||
//line templates/http_readers.qtpl:51
|
||||
qw422016.N().S(`
|
||||
<form action="/upload-binary/`)
|
||||
//line templates/http_readers.qtpl:60
|
||||
//line templates/http_readers.qtpl:52
|
||||
qw422016.E().S(hyphaName)
|
||||
//line templates/http_readers.qtpl:60
|
||||
//line templates/http_readers.qtpl:52
|
||||
qw422016.N().S(`"
|
||||
method="post" enctype="multipart/form-data">
|
||||
<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>
|
||||
<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(`
|
||||
<aside>
|
||||
`)
|
||||
//line templates/http_readers.qtpl:70
|
||||
//line templates/http_readers.qtpl:62
|
||||
qw422016.N().S(tree)
|
||||
//line templates/http_readers.qtpl:70
|
||||
//line templates/http_readers.qtpl:62
|
||||
qw422016.N().S(`
|
||||
</aside>
|
||||
</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) {
|
||||
//line templates/http_readers.qtpl:73
|
||||
//line templates/http_readers.qtpl:65
|
||||
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)
|
||||
//line templates/http_readers.qtpl:73
|
||||
//line templates/http_readers.qtpl:65
|
||||
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 {
|
||||
//line templates/http_readers.qtpl:73
|
||||
//line templates/http_readers.qtpl:65
|
||||
qb422016 := qt422016.AcquireByteBuffer()
|
||||
//line templates/http_readers.qtpl:73
|
||||
//line templates/http_readers.qtpl:65
|
||||
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)
|
||||
//line templates/http_readers.qtpl:73
|
||||
//line templates/http_readers.qtpl:65
|
||||
qt422016.ReleaseByteBuffer(qb422016)
|
||||
//line templates/http_readers.qtpl:73
|
||||
//line templates/http_readers.qtpl:65
|
||||
return qs422016
|
||||
//line templates/http_readers.qtpl:73
|
||||
//line templates/http_readers.qtpl:65
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user