//line templates/tablepage.qtpl:51
429698
func emitRows(rows []string) string {
	
	qb422016 := qt422016.AcquireByteBuffer()
	
	writeemitRows(qb422016, rows)
	
	qs422016 := string(qb422016.B)
	
	qt422016.ReleaseByteBuffer(qb422016)
	
	return qs422016

}
1318620
func defaultRouteTemplate(a *design.ActionDefinition) string {
	return design.WildcardRegex.ReplaceAllLiteralString(a.Routes[0].FullPath(), "/%v")
}
1105123
func (db *DB) page(id pgid) *page {
	pos := id * pgid(db.pageSize)
	return (*page)(unsafe.Pointer(&db.data[pos]))
}
30001
func (p *MainPage) StreamBody(qw422016 *qt422016.Writer) {
	
	qw422016.N().S(`
	<h1>Main page</h1>
	<div>
		Click links below:
		<ul>
			<li><a href="/table?rowsCount=42">Table page</a></li>
			<li><a href="/unknown-page">Error page</a></li>
		</ul>
	</div>
	<div>
		Some info about you:<br/>
		IP: <b>`)
	//line templates/mainpage.qtpl:28
	qw422016.E().S(p.CTX.RemoteIP().String())
	//line templates/mainpage.qtpl:28
	qw422016.N().S(`</b><br/>
		User-Agent: <b>`)
	//line templates/mainpage.qtpl:29
	qw422016.E().Z(p.CTX.UserAgent())
	//line templates/mainpage.qtpl:29
	qw422016.N().S(`</b><br/>
	</div>
`)
//line templates/mainpage.qtpl:31
}
990227
func (p *TablePage) form() string {
	
	qb422016 := qt422016.AcquireByteBuffer()
	
	p.writeform(qb422016)
	
	qs422016 := string(qb422016.B)
	
	qt422016.ReleaseByteBuffer(qb422016)
	
	return qs422016

}
992357
func tmpl(tmpl templateIface) Option {
	return optionFunc(func(opts *options) {
		opts.tmpl = tmpl
	})
}
1332091
func (c *ReactionsListCall) Page(page int) *ReactionsListCall {
	c.page = page
	return c
}
1102722
func (r *Registry) LineNumber(templateName string, node ast.Node) int {
	var src, ok = r.sourceByTemplateName[templateName]
	if !ok {
		log.Println("template not found:", templateName)
		return 0
	}
	return 1 + strings.Count(src[:node.Position()], "\n")
}
874229
func (p *PaginationResponseMeta) nextPage(originalQuery *PaginationMeta) (next *PaginationMeta) {
	nextOffset := p.Offset + p.Length

	if nextOffset >= p.Found {
		return nil
	}

	next = &PaginationMeta{}
	next.Offset = nextOffset
	next.Length = p.Length

	if originalQuery != nil {
		next.OrderBy = originalQuery.OrderBy
		next.Sort = originalQuery.Sort
	}

	return next
}
1173796
func (t *Table) Render() {
	if t.borders.Top {
		t.printLine(true)
	}
	t.printHeading()
	if t.autoMergeCells {
		t.printRowsMergeCells()
	} else {
		t.printRows()
	}
	if !t.rowLine && t.borders.Bottom {
		t.printLine(true)
	}
	t.printFooter()

	if t.caption {
		t.printCaption()
	}
}
171278
func newIPTRuleTemplate(action iptAction, tmpl string) *iptRuleTemplate {
	t, err := template.New("").Parse(tmpl)
	if err != nil {
		panic(fmt.Sprintf("Failed to parse iptables template: %q: %v", tmpl, err))
	}
	return &iptRuleTemplate{action, t}
}
618917
func (t *Table) printFooter() {
	// Check if headers is available
	if len(t.footers) < 1 {
		return
	}

	// Only print line if border is not set
	if !t.borders.Bottom {
		t.printLine(true)
	}

	// Identify last column
	end := len(t.cs) - 1

	// Get pad function
	padFunc := pad(t.fAlign)

	// Checking for ANSI escape sequences for header
	is_esc_seq := false
	if len(t.footerParams) > 0 {
		is_esc_seq = true
	}

	// Maximum height.
	max := t.rs[footerRowIdx]

	// Print Footer
	erasePad := make([]bool, len(t.footers))
	for x := 0; x < max; x++ {
		// Check if border is set
		// Replace with space if not set
		fmt.Fprint(t.out, ConditionString(t.borders.Bottom, t.pColumn, SPACE))

		for y := 0; y <= end; y++ {
			v := t.cs[y]
			f := ""
			if y < len(t.footers) && x < len(t.footers[y]) {
				f = t.footers[y][x]
			}
			if t.autoFmt {
				f = Title(f)
			}
			pad := ConditionString((y == end && !t.borders.Top), SPACE, t.pColumn)

			if erasePad[y] || (x == 0 && len(f) == 0) {
				pad = SPACE
				erasePad[y] = true
			}

			if is_esc_seq {
				fmt.Fprintf(t.out, " %s %s",
					format(padFunc(f, SPACE, v),
						t.footerParams[y]), pad)
			} else {
				fmt.Fprintf(t.out, " %s %s",
					padFunc(f, SPACE, v),
					pad)
			}

			//fmt.Fprintf(t.out, " %s %s",
			//	padFunc(f, SPACE, v),
			//	pad)
		}
		// Next line
		fmt.Fprint(t.out, t.newLine)
		//t.printLine(true)
	}

	hasPrinted := false

	for i := 0; i <= end; i++ {
		v := t.cs[i]
		pad := t.pRow
		center := t.pCenter
		length := len(t.footers[i][0])

		if length > 0 {
			hasPrinted = true
		}

		// Set center to be space if length is 0
		if length == 0 && !t.borders.Right {
			center = SPACE
		}

		// Print first junction
		if i == 0 {
			if length > 0 && !t.borders.Left {
				center = t.pRow
			}
			fmt.Fprint(t.out, center)
		}

		// Pad With space of length is 0
		if length == 0 {
			pad = SPACE
		}
		// Ignore left space as it has printed before
		if hasPrinted || t.borders.Left {
			pad = t.pRow
			center = t.pCenter
		}

		// Change Center end position
		if center != SPACE {
			if i == end && !t.borders.Right {
				center = t.pRow
			}
		}

		// Change Center start position
		if center == SPACE {
			if i < end && len(t.footers[i+1][0]) != 0 {
				if !t.borders.Left {
					center = t.pRow
				} else {
					center = t.pCenter
				}
			}
		}

		// Print the footer
		fmt.Fprintf(t.out, "%s%s%s%s",
			pad,
			strings.Repeat(string(pad), v),
			pad,
			center)

	}

	fmt.Fprint(t.out, t.newLine)
}
973278
func PagingPage(p Page, totalRecords int, items interface{}) Page {
	return Paging(p.Page, p.Size, totalRecords, items)
}
786971
func (r *Response) Tpl(name string, data interface{}) error {
	log.Infof("Rendering template %s", name)

	err := renderTpl(r.writer, name, data)
	if err != nil {
		r.Status = http.StatusNotFound
		return err
	}

	r.SkipFlush()
	return nil
}
821233
func (p *MainPage) Title() string {
	
	qb422016 := qt422016.AcquireByteBuffer()
	
	p.WriteTitle(qb422016)
	
	qs422016 := string(qb422016.B)
	
	qt422016.ReleaseByteBuffer(qb422016)
	
	return qs422016

}
1322408
func (loader *TemplateLoader) Template(name string) (tmpl Template, err error) {
	runtimeLoader := loader.runtimeLoader.Load().(*templateRuntime)
	return runtimeLoader.TemplateLang(name, "")
}
329011
func (into *ListOptions) GetNextPage(from interface{}) error {
	if reflect.TypeOf(from).Kind() != reflect.Slice {
		return fmt.Errorf("provided interface{} does not represent a slice")
	}

	slice := reflect.ValueOf(from)
	if slice.Len() == 0 {
		return fmt.Errorf("provided interface{} is a zero sized slice")
	}

	lastElem := slice.Index(slice.Len() - 1).Interface()
	has, _ := reflections.HasField(lastElem, "Number")
	if !has {
		return fmt.Errorf("last element of the provided slice does not have a Number attribute")
	}

	value, err := reflections.GetField(lastElem, "Number")
	if err != nil {
		return err
	}

	// We rely on travis sending us numbers representations here
	// so no real need to check for errors
	number, _ := strconv.ParseUint(value.(string), 10, 64)
	into.AfterNumber = uint(math.Max(float64(number), 0))

	return nil
}