diff --git a/http_mutators.go b/http_mutators.go index 8deaaac..59f464b 100644 --- a/http_mutators.go +++ b/http_mutators.go @@ -31,7 +31,7 @@ func handlerRenameAsk(w http.ResponseWriter, rq *http.Request) { log.Println("Rejected", rq.URL) return } - util.HTTP200Page(w, base("Rename "+hyphaName+"?", templates.RenameAskHTML(hyphaName, isOld))) + util.HTTP200Page(w, base("Rename "+hyphaName+"?", templates.RenameAskHTML(rq, hyphaName, isOld))) } func handlerRenameConfirm(w http.ResponseWriter, rq *http.Request) { @@ -87,7 +87,7 @@ func handlerDeleteAsk(w http.ResponseWriter, rq *http.Request) { log.Println("Rejected", rq.URL) return } - util.HTTP200Page(w, base("Delete "+hyphaName+"?", templates.DeleteAskHTML(hyphaName, isOld))) + util.HTTP200Page(w, base("Delete "+hyphaName+"?", templates.DeleteAskHTML(rq, hyphaName, isOld))) } // handlerDeleteConfirm deletes a hypha for sure @@ -144,7 +144,7 @@ func handlerEdit(w http.ResponseWriter, rq *http.Request) { } else { warning = `

You are creating a new hypha.

` } - util.HTTP200Page(w, base("Edit "+hyphaName, templates.EditHTML(hyphaName, textAreaFill, warning))) + util.HTTP200Page(w, base("Edit "+hyphaName, templates.EditHTML(rq, hyphaName, textAreaFill, warning))) } // handlerUploadText uploads a new text part for the hypha. diff --git a/http_readers.go b/http_readers.go index 7870d3e..b8887e9 100644 --- a/http_readers.go +++ b/http_readers.go @@ -40,6 +40,7 @@ func handlerRevision(w http.ResponseWriter, rq *http.Request) { contents = markup.ToHtml(hyphaName, textContents) } page := templates.RevisionHTML( + rq, hyphaName, naviTitle(hyphaName), contents, @@ -67,7 +68,7 @@ func handlerHistory(w http.ResponseWriter, rq *http.Request) { log.Println("Found", len(revs), "revisions for", hyphaName) util.HTTP200Page(w, - base(hyphaName, templates.HistoryHTML(hyphaName, tbody))) + base(hyphaName, templates.HistoryHTML(rq, hyphaName, tbody))) } // handlerText serves raw source text of the hypha. @@ -110,7 +111,7 @@ func handlerPage(w http.ResponseWriter, rq *http.Request) { contents = binaryHtmlBlock(hyphaName, data) + contents } } - util.HTTP200Page(w, base(hyphaName, templates.PageHTML(hyphaName, + util.HTTP200Page(w, base(hyphaName, templates.PageHTML(rq, hyphaName, naviTitle(hyphaName), contents, tree.TreeAsHtml(hyphaName, IterateHyphaNamesWith)))) diff --git a/templates/common.qtpl b/templates/common.qtpl index c199fa2..321da84 100644 --- a/templates/common.qtpl +++ b/templates/common.qtpl @@ -1,3 +1,7 @@ +{% import "net/http" %} +{% import "github.com/bouncepaw/mycorrhiza/user" %} +{% import "github.com/bouncepaw/mycorrhiza/util" %} + This is the