Example #1
0
func Render_t_book(c djingo.DjingoContext, book data.Book) {
	c.WriteString("<div><h3><a href=\"/book/")
	c.WriteString(strconv.Itoa(book.Id))
	c.WriteString(">")
	c.WriteString(book.Title)
	c.WriteString("</a></h3>")
}
Example #2
0
func Render_t_authors(c djingo.DjingoContext, authors []data.Author) {
	c.WriteString("<ul>")
	for _, author := range authors {
		c.WriteString("<li>")
		Render_t_author(c, author)
		c.WriteString("</li>")
	}
	c.WriteString("</ul>")
}
Example #3
0
func Render_t_author(c djingo.DjingoContext, author data.Author) {
	c.WriteString("<div><h2><a href=\"/author/")
	c.WriteString(strconv.Itoa(author.Id))
	c.WriteString("\">")
	c.WriteString(author.FirstName)
	c.WriteString(" ")
	c.WriteString(author.LastName)
	c.WriteString("</a></h2><ul>")
	for _, book := range author.Books {
		Render_t_book(c, book)
	}
	c.WriteString("</ul></div>")
}