Exemplo n.º 1
0
func (t Index_html) RenderBlock_content(c templates.RenderContext) error {
	if _, err := c.WriteString("<p>"); err != nil {
		return err
	}

	if _, err := c.WriteString(t.i18n.GetText("Put your content here.")); err != nil {
		return err
	}

	for _, authorCard := range t.authorCards {
		c.WriteString("\n<li>")
		authorCard.Render(c)
		c.WriteString("</li>")
	}

	if _, err := c.WriteString("</p>"); err != nil {
		return err
	}
	return nil
}
Exemplo n.º 2
0
func (self *AuthorCard) Render(c templates.RenderContext) {
	c.WriteString("<div>\nAuthor: ")
	self.component.WhenDataReady()
	//	log.Print("Render: " + self.Author.Name)
	c.WriteString(self.author.Name)
	c.WriteString("\n</div>")
}
Exemplo n.º 3
0
func (t layout_html_struct) RenderBlock_content(c templates.RenderContext) error {
	_, err := c.WriteString("{BLOCK content}")
	return err
}
Exemplo n.º 4
0
func (t layout_html_struct) RenderBlock_page_title(c templates.RenderContext) error {
	_, err := c.WriteString("{BLOCK page_title}")
	return err
}
Exemplo n.º 5
0
func (layout layout_html_struct) Render(c templates.RenderContext, payload Payload_Layout_html) error {
	if _, err := c.WriteString("<!DOCTYPE html>\n<html>\n<head>\n<title>"); err != nil {
		return err
	}
	if err := layout.template.RenderBlock_head_title(c); err != nil {
		return err
	}
	c.WriteString("</title>\n</head>\n<body style=\"background-color: ")
	c.WriteString(payload.BgColor)
	c.WriteString(";\">\n<h1>")
	if _, err := c.WriteString(layout.i18n.GetText("Welcome to page")); err != nil {
		return err
	}
	c.WriteString(" ")
	if err := layout.template.RenderBlock_page_title(c); err != nil {
		return err
	}
	c.WriteString("\n<h1>\n")
	if err := layout.template.RenderBlock_menu(c); err != nil {
		return err
	}
	c.WriteString("\n<hr/>\n")
	if err := layout.template.RenderBlock_content(c); err != nil {
		return err
	}
	c.WriteString("\n</body>\n</html>") // Lines 10:11
	return nil
}
Exemplo n.º 6
0
func (t Index_html) RenderBlock_page_title(c templates.RenderContext) error {
	_, err := c.WriteString("Index.html!")
	return err
}