mirror of
https://github.com/osmarks/mycorrhiza.git
synced 2025-03-06 19:48:19 +00:00
Move mutators.qtpl and auth.qtpl to the views
This commit is contained in:
parent
f992f0a098
commit
c83710f155
@ -4,9 +4,9 @@ import (
|
||||
"log"
|
||||
"net/http"
|
||||
|
||||
"github.com/bouncepaw/mycorrhiza/templates"
|
||||
"github.com/bouncepaw/mycorrhiza/user"
|
||||
"github.com/bouncepaw/mycorrhiza/util"
|
||||
"github.com/bouncepaw/mycorrhiza/views"
|
||||
)
|
||||
|
||||
func init() {
|
||||
@ -29,7 +29,7 @@ func handlerLogout(w http.ResponseWriter, rq *http.Request) {
|
||||
log.Println("Unknown user tries to log out")
|
||||
w.WriteHeader(http.StatusForbidden)
|
||||
}
|
||||
w.Write([]byte(base("Logout?", templates.LogoutHTML(can), u)))
|
||||
w.Write([]byte(base("Logout?", views.LogoutHTML(can), u)))
|
||||
}
|
||||
|
||||
func handlerLogoutConfirm(w http.ResponseWriter, rq *http.Request) {
|
||||
@ -45,7 +45,7 @@ func handlerLoginData(w http.ResponseWriter, rq *http.Request) {
|
||||
err = user.LoginDataHTTP(w, rq, username, password)
|
||||
)
|
||||
if err != "" {
|
||||
w.Write([]byte(base(err, templates.LoginErrorHTML(err), user.EmptyUser())))
|
||||
w.Write([]byte(base(err, views.LoginErrorHTML(err), user.EmptyUser())))
|
||||
} else {
|
||||
http.Redirect(w, rq, "/", http.StatusSeeOther)
|
||||
}
|
||||
@ -59,5 +59,5 @@ func handlerLogin(w http.ResponseWriter, rq *http.Request) {
|
||||
} else {
|
||||
w.WriteHeader(http.StatusForbidden)
|
||||
}
|
||||
w.Write([]byte(base("Login", templates.LoginHTML(), user.EmptyUser())))
|
||||
w.Write([]byte(base("Login", views.LoginHTML(), user.EmptyUser())))
|
||||
}
|
||||
|
@ -9,7 +9,6 @@ import (
|
||||
"github.com/bouncepaw/mycorrhiza/hyphae"
|
||||
"github.com/bouncepaw/mycorrhiza/markup"
|
||||
"github.com/bouncepaw/mycorrhiza/shroom"
|
||||
"github.com/bouncepaw/mycorrhiza/templates"
|
||||
"github.com/bouncepaw/mycorrhiza/user"
|
||||
"github.com/bouncepaw/mycorrhiza/util"
|
||||
"github.com/bouncepaw/mycorrhiza/views"
|
||||
@ -161,7 +160,7 @@ func handlerEdit(w http.ResponseWriter, rq *http.Request) {
|
||||
w,
|
||||
base(
|
||||
"Edit "+hyphaName,
|
||||
templates.EditHTML(rq, hyphaName, textAreaFill, warning),
|
||||
views.EditHTML(rq, hyphaName, textAreaFill, warning),
|
||||
u))
|
||||
}
|
||||
|
||||
@ -193,7 +192,7 @@ func handlerUploadText(w http.ResponseWriter, rq *http.Request) {
|
||||
w,
|
||||
base(
|
||||
"Preview "+hyphaName,
|
||||
templates.PreviewHTML(
|
||||
views.PreviewHTML(
|
||||
rq,
|
||||
hyphaName,
|
||||
textData,
|
||||
|
@ -1,19 +0,0 @@
|
||||
{% import "net/http" %}
|
||||
{% import "github.com/bouncepaw/mycorrhiza/user" %}
|
||||
{% import "github.com/bouncepaw/mycorrhiza/views" %}
|
||||
|
||||
{% func navHTML(rq *http.Request, hyphaName, navType string, revisionHash ...string) %}
|
||||
{%s= views.NavHTML(rq, hyphaName, navType, revisionHash...) %}
|
||||
{% endfunc %}
|
||||
|
||||
{% func userMenuHTML(u *user.User) %}
|
||||
{%s= views.UserMenuHTML(u) %}
|
||||
{% endfunc %}
|
||||
|
||||
{% func relativeHyphae(relatives string) %}
|
||||
{%s= views.RelativeHyphaeHTML(relatives) %}
|
||||
{% endfunc %}
|
||||
|
||||
{% func subhyphaeMatrix(subhyphae string) %}
|
||||
{%s= views.SubhyphaeHTML(subhyphae) %}
|
||||
{% endfunc %}
|
@ -1,183 +0,0 @@
|
||||
// Code generated by qtc from "common.qtpl". DO NOT EDIT.
|
||||
// See https://github.com/valyala/quicktemplate for details.
|
||||
|
||||
//line templates/common.qtpl:1
|
||||
package templates
|
||||
|
||||
//line templates/common.qtpl:1
|
||||
import "net/http"
|
||||
|
||||
//line templates/common.qtpl:2
|
||||
import "github.com/bouncepaw/mycorrhiza/user"
|
||||
|
||||
//line templates/common.qtpl:3
|
||||
import "github.com/bouncepaw/mycorrhiza/views"
|
||||
|
||||
//line templates/common.qtpl:5
|
||||
import (
|
||||
qtio422016 "io"
|
||||
|
||||
qt422016 "github.com/valyala/quicktemplate"
|
||||
)
|
||||
|
||||
//line templates/common.qtpl:5
|
||||
var (
|
||||
_ = qtio422016.Copy
|
||||
_ = qt422016.AcquireByteBuffer
|
||||
)
|
||||
|
||||
//line templates/common.qtpl:5
|
||||
func streamnavHTML(qw422016 *qt422016.Writer, rq *http.Request, hyphaName, navType string, revisionHash ...string) {
|
||||
//line templates/common.qtpl:5
|
||||
qw422016.N().S(`
|
||||
`)
|
||||
//line templates/common.qtpl:6
|
||||
qw422016.N().S(views.NavHTML(rq, hyphaName, navType, revisionHash...))
|
||||
//line templates/common.qtpl:6
|
||||
qw422016.N().S(`
|
||||
`)
|
||||
//line templates/common.qtpl:7
|
||||
}
|
||||
|
||||
//line templates/common.qtpl:7
|
||||
func writenavHTML(qq422016 qtio422016.Writer, rq *http.Request, hyphaName, navType string, revisionHash ...string) {
|
||||
//line templates/common.qtpl:7
|
||||
qw422016 := qt422016.AcquireWriter(qq422016)
|
||||
//line templates/common.qtpl:7
|
||||
streamnavHTML(qw422016, rq, hyphaName, navType, revisionHash...)
|
||||
//line templates/common.qtpl:7
|
||||
qt422016.ReleaseWriter(qw422016)
|
||||
//line templates/common.qtpl:7
|
||||
}
|
||||
|
||||
//line templates/common.qtpl:7
|
||||
func navHTML(rq *http.Request, hyphaName, navType string, revisionHash ...string) string {
|
||||
//line templates/common.qtpl:7
|
||||
qb422016 := qt422016.AcquireByteBuffer()
|
||||
//line templates/common.qtpl:7
|
||||
writenavHTML(qb422016, rq, hyphaName, navType, revisionHash...)
|
||||
//line templates/common.qtpl:7
|
||||
qs422016 := string(qb422016.B)
|
||||
//line templates/common.qtpl:7
|
||||
qt422016.ReleaseByteBuffer(qb422016)
|
||||
//line templates/common.qtpl:7
|
||||
return qs422016
|
||||
//line templates/common.qtpl:7
|
||||
}
|
||||
|
||||
//line templates/common.qtpl:9
|
||||
func streamuserMenuHTML(qw422016 *qt422016.Writer, u *user.User) {
|
||||
//line templates/common.qtpl:9
|
||||
qw422016.N().S(`
|
||||
`)
|
||||
//line templates/common.qtpl:10
|
||||
qw422016.N().S(views.UserMenuHTML(u))
|
||||
//line templates/common.qtpl:10
|
||||
qw422016.N().S(`
|
||||
`)
|
||||
//line templates/common.qtpl:11
|
||||
}
|
||||
|
||||
//line templates/common.qtpl:11
|
||||
func writeuserMenuHTML(qq422016 qtio422016.Writer, u *user.User) {
|
||||
//line templates/common.qtpl:11
|
||||
qw422016 := qt422016.AcquireWriter(qq422016)
|
||||
//line templates/common.qtpl:11
|
||||
streamuserMenuHTML(qw422016, u)
|
||||
//line templates/common.qtpl:11
|
||||
qt422016.ReleaseWriter(qw422016)
|
||||
//line templates/common.qtpl:11
|
||||
}
|
||||
|
||||
//line templates/common.qtpl:11
|
||||
func userMenuHTML(u *user.User) string {
|
||||
//line templates/common.qtpl:11
|
||||
qb422016 := qt422016.AcquireByteBuffer()
|
||||
//line templates/common.qtpl:11
|
||||
writeuserMenuHTML(qb422016, u)
|
||||
//line templates/common.qtpl:11
|
||||
qs422016 := string(qb422016.B)
|
||||
//line templates/common.qtpl:11
|
||||
qt422016.ReleaseByteBuffer(qb422016)
|
||||
//line templates/common.qtpl:11
|
||||
return qs422016
|
||||
//line templates/common.qtpl:11
|
||||
}
|
||||
|
||||
//line templates/common.qtpl:13
|
||||
func streamrelativeHyphae(qw422016 *qt422016.Writer, relatives string) {
|
||||
//line templates/common.qtpl:13
|
||||
qw422016.N().S(`
|
||||
`)
|
||||
//line templates/common.qtpl:14
|
||||
qw422016.N().S(views.RelativeHyphaeHTML(relatives))
|
||||
//line templates/common.qtpl:14
|
||||
qw422016.N().S(`
|
||||
`)
|
||||
//line templates/common.qtpl:15
|
||||
}
|
||||
|
||||
//line templates/common.qtpl:15
|
||||
func writerelativeHyphae(qq422016 qtio422016.Writer, relatives string) {
|
||||
//line templates/common.qtpl:15
|
||||
qw422016 := qt422016.AcquireWriter(qq422016)
|
||||
//line templates/common.qtpl:15
|
||||
streamrelativeHyphae(qw422016, relatives)
|
||||
//line templates/common.qtpl:15
|
||||
qt422016.ReleaseWriter(qw422016)
|
||||
//line templates/common.qtpl:15
|
||||
}
|
||||
|
||||
//line templates/common.qtpl:15
|
||||
func relativeHyphae(relatives string) string {
|
||||
//line templates/common.qtpl:15
|
||||
qb422016 := qt422016.AcquireByteBuffer()
|
||||
//line templates/common.qtpl:15
|
||||
writerelativeHyphae(qb422016, relatives)
|
||||
//line templates/common.qtpl:15
|
||||
qs422016 := string(qb422016.B)
|
||||
//line templates/common.qtpl:15
|
||||
qt422016.ReleaseByteBuffer(qb422016)
|
||||
//line templates/common.qtpl:15
|
||||
return qs422016
|
||||
//line templates/common.qtpl:15
|
||||
}
|
||||
|
||||
//line templates/common.qtpl:17
|
||||
func streamsubhyphaeMatrix(qw422016 *qt422016.Writer, subhyphae string) {
|
||||
//line templates/common.qtpl:17
|
||||
qw422016.N().S(`
|
||||
`)
|
||||
//line templates/common.qtpl:18
|
||||
qw422016.N().S(views.SubhyphaeHTML(subhyphae))
|
||||
//line templates/common.qtpl:18
|
||||
qw422016.N().S(`
|
||||
`)
|
||||
//line templates/common.qtpl:19
|
||||
}
|
||||
|
||||
//line templates/common.qtpl:19
|
||||
func writesubhyphaeMatrix(qq422016 qtio422016.Writer, subhyphae string) {
|
||||
//line templates/common.qtpl:19
|
||||
qw422016 := qt422016.AcquireWriter(qq422016)
|
||||
//line templates/common.qtpl:19
|
||||
streamsubhyphaeMatrix(qw422016, subhyphae)
|
||||
//line templates/common.qtpl:19
|
||||
qt422016.ReleaseWriter(qw422016)
|
||||
//line templates/common.qtpl:19
|
||||
}
|
||||
|
||||
//line templates/common.qtpl:19
|
||||
func subhyphaeMatrix(subhyphae string) string {
|
||||
//line templates/common.qtpl:19
|
||||
qb422016 := qt422016.AcquireByteBuffer()
|
||||
//line templates/common.qtpl:19
|
||||
writesubhyphaeMatrix(qb422016, subhyphae)
|
||||
//line templates/common.qtpl:19
|
||||
qs422016 := string(qb422016.B)
|
||||
//line templates/common.qtpl:19
|
||||
qt422016.ReleaseByteBuffer(qb422016)
|
||||
//line templates/common.qtpl:19
|
||||
return qs422016
|
||||
//line templates/common.qtpl:19
|
||||
}
|
@ -1,36 +1,36 @@
|
||||
// Code generated by qtc from "auth.qtpl". DO NOT EDIT.
|
||||
// See https://github.com/valyala/quicktemplate for details.
|
||||
|
||||
//line templates/auth.qtpl:1
|
||||
package templates
|
||||
//line views/auth.qtpl:1
|
||||
package views
|
||||
|
||||
//line templates/auth.qtpl:1
|
||||
//line views/auth.qtpl:1
|
||||
import "github.com/bouncepaw/mycorrhiza/user"
|
||||
|
||||
//line templates/auth.qtpl:3
|
||||
//line views/auth.qtpl:3
|
||||
import (
|
||||
qtio422016 "io"
|
||||
|
||||
qt422016 "github.com/valyala/quicktemplate"
|
||||
)
|
||||
|
||||
//line templates/auth.qtpl:3
|
||||
//line views/auth.qtpl:3
|
||||
var (
|
||||
_ = qtio422016.Copy
|
||||
_ = qt422016.AcquireByteBuffer
|
||||
)
|
||||
|
||||
//line templates/auth.qtpl:3
|
||||
//line views/auth.qtpl:3
|
||||
func StreamLoginHTML(qw422016 *qt422016.Writer) {
|
||||
//line templates/auth.qtpl:3
|
||||
//line views/auth.qtpl:3
|
||||
qw422016.N().S(`
|
||||
<div class="layout">
|
||||
<main class="main-width">
|
||||
<section>
|
||||
`)
|
||||
//line templates/auth.qtpl:7
|
||||
//line views/auth.qtpl:7
|
||||
if user.AuthUsed {
|
||||
//line templates/auth.qtpl:7
|
||||
//line views/auth.qtpl:7
|
||||
qw422016.N().S(`
|
||||
<h1>Login</h1>
|
||||
<form method="post" action="/login-data" id="login-form" enctype="multipart/form-data">
|
||||
@ -48,177 +48,177 @@ func StreamLoginHTML(qw422016 *qt422016.Writer) {
|
||||
<a href="/">Cancel</a>
|
||||
</form>
|
||||
`)
|
||||
//line templates/auth.qtpl:23
|
||||
//line views/auth.qtpl:23
|
||||
} else {
|
||||
//line templates/auth.qtpl:23
|
||||
//line views/auth.qtpl:23
|
||||
qw422016.N().S(`
|
||||
<p>Administrator of this wiki have not configured any authorization method. You can make edits anonymously.</p>
|
||||
<p><a href="/">← Go home</a></p>
|
||||
`)
|
||||
//line templates/auth.qtpl:26
|
||||
//line views/auth.qtpl:26
|
||||
}
|
||||
//line templates/auth.qtpl:26
|
||||
//line views/auth.qtpl:26
|
||||
qw422016.N().S(`
|
||||
</section>
|
||||
</main>
|
||||
</div>
|
||||
`)
|
||||
//line templates/auth.qtpl:30
|
||||
//line views/auth.qtpl:30
|
||||
}
|
||||
|
||||
//line templates/auth.qtpl:30
|
||||
//line views/auth.qtpl:30
|
||||
func WriteLoginHTML(qq422016 qtio422016.Writer) {
|
||||
//line templates/auth.qtpl:30
|
||||
//line views/auth.qtpl:30
|
||||
qw422016 := qt422016.AcquireWriter(qq422016)
|
||||
//line templates/auth.qtpl:30
|
||||
//line views/auth.qtpl:30
|
||||
StreamLoginHTML(qw422016)
|
||||
//line templates/auth.qtpl:30
|
||||
//line views/auth.qtpl:30
|
||||
qt422016.ReleaseWriter(qw422016)
|
||||
//line templates/auth.qtpl:30
|
||||
//line views/auth.qtpl:30
|
||||
}
|
||||
|
||||
//line templates/auth.qtpl:30
|
||||
//line views/auth.qtpl:30
|
||||
func LoginHTML() string {
|
||||
//line templates/auth.qtpl:30
|
||||
//line views/auth.qtpl:30
|
||||
qb422016 := qt422016.AcquireByteBuffer()
|
||||
//line templates/auth.qtpl:30
|
||||
//line views/auth.qtpl:30
|
||||
WriteLoginHTML(qb422016)
|
||||
//line templates/auth.qtpl:30
|
||||
//line views/auth.qtpl:30
|
||||
qs422016 := string(qb422016.B)
|
||||
//line templates/auth.qtpl:30
|
||||
//line views/auth.qtpl:30
|
||||
qt422016.ReleaseByteBuffer(qb422016)
|
||||
//line templates/auth.qtpl:30
|
||||
//line views/auth.qtpl:30
|
||||
return qs422016
|
||||
//line templates/auth.qtpl:30
|
||||
//line views/auth.qtpl:30
|
||||
}
|
||||
|
||||
//line templates/auth.qtpl:32
|
||||
//line views/auth.qtpl:32
|
||||
func StreamLoginErrorHTML(qw422016 *qt422016.Writer, err string) {
|
||||
//line templates/auth.qtpl:32
|
||||
//line views/auth.qtpl:32
|
||||
qw422016.N().S(`
|
||||
<div class="layout">
|
||||
<main class="main-width">
|
||||
<section>
|
||||
`)
|
||||
//line templates/auth.qtpl:36
|
||||
//line views/auth.qtpl:36
|
||||
switch err {
|
||||
//line templates/auth.qtpl:37
|
||||
//line views/auth.qtpl:37
|
||||
case "unknown username":
|
||||
//line templates/auth.qtpl:37
|
||||
//line views/auth.qtpl:37
|
||||
qw422016.N().S(`
|
||||
<p class="error">Unknown username.</p>
|
||||
`)
|
||||
//line templates/auth.qtpl:39
|
||||
//line views/auth.qtpl:39
|
||||
case "wrong password":
|
||||
//line templates/auth.qtpl:39
|
||||
//line views/auth.qtpl:39
|
||||
qw422016.N().S(`
|
||||
<p class="error">Wrong password.</p>
|
||||
`)
|
||||
//line templates/auth.qtpl:41
|
||||
//line views/auth.qtpl:41
|
||||
default:
|
||||
//line templates/auth.qtpl:41
|
||||
//line views/auth.qtpl:41
|
||||
qw422016.N().S(`
|
||||
<p class="error">`)
|
||||
//line templates/auth.qtpl:42
|
||||
//line views/auth.qtpl:42
|
||||
qw422016.E().S(err)
|
||||
//line templates/auth.qtpl:42
|
||||
//line views/auth.qtpl:42
|
||||
qw422016.N().S(`</p>
|
||||
`)
|
||||
//line templates/auth.qtpl:43
|
||||
//line views/auth.qtpl:43
|
||||
}
|
||||
//line templates/auth.qtpl:43
|
||||
//line views/auth.qtpl:43
|
||||
qw422016.N().S(`
|
||||
<p><a href="/login">← Try again</a></p>
|
||||
</section>
|
||||
</main>
|
||||
</div>
|
||||
`)
|
||||
//line templates/auth.qtpl:48
|
||||
//line views/auth.qtpl:48
|
||||
}
|
||||
|
||||
//line templates/auth.qtpl:48
|
||||
//line views/auth.qtpl:48
|
||||
func WriteLoginErrorHTML(qq422016 qtio422016.Writer, err string) {
|
||||
//line templates/auth.qtpl:48
|
||||
//line views/auth.qtpl:48
|
||||
qw422016 := qt422016.AcquireWriter(qq422016)
|
||||
//line templates/auth.qtpl:48
|
||||
//line views/auth.qtpl:48
|
||||
StreamLoginErrorHTML(qw422016, err)
|
||||
//line templates/auth.qtpl:48
|
||||
//line views/auth.qtpl:48
|
||||
qt422016.ReleaseWriter(qw422016)
|
||||
//line templates/auth.qtpl:48
|
||||
//line views/auth.qtpl:48
|
||||
}
|
||||
|
||||
//line templates/auth.qtpl:48
|
||||
//line views/auth.qtpl:48
|
||||
func LoginErrorHTML(err string) string {
|
||||
//line templates/auth.qtpl:48
|
||||
//line views/auth.qtpl:48
|
||||
qb422016 := qt422016.AcquireByteBuffer()
|
||||
//line templates/auth.qtpl:48
|
||||
//line views/auth.qtpl:48
|
||||
WriteLoginErrorHTML(qb422016, err)
|
||||
//line templates/auth.qtpl:48
|
||||
//line views/auth.qtpl:48
|
||||
qs422016 := string(qb422016.B)
|
||||
//line templates/auth.qtpl:48
|
||||
//line views/auth.qtpl:48
|
||||
qt422016.ReleaseByteBuffer(qb422016)
|
||||
//line templates/auth.qtpl:48
|
||||
//line views/auth.qtpl:48
|
||||
return qs422016
|
||||
//line templates/auth.qtpl:48
|
||||
//line views/auth.qtpl:48
|
||||
}
|
||||
|
||||
//line templates/auth.qtpl:50
|
||||
//line views/auth.qtpl:50
|
||||
func StreamLogoutHTML(qw422016 *qt422016.Writer, can bool) {
|
||||
//line templates/auth.qtpl:50
|
||||
//line views/auth.qtpl:50
|
||||
qw422016.N().S(`
|
||||
<div class="layout">
|
||||
<main class="main-width">
|
||||
<section>
|
||||
`)
|
||||
//line templates/auth.qtpl:54
|
||||
//line views/auth.qtpl:54
|
||||
if can {
|
||||
//line templates/auth.qtpl:54
|
||||
//line views/auth.qtpl:54
|
||||
qw422016.N().S(`
|
||||
<h1>Log out?</h1>
|
||||
<p><a href="/logout-confirm"><strong>Confirm</strong></a></p>
|
||||
<p><a href="/">Cancel</a></p>
|
||||
`)
|
||||
//line templates/auth.qtpl:58
|
||||
//line views/auth.qtpl:58
|
||||
} else {
|
||||
//line templates/auth.qtpl:58
|
||||
//line views/auth.qtpl:58
|
||||
qw422016.N().S(`
|
||||
<p>You cannot log out because you are not logged in.</p>
|
||||
<p><a href="/login">Login</a></p>
|
||||
<p><a href="/login">← Home</a></p>
|
||||
`)
|
||||
//line templates/auth.qtpl:62
|
||||
//line views/auth.qtpl:62
|
||||
}
|
||||
//line templates/auth.qtpl:62
|
||||
//line views/auth.qtpl:62
|
||||
qw422016.N().S(`
|
||||
</section>
|
||||
</main>
|
||||
</div>
|
||||
`)
|
||||
//line templates/auth.qtpl:66
|
||||
//line views/auth.qtpl:66
|
||||
}
|
||||
|
||||
//line templates/auth.qtpl:66
|
||||
//line views/auth.qtpl:66
|
||||
func WriteLogoutHTML(qq422016 qtio422016.Writer, can bool) {
|
||||
//line templates/auth.qtpl:66
|
||||
//line views/auth.qtpl:66
|
||||
qw422016 := qt422016.AcquireWriter(qq422016)
|
||||
//line templates/auth.qtpl:66
|
||||
//line views/auth.qtpl:66
|
||||
StreamLogoutHTML(qw422016, can)
|
||||
//line templates/auth.qtpl:66
|
||||
//line views/auth.qtpl:66
|
||||
qt422016.ReleaseWriter(qw422016)
|
||||
//line templates/auth.qtpl:66
|
||||
//line views/auth.qtpl:66
|
||||
}
|
||||
|
||||
//line templates/auth.qtpl:66
|
||||
//line views/auth.qtpl:66
|
||||
func LogoutHTML(can bool) string {
|
||||
//line templates/auth.qtpl:66
|
||||
//line views/auth.qtpl:66
|
||||
qb422016 := qt422016.AcquireByteBuffer()
|
||||
//line templates/auth.qtpl:66
|
||||
//line views/auth.qtpl:66
|
||||
WriteLogoutHTML(qb422016, can)
|
||||
//line templates/auth.qtpl:66
|
||||
//line views/auth.qtpl:66
|
||||
qs422016 := string(qb422016.B)
|
||||
//line templates/auth.qtpl:66
|
||||
//line views/auth.qtpl:66
|
||||
qt422016.ReleaseByteBuffer(qb422016)
|
||||
//line templates/auth.qtpl:66
|
||||
//line views/auth.qtpl:66
|
||||
return qs422016
|
||||
//line templates/auth.qtpl:66
|
||||
//line views/auth.qtpl:66
|
||||
}
|
@ -2,7 +2,7 @@
|
||||
{% import "github.com/bouncepaw/mycorrhiza/util" %}
|
||||
|
||||
{% func EditHTML(rq *http.Request, hyphaName, textAreaFill, warning string) %}
|
||||
{%s= navHTML(rq, hyphaName, "edit") %}
|
||||
{%s= NavHTML(rq, hyphaName, "edit") %}
|
||||
<div class="layout">
|
||||
<main class="main-width edit edit_no-preview">
|
||||
<h1 class="edit__title">Edit {%s util.BeautifulName(hyphaName) %}</h1>
|
||||
@ -20,10 +20,10 @@
|
||||
{% endfunc %}
|
||||
|
||||
{% func PreviewHTML(rq *http.Request, hyphaName, textAreaFill, warning string, renderedPage string) %}
|
||||
{%s= navHTML(rq, hyphaName, "edit") %}
|
||||
{%s= NavHTML(rq, hyphaName, "edit") %}
|
||||
<div class="layout">
|
||||
<main class="main-width edit edit_with-preview">
|
||||
<h1>Edit {%s hyphaName %} (preview)</h1>
|
||||
<h1>Edit {%s util.BeautifulName(hyphaName) %} (preview)</h1>
|
||||
{%s= warning %}
|
||||
<form method="post" class="edit-form"
|
||||
action="/upload-text/{%s hyphaName %}">
|
@ -1,176 +1,176 @@
|
||||
// Code generated by qtc from "mutators.qtpl". DO NOT EDIT.
|
||||
// See https://github.com/valyala/quicktemplate for details.
|
||||
|
||||
//line templates/mutators.qtpl:1
|
||||
package templates
|
||||
//line views/mutators.qtpl:1
|
||||
package views
|
||||
|
||||
//line templates/mutators.qtpl:1
|
||||
//line views/mutators.qtpl:1
|
||||
import "net/http"
|
||||
|
||||
//line templates/mutators.qtpl:2
|
||||
//line views/mutators.qtpl:2
|
||||
import "github.com/bouncepaw/mycorrhiza/util"
|
||||
|
||||
//line templates/mutators.qtpl:4
|
||||
//line views/mutators.qtpl:4
|
||||
import (
|
||||
qtio422016 "io"
|
||||
|
||||
qt422016 "github.com/valyala/quicktemplate"
|
||||
)
|
||||
|
||||
//line templates/mutators.qtpl:4
|
||||
//line views/mutators.qtpl:4
|
||||
var (
|
||||
_ = qtio422016.Copy
|
||||
_ = qt422016.AcquireByteBuffer
|
||||
)
|
||||
|
||||
//line templates/mutators.qtpl:4
|
||||
//line views/mutators.qtpl:4
|
||||
func StreamEditHTML(qw422016 *qt422016.Writer, rq *http.Request, hyphaName, textAreaFill, warning string) {
|
||||
//line templates/mutators.qtpl:4
|
||||
//line views/mutators.qtpl:4
|
||||
qw422016.N().S(`
|
||||
`)
|
||||
//line templates/mutators.qtpl:5
|
||||
qw422016.N().S(navHTML(rq, hyphaName, "edit"))
|
||||
//line templates/mutators.qtpl:5
|
||||
//line views/mutators.qtpl:5
|
||||
qw422016.N().S(NavHTML(rq, hyphaName, "edit"))
|
||||
//line views/mutators.qtpl:5
|
||||
qw422016.N().S(`
|
||||
<div class="layout">
|
||||
<main class="main-width edit edit_no-preview">
|
||||
<h1 class="edit__title">Edit `)
|
||||
//line templates/mutators.qtpl:8
|
||||
//line views/mutators.qtpl:8
|
||||
qw422016.E().S(util.BeautifulName(hyphaName))
|
||||
//line templates/mutators.qtpl:8
|
||||
//line views/mutators.qtpl:8
|
||||
qw422016.N().S(`</h1>
|
||||
`)
|
||||
//line templates/mutators.qtpl:9
|
||||
//line views/mutators.qtpl:9
|
||||
qw422016.N().S(warning)
|
||||
//line templates/mutators.qtpl:9
|
||||
//line views/mutators.qtpl:9
|
||||
qw422016.N().S(`
|
||||
<form method="post" class="edit-form"
|
||||
action="/upload-text/`)
|
||||
//line templates/mutators.qtpl:11
|
||||
//line views/mutators.qtpl:11
|
||||
qw422016.E().S(hyphaName)
|
||||
//line templates/mutators.qtpl:11
|
||||
//line views/mutators.qtpl:11
|
||||
qw422016.N().S(`">
|
||||
<textarea name="text">`)
|
||||
//line templates/mutators.qtpl:12
|
||||
//line views/mutators.qtpl:12
|
||||
qw422016.E().S(textAreaFill)
|
||||
//line templates/mutators.qtpl:12
|
||||
//line views/mutators.qtpl:12
|
||||
qw422016.N().S(`</textarea>
|
||||
<br/>
|
||||
<input type="submit" name="action" value="Save" class="edit-form__save"/>
|
||||
<input type="submit" name="action" value="Preview" class="edit-form__preview">
|
||||
<a href="/page/`)
|
||||
//line templates/mutators.qtpl:16
|
||||
//line views/mutators.qtpl:16
|
||||
qw422016.E().S(hyphaName)
|
||||
//line templates/mutators.qtpl:16
|
||||
//line views/mutators.qtpl:16
|
||||
qw422016.N().S(`" class="edit-form__cancel">Cancel</a>
|
||||
</form>
|
||||
</main>
|
||||
</div>
|
||||
`)
|
||||
//line templates/mutators.qtpl:20
|
||||
//line views/mutators.qtpl:20
|
||||
}
|
||||
|
||||
//line templates/mutators.qtpl:20
|
||||
//line views/mutators.qtpl:20
|
||||
func WriteEditHTML(qq422016 qtio422016.Writer, rq *http.Request, hyphaName, textAreaFill, warning string) {
|
||||
//line templates/mutators.qtpl:20
|
||||
//line views/mutators.qtpl:20
|
||||
qw422016 := qt422016.AcquireWriter(qq422016)
|
||||
//line templates/mutators.qtpl:20
|
||||
//line views/mutators.qtpl:20
|
||||
StreamEditHTML(qw422016, rq, hyphaName, textAreaFill, warning)
|
||||
//line templates/mutators.qtpl:20
|
||||
//line views/mutators.qtpl:20
|
||||
qt422016.ReleaseWriter(qw422016)
|
||||
//line templates/mutators.qtpl:20
|
||||
//line views/mutators.qtpl:20
|
||||
}
|
||||
|
||||
//line templates/mutators.qtpl:20
|
||||
//line views/mutators.qtpl:20
|
||||
func EditHTML(rq *http.Request, hyphaName, textAreaFill, warning string) string {
|
||||
//line templates/mutators.qtpl:20
|
||||
//line views/mutators.qtpl:20
|
||||
qb422016 := qt422016.AcquireByteBuffer()
|
||||
//line templates/mutators.qtpl:20
|
||||
//line views/mutators.qtpl:20
|
||||
WriteEditHTML(qb422016, rq, hyphaName, textAreaFill, warning)
|
||||
//line templates/mutators.qtpl:20
|
||||
//line views/mutators.qtpl:20
|
||||
qs422016 := string(qb422016.B)
|
||||
//line templates/mutators.qtpl:20
|
||||
//line views/mutators.qtpl:20
|
||||
qt422016.ReleaseByteBuffer(qb422016)
|
||||
//line templates/mutators.qtpl:20
|
||||
//line views/mutators.qtpl:20
|
||||
return qs422016
|
||||
//line templates/mutators.qtpl:20
|
||||
//line views/mutators.qtpl:20
|
||||
}
|
||||
|
||||
//line templates/mutators.qtpl:22
|
||||
//line views/mutators.qtpl:22
|
||||
func StreamPreviewHTML(qw422016 *qt422016.Writer, rq *http.Request, hyphaName, textAreaFill, warning string, renderedPage string) {
|
||||
//line templates/mutators.qtpl:22
|
||||
//line views/mutators.qtpl:22
|
||||
qw422016.N().S(`
|
||||
`)
|
||||
//line templates/mutators.qtpl:23
|
||||
qw422016.N().S(navHTML(rq, hyphaName, "edit"))
|
||||
//line templates/mutators.qtpl:23
|
||||
//line views/mutators.qtpl:23
|
||||
qw422016.N().S(NavHTML(rq, hyphaName, "edit"))
|
||||
//line views/mutators.qtpl:23
|
||||
qw422016.N().S(`
|
||||
<div class="layout">
|
||||
<main class="main-width edit edit_with-preview">
|
||||
<h1>Edit `)
|
||||
//line templates/mutators.qtpl:26
|
||||
qw422016.E().S(hyphaName)
|
||||
//line templates/mutators.qtpl:26
|
||||
//line views/mutators.qtpl:26
|
||||
qw422016.E().S(util.BeautifulName(hyphaName))
|
||||
//line views/mutators.qtpl:26
|
||||
qw422016.N().S(` (preview)</h1>
|
||||
`)
|
||||
//line templates/mutators.qtpl:27
|
||||
//line views/mutators.qtpl:27
|
||||
qw422016.N().S(warning)
|
||||
//line templates/mutators.qtpl:27
|
||||
//line views/mutators.qtpl:27
|
||||
qw422016.N().S(`
|
||||
<form method="post" class="edit-form"
|
||||
action="/upload-text/`)
|
||||
//line templates/mutators.qtpl:29
|
||||
//line views/mutators.qtpl:29
|
||||
qw422016.E().S(hyphaName)
|
||||
//line templates/mutators.qtpl:29
|
||||
//line views/mutators.qtpl:29
|
||||
qw422016.N().S(`">
|
||||
<textarea name="text">`)
|
||||
//line templates/mutators.qtpl:30
|
||||
//line views/mutators.qtpl:30
|
||||
qw422016.E().S(textAreaFill)
|
||||
//line templates/mutators.qtpl:30
|
||||
//line views/mutators.qtpl:30
|
||||
qw422016.N().S(`</textarea>
|
||||
<br/>
|
||||
<input type="submit" name="action" value="Save" class="edit-form__save"/>
|
||||
<input type="submit" name="action" value="Preview" class="edit-form__preview">
|
||||
<a href="/page/`)
|
||||
//line templates/mutators.qtpl:34
|
||||
//line views/mutators.qtpl:34
|
||||
qw422016.E().S(hyphaName)
|
||||
//line templates/mutators.qtpl:34
|
||||
//line views/mutators.qtpl:34
|
||||
qw422016.N().S(`" class="edit-form__cancel">Cancel</a>
|
||||
</form>
|
||||
<p class="warning">Note that the hypha is not saved yet. You can preview the changes ↓</p>
|
||||
<section class="edit__preview">`)
|
||||
//line templates/mutators.qtpl:37
|
||||
//line views/mutators.qtpl:37
|
||||
qw422016.N().S(renderedPage)
|
||||
//line templates/mutators.qtpl:37
|
||||
//line views/mutators.qtpl:37
|
||||
qw422016.N().S(`</section>
|
||||
</main>
|
||||
</div>
|
||||
`)
|
||||
//line templates/mutators.qtpl:40
|
||||
//line views/mutators.qtpl:40
|
||||
}
|
||||
|
||||
//line templates/mutators.qtpl:40
|
||||
//line views/mutators.qtpl:40
|
||||
func WritePreviewHTML(qq422016 qtio422016.Writer, rq *http.Request, hyphaName, textAreaFill, warning string, renderedPage string) {
|
||||
//line templates/mutators.qtpl:40
|
||||
//line views/mutators.qtpl:40
|
||||
qw422016 := qt422016.AcquireWriter(qq422016)
|
||||
//line templates/mutators.qtpl:40
|
||||
//line views/mutators.qtpl:40
|
||||
StreamPreviewHTML(qw422016, rq, hyphaName, textAreaFill, warning, renderedPage)
|
||||
//line templates/mutators.qtpl:40
|
||||
//line views/mutators.qtpl:40
|
||||
qt422016.ReleaseWriter(qw422016)
|
||||
//line templates/mutators.qtpl:40
|
||||
//line views/mutators.qtpl:40
|
||||
}
|
||||
|
||||
//line templates/mutators.qtpl:40
|
||||
//line views/mutators.qtpl:40
|
||||
func PreviewHTML(rq *http.Request, hyphaName, textAreaFill, warning string, renderedPage string) string {
|
||||
//line templates/mutators.qtpl:40
|
||||
//line views/mutators.qtpl:40
|
||||
qb422016 := qt422016.AcquireByteBuffer()
|
||||
//line templates/mutators.qtpl:40
|
||||
//line views/mutators.qtpl:40
|
||||
WritePreviewHTML(qb422016, rq, hyphaName, textAreaFill, warning, renderedPage)
|
||||
//line templates/mutators.qtpl:40
|
||||
//line views/mutators.qtpl:40
|
||||
qs422016 := string(qb422016.B)
|
||||
//line templates/mutators.qtpl:40
|
||||
//line views/mutators.qtpl:40
|
||||
qt422016.ReleaseByteBuffer(qb422016)
|
||||
//line templates/mutators.qtpl:40
|
||||
//line views/mutators.qtpl:40
|
||||
return qs422016
|
||||
//line templates/mutators.qtpl:40
|
||||
//line views/mutators.qtpl:40
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user