1
0
mirror of https://github.com/osmarks/mycorrhiza.git synced 2024-12-13 05:50:27 +00:00
mycorrhiza/templates/rename.qtpl.go

161 lines
4.5 KiB
Go
Raw Normal View History

2020-10-02 15:31:59 +00:00
// Code generated by qtc from "rename.qtpl". DO NOT EDIT.
// See https://github.com/valyala/quicktemplate for details.
//line templates/rename.qtpl:1
2020-10-02 15:31:59 +00:00
package templates
//line templates/rename.qtpl:1
import "net/http"
// This dialog is to be shown to a user when they try to rename a hypha.
//line templates/rename.qtpl:3
2020-10-02 15:31:59 +00:00
import (
qtio422016 "io"
qt422016 "github.com/valyala/quicktemplate"
)
//line templates/rename.qtpl:3
2020-10-02 15:31:59 +00:00
var (
_ = qtio422016.Copy
_ = qt422016.AcquireByteBuffer
)
//line templates/rename.qtpl:3
func StreamRenameAskHTML(qw422016 *qt422016.Writer, rq *http.Request, hyphaName string, isOld bool) {
//line templates/rename.qtpl:3
2020-10-02 15:31:59 +00:00
qw422016.N().S(`
`)
2021-01-20 13:53:30 +00:00
//line templates/rename.qtpl:4
streamnavHTML(qw422016, rq, hyphaName, "rename-ask")
2021-01-20 13:53:30 +00:00
//line templates/rename.qtpl:4
2020-10-02 15:31:59 +00:00
qw422016.N().S(`
2021-01-26 05:41:57 +00:00
<div class="layout">
<main class="main-width">
2020-10-02 15:31:59 +00:00
`)
2021-01-26 05:41:57 +00:00
//line templates/rename.qtpl:7
2020-10-02 15:31:59 +00:00
if isOld {
2021-01-26 05:41:57 +00:00
//line templates/rename.qtpl:7
2020-10-02 15:31:59 +00:00
qw422016.N().S(` <section>
<h1>Rename `)
2021-01-26 05:41:57 +00:00
//line templates/rename.qtpl:9
2020-10-02 15:31:59 +00:00
qw422016.E().S(hyphaName)
2021-01-26 05:41:57 +00:00
//line templates/rename.qtpl:9
2020-10-02 15:31:59 +00:00
qw422016.N().S(`</h1>
<form action="/rename-confirm/`)
2021-01-26 05:41:57 +00:00
//line templates/rename.qtpl:10
2020-10-02 15:31:59 +00:00
qw422016.E().S(hyphaName)
2021-01-26 05:41:57 +00:00
//line templates/rename.qtpl:10
2020-10-02 15:31:59 +00:00
qw422016.N().S(`" method="post" enctype="multipart/form-data">
2020-10-03 16:56:56 +00:00
<fieldset>
<legend>New name</legend>
<input type="text" value="`)
2021-01-26 05:41:57 +00:00
//line templates/rename.qtpl:13
2020-10-02 15:31:59 +00:00
qw422016.E().S(hyphaName)
2021-01-26 05:41:57 +00:00
//line templates/rename.qtpl:13
2020-10-02 15:31:59 +00:00
qw422016.N().S(`" required autofocus id="new-name" name="new-name"/>
2020-10-03 16:56:56 +00:00
</fieldset>
<fieldset>
<legend>Settings</legend>
<input type="checkbox" id="recursive" name="recursive" value="true" checked/>
<label for="recursive">Keep subhyphae</label>
</fieldset>
<p>If you rename this hypha, all incoming links and all relative outcoming links will break. You will also lose all history for the new name. Rename carefully.</p>
2020-10-02 15:31:59 +00:00
<input type="submit"/>
</form>
</section>
`)
2021-01-26 05:41:57 +00:00
//line templates/rename.qtpl:26
2020-10-02 15:31:59 +00:00
} else {
//line templates/rename.qtpl:26
2021-01-26 05:41:57 +00:00
qw422016.N().S(` `)
//line templates/rename.qtpl:27
2020-10-02 15:31:59 +00:00
streamcannotRenameDueToNonExistence(qw422016, hyphaName)
2021-01-26 05:41:57 +00:00
//line templates/rename.qtpl:27
2020-10-02 15:31:59 +00:00
qw422016.N().S(`
`)
2021-01-26 05:41:57 +00:00
//line templates/rename.qtpl:28
2020-10-02 15:31:59 +00:00
}
2021-01-26 05:41:57 +00:00
//line templates/rename.qtpl:28
2020-10-02 15:31:59 +00:00
qw422016.N().S(`</main>
2021-01-26 05:41:57 +00:00
</div>
2020-10-02 15:31:59 +00:00
`)
2021-01-26 05:41:57 +00:00
//line templates/rename.qtpl:31
2020-10-02 15:31:59 +00:00
}
2021-01-26 05:41:57 +00:00
//line templates/rename.qtpl:31
func WriteRenameAskHTML(qq422016 qtio422016.Writer, rq *http.Request, hyphaName string, isOld bool) {
2021-01-26 05:41:57 +00:00
//line templates/rename.qtpl:31
2020-10-02 15:31:59 +00:00
qw422016 := qt422016.AcquireWriter(qq422016)
2021-01-26 05:41:57 +00:00
//line templates/rename.qtpl:31
StreamRenameAskHTML(qw422016, rq, hyphaName, isOld)
2021-01-26 05:41:57 +00:00
//line templates/rename.qtpl:31
2020-10-02 15:31:59 +00:00
qt422016.ReleaseWriter(qw422016)
2021-01-26 05:41:57 +00:00
//line templates/rename.qtpl:31
2020-10-02 15:31:59 +00:00
}
2021-01-26 05:41:57 +00:00
//line templates/rename.qtpl:31
func RenameAskHTML(rq *http.Request, hyphaName string, isOld bool) string {
2021-01-26 05:41:57 +00:00
//line templates/rename.qtpl:31
2020-10-02 15:31:59 +00:00
qb422016 := qt422016.AcquireByteBuffer()
2021-01-26 05:41:57 +00:00
//line templates/rename.qtpl:31
WriteRenameAskHTML(qb422016, rq, hyphaName, isOld)
2021-01-26 05:41:57 +00:00
//line templates/rename.qtpl:31
2020-10-02 15:31:59 +00:00
qs422016 := string(qb422016.B)
2021-01-26 05:41:57 +00:00
//line templates/rename.qtpl:31
2020-10-02 15:31:59 +00:00
qt422016.ReleaseByteBuffer(qb422016)
2021-01-26 05:41:57 +00:00
//line templates/rename.qtpl:31
2020-10-02 15:31:59 +00:00
return qs422016
2021-01-26 05:41:57 +00:00
//line templates/rename.qtpl:31
2020-10-02 15:31:59 +00:00
}
2021-01-26 05:41:57 +00:00
//line templates/rename.qtpl:33
2020-10-02 15:31:59 +00:00
func streamcannotRenameDueToNonExistence(qw422016 *qt422016.Writer, hyphaName string) {
2021-01-26 05:41:57 +00:00
//line templates/rename.qtpl:33
2020-10-02 15:31:59 +00:00
qw422016.N().S(`
<section>
<h1>Cannot rename `)
2021-01-26 05:41:57 +00:00
//line templates/rename.qtpl:35
2020-10-02 15:31:59 +00:00
qw422016.E().S(hyphaName)
2021-01-26 05:41:57 +00:00
//line templates/rename.qtpl:35
2020-10-02 15:31:59 +00:00
qw422016.N().S(`</h1>
<p>This hypha does not exist.</p>
<p><a href="/page/`)
2021-01-26 05:41:57 +00:00
//line templates/rename.qtpl:37
2020-10-02 15:31:59 +00:00
qw422016.E().S(hyphaName)
2021-01-26 05:41:57 +00:00
//line templates/rename.qtpl:37
2020-10-02 15:31:59 +00:00
qw422016.N().S(`">Go back</a></p>
</section>
`)
2021-01-26 05:41:57 +00:00
//line templates/rename.qtpl:39
2020-10-02 15:31:59 +00:00
}
2021-01-26 05:41:57 +00:00
//line templates/rename.qtpl:39
2020-10-02 15:31:59 +00:00
func writecannotRenameDueToNonExistence(qq422016 qtio422016.Writer, hyphaName string) {
2021-01-26 05:41:57 +00:00
//line templates/rename.qtpl:39
2020-10-02 15:31:59 +00:00
qw422016 := qt422016.AcquireWriter(qq422016)
2021-01-26 05:41:57 +00:00
//line templates/rename.qtpl:39
2020-10-02 15:31:59 +00:00
streamcannotRenameDueToNonExistence(qw422016, hyphaName)
2021-01-26 05:41:57 +00:00
//line templates/rename.qtpl:39
2020-10-02 15:31:59 +00:00
qt422016.ReleaseWriter(qw422016)
2021-01-26 05:41:57 +00:00
//line templates/rename.qtpl:39
2020-10-02 15:31:59 +00:00
}
2021-01-26 05:41:57 +00:00
//line templates/rename.qtpl:39
2020-10-02 15:31:59 +00:00
func cannotRenameDueToNonExistence(hyphaName string) string {
2021-01-26 05:41:57 +00:00
//line templates/rename.qtpl:39
2020-10-02 15:31:59 +00:00
qb422016 := qt422016.AcquireByteBuffer()
2021-01-26 05:41:57 +00:00
//line templates/rename.qtpl:39
2020-10-02 15:31:59 +00:00
writecannotRenameDueToNonExistence(qb422016, hyphaName)
2021-01-26 05:41:57 +00:00
//line templates/rename.qtpl:39
2020-10-02 15:31:59 +00:00
qs422016 := string(qb422016.B)
2021-01-26 05:41:57 +00:00
//line templates/rename.qtpl:39
2020-10-02 15:31:59 +00:00
qt422016.ReleaseByteBuffer(qb422016)
2021-01-26 05:41:57 +00:00
//line templates/rename.qtpl:39
2020-10-02 15:31:59 +00:00
return qs422016
2021-01-26 05:41:57 +00:00
//line templates/rename.qtpl:39
2020-10-02 15:31:59 +00:00
}