Exemplo n.º 1
0
func Plain1(c *twist.Context, id string) *Plain1_T {

	t := twist.GetTemplateByPath("html_content_plain1")
	t.Path = "html_content_plain1"
	t.Writer = c.Writer
	t.Id = id

	c.Writer.RegisterTemplate(t)

	v2 := twist.NewTextItem(`` + "\n" + `	This is a page using the plain_template.html file.` + "\n" + ``)
	v1 := twist.NewItem("p", map[string]string{}, map[string]string{}, []*twist.Item{v2})
	v3 := twist.NewTextItem(`` + "\n" + ``)
	v5 := twist.NewTextItem(`` + "\n" + `	Here's a counter:` + "\n" + ``)
	v4 := twist.NewItem("p", map[string]string{}, map[string]string{}, []*twist.Item{v5})
	v6 := twist.NewTextItem(`` + "\n" + ``)
	v8 := twist.NewTextItem(`` + "\n" + `	0` + "\n" + ``)
	v7 := twist.NewItemId("h1", t, c.Writer, "Output", map[string]string{}, map[string]string{}, []*twist.Item{v8})
	v9 := twist.NewTextItem(`` + "\n" + ``)
	v17 := twist.NewTextItem(`` + "\n" + ``)
	v16 := twist.NewTextItem(`minus`)
	v15 := twist.NewItemId("a", t, c.Writer, "Minus", map[string]string{"href": "#"}, map[string]string{}, []*twist.Item{v16})
	v14 := twist.NewTextItem(` or `)
	v13 := twist.NewTextItem(`plus`)
	v12 := twist.NewItemId("a", t, c.Writer, "Plus", map[string]string{"href": "#"}, map[string]string{}, []*twist.Item{v13})
	v11 := twist.NewTextItem(`` + "\n" + `	Click `)
	v10 := twist.NewItem("p", map[string]string{}, map[string]string{}, []*twist.Item{v11, v12, v14, v15, v17})
	v18 := twist.NewTextItem(`` + "\n" + ``)
	v19 := twist.NewItemId("input", t, c.Writer, "Count", map[string]string{"type": "hidden"}, map[string]string{}, []*twist.Item{})

	t.Contents = []*twist.Item{v1, v3, v4, v6, v7, v9, v10, v18, v19}

	return &Plain1_T{
		name:     t.Name,
		Template: t,

		Output: v7,

		Plus: v12,

		Minus: v15,

		Count: v19,
	}
}
Exemplo n.º 2
0
func Navigation(c *twist.Context, id string) *Navigation_T {

	t := twist.GetTemplateByPath("html_misc_navigation")
	t.Path = "html_misc_navigation"
	t.Writer = c.Writer
	t.Id = id

	c.Writer.RegisterTemplate(t)

	v20 := twist.NewTextItem(`` + "\n" + ``)
	v19 := twist.NewTextItem(`Red page 3`)
	v18 := twist.NewItemId("a", t, c.Writer, "red3Link", map[string]string{}, map[string]string{}, []*twist.Item{v19})
	v17 := twist.NewTextItem(` |` + "\n" + `	`)
	v16 := twist.NewTextItem(`Red page 2`)
	v15 := twist.NewItemId("a", t, c.Writer, "red2Link", map[string]string{}, map[string]string{}, []*twist.Item{v16})
	v14 := twist.NewTextItem(` |` + "\n" + `	`)
	v13 := twist.NewTextItem(`Red page 1`)
	v12 := twist.NewItemId("a", t, c.Writer, "red1Link", map[string]string{}, map[string]string{}, []*twist.Item{v13})
	v11 := twist.NewTextItem(` |` + "\n" + `	`)
	v10 := twist.NewTextItem(`Plain page 3`)
	v9 := twist.NewItemId("a", t, c.Writer, "plain3Link", map[string]string{}, map[string]string{}, []*twist.Item{v10})
	v8 := twist.NewTextItem(` |` + "\n" + `	`)
	v7 := twist.NewTextItem(`Plain page 2`)
	v6 := twist.NewItemId("a", t, c.Writer, "plain2Link", map[string]string{}, map[string]string{}, []*twist.Item{v7})
	v5 := twist.NewTextItem(` |` + "\n" + `	`)
	v4 := twist.NewTextItem(`Plain page 1`)
	v3 := twist.NewItemId("a", t, c.Writer, "plain1Link", map[string]string{}, map[string]string{}, []*twist.Item{v4})
	v2 := twist.NewTextItem(`` + "\n" + `	`)
	v1 := twist.NewItem("div", map[string]string{}, map[string]string{" padding": " 5px"}, []*twist.Item{v2, v3, v5, v6, v8, v9, v11, v12, v14, v15, v17, v18, v20})

	t.Contents = []*twist.Item{v1}

	return &Navigation_T{
		name:     t.Name,
		Template: t,

		Plain1Link: v3,

		Plain2Link: v6,

		Plain3Link: v9,

		Red1Link: v12,

		Red2Link: v15,

		Red3Link: v18,
	}
}
Exemplo n.º 3
0
func Plain2(c *twist.Context, id string) *Plain2_T {

	t := twist.GetTemplateByPath("html_content_plain2")
	t.Path = "html_content_plain2"
	t.Writer = c.Writer
	t.Id = id

	c.Writer.RegisterTemplate(t)

	v2 := twist.NewTextItem(`` + "\n" + `	This is the second plain page.` + "\n" + ``)
	v1 := twist.NewItem("p", map[string]string{}, map[string]string{}, []*twist.Item{v2})

	t.Contents = []*twist.Item{v1}

	return &Plain2_T{
		name:     t.Name,
		Template: t,
	}
}
Exemplo n.º 4
0
func Red3(c *twist.Context, id string) *Red3_T {

	t := twist.GetTemplateByPath("html_content_red3")
	t.Path = "html_content_red3"
	t.Writer = c.Writer
	t.Id = id

	c.Writer.RegisterTemplate(t)

	v2 := twist.NewTextItem(`` + "\n" + `	This is another red page.` + "\n" + ``)
	v1 := twist.NewItem("p", map[string]string{}, map[string]string{}, []*twist.Item{v2})

	t.Contents = []*twist.Item{v1}

	return &Red3_T{
		name:     t.Name,
		Template: t,
	}
}