// This file is automatically generated by qtc from "edit.qtpl".
// See https://github.com/valyala/quicktemplate for details.

//line edit.qtpl:1
package templates

//line edit.qtpl:1
import "todo/models"

//line edit.qtpl:3
import (
	qtio422016 "io"

	qt422016 "github.com/valyala/quicktemplate"
)

//line edit.qtpl:3
var (
	_ = qtio422016.Copy
	_ = qt422016.AcquireByteBuffer
)

//line edit.qtpl:4
type EditPage struct {
	Todos       []models.Todo
	EditingTodo models.Todo
}

//line edit.qtpl:10
func (p *EditPage) StreamTitle(qw422016 *qt422016.Writer) {
	//line edit.qtpl:10
	qw422016.N().S(`
Todo
`)
//line edit.qtpl:12
}

//line edit.qtpl:12
func (p *EditPage) WriteTitle(qq422016 qtio422016.Writer) {
	//line edit.qtpl:12
	qw422016 := qt422016.AcquireWriter(qq422016)
	//line edit.qtpl:12
	p.StreamTitle(qw422016)
	//line edit.qtpl:12
	qt422016.ReleaseWriter(qw422016)
//line edit.qtpl:12
}

//line edit.qtpl:12
func (p *EditPage) Title() string {
	//line edit.qtpl:12
	qb422016 := qt422016.AcquireByteBuffer()
	//line edit.qtpl:12
	p.WriteTitle(qb422016)
	//line edit.qtpl:12
	qs422016 := string(qb422016.B)
	//line edit.qtpl:12
	qt422016.ReleaseByteBuffer(qb422016)
	//line edit.qtpl:12
	return qs422016
//line edit.qtpl:12
}

//line edit.qtpl:14
func (p *EditPage) StreamStylesheets(qw422016 *qt422016.Writer) {
	//line edit.qtpl:14
	qw422016.N().S(`
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/skeleton/2.0.4/skeleton.min.css">
<link rel="stylesheet" type="text/css" href="/static/custom.css">
`)
//line edit.qtpl:17
}

//line edit.qtpl:17
func (p *EditPage) WriteStylesheets(qq422016 qtio422016.Writer) {
	//line edit.qtpl:17
	qw422016 := qt422016.AcquireWriter(qq422016)
	//line edit.qtpl:17
	p.StreamStylesheets(qw422016)
	//line edit.qtpl:17
	qt422016.ReleaseWriter(qw422016)
//line edit.qtpl:17
}

//line edit.qtpl:17
func (p *EditPage) Stylesheets() string {
	//line edit.qtpl:17
	qb422016 := qt422016.AcquireByteBuffer()
	//line edit.qtpl:17
	p.WriteStylesheets(qb422016)
	//line edit.qtpl:17
	qs422016 := string(qb422016.B)
	//line edit.qtpl:17
	qt422016.ReleaseByteBuffer(qb422016)
	//line edit.qtpl:17
	return qs422016
//line edit.qtpl:17
}

//line edit.qtpl:19
func (p *EditPage) StreamScripts(qw422016 *qt422016.Writer) {
	//line edit.qtpl:19
	qw422016.N().S(`
`)
//line edit.qtpl:20
}

//line edit.qtpl:20
func (p *EditPage) WriteScripts(qq422016 qtio422016.Writer) {
	//line edit.qtpl:20
	qw422016 := qt422016.AcquireWriter(qq422016)
	//line edit.qtpl:20
	p.StreamScripts(qw422016)
	//line edit.qtpl:20
	qt422016.ReleaseWriter(qw422016)
//line edit.qtpl:20
}

//line edit.qtpl:20
func (p *EditPage) Scripts() string {
	//line edit.qtpl:20
	qb422016 := qt422016.AcquireByteBuffer()
	//line edit.qtpl:20
	p.WriteScripts(qb422016)
	//line edit.qtpl:20
	qs422016 := string(qb422016.B)
	//line edit.qtpl:20
	qt422016.ReleaseByteBuffer(qb422016)
	//line edit.qtpl:20
	return qs422016
//line edit.qtpl:20
}

//line edit.qtpl:22
func (p *EditPage) StreamBody(qw422016 *qt422016.Writer) {
	//line edit.qtpl:22
	qw422016.N().S(`
<div class="container">
    <a href="/" class="title"><h1>TODO in Golang</h1></a>
    <form action="/update/`)
	//line edit.qtpl:25
	qw422016.N().D(p.EditingTodo.Id)
	//line edit.qtpl:25
	qw422016.N().S(`" method="post">
        <div class="row">
            <div class="nine columns">
                <input type="text" class="u-full-width" name="todo" id="todo" value="`)
	//line edit.qtpl:28
	qw422016.E().S(p.EditingTodo.Todo)
	//line edit.qtpl:28
	qw422016.N().S(`">
            </div>
            <div class="three columns">
                <input type="submit" class="button-primary u-full-width" value="Update">
            </div>
        </div>
    </form>

    `)
	//line edit.qtpl:36
	for _, todo := range p.Todos {
		//line edit.qtpl:36
		qw422016.N().S(`
    <div class="row">
            <div class="one column">
                <form action="/undo/`)
		//line edit.qtpl:39
		qw422016.N().D(todo.Id)
		//line edit.qtpl:39
		qw422016.N().S(`" method="post">
                    `)
		//line edit.qtpl:40
		StreamGetDoneButton(qw422016, todo.Done)
		//line edit.qtpl:40
		qw422016.N().S(`
                </form>
            </div>
            <div class="seven columns">
                <p>`)
		//line edit.qtpl:44
		qw422016.E().S(todo.Todo)
		//line edit.qtpl:44
		qw422016.N().S(`</p>
            </div>
            `)
		//line edit.qtpl:46
		if todo.Id == p.EditingTodo.Id {
			//line edit.qtpl:46
			qw422016.N().S(`
            <div class="two columns">
                <input type="submit" disabled="disabled" class="u-full-width" value="Editing">
            </div>
            `)
			//line edit.qtpl:50
		} else {
			//line edit.qtpl:50
			qw422016.N().S(`
            <div class="two columns">
                <form action="/edit/`)
			//line edit.qtpl:52
			qw422016.N().D(todo.Id)
			//line edit.qtpl:52
			qw422016.N().S(`">
                    <input type="submit" class="button-primary u-full-width" value="Edit">
                </form>
            </div>
            `)
			//line edit.qtpl:56
		}
		//line edit.qtpl:56
		qw422016.N().S(`
            <div class="two columns">
                <form action="/undo/`)
		//line edit.qtpl:58
		qw422016.N().D(todo.Id)
		//line edit.qtpl:58
		qw422016.N().S(`" method="post">
                    <input type="submit" class="button-red u-full-width" value="Delete">
                </form>
            </div>
    </div>
    `)
		//line edit.qtpl:63
	}
	//line edit.qtpl:63
	qw422016.N().S(`

</div>
`)
//line edit.qtpl:66
}

//line edit.qtpl:66
func (p *EditPage) WriteBody(qq422016 qtio422016.Writer) {
	//line edit.qtpl:66
	qw422016 := qt422016.AcquireWriter(qq422016)
	//line edit.qtpl:66
	p.StreamBody(qw422016)
	//line edit.qtpl:66
	qt422016.ReleaseWriter(qw422016)
//line edit.qtpl:66
}

//line edit.qtpl:66
func (p *EditPage) Body() string {
	//line edit.qtpl:66
	qb422016 := qt422016.AcquireByteBuffer()
	//line edit.qtpl:66
	p.WriteBody(qb422016)
	//line edit.qtpl:66
	qs422016 := string(qb422016.B)
	//line edit.qtpl:66
	qt422016.ReleaseByteBuffer(qb422016)
	//line edit.qtpl:66
	return qs422016
//line edit.qtpl:66
}
