cerrado @ 2fb43cc1271572d26298da70f823814cae87a3a0

  1// Code generated by qtc from "gititemblob.qtpl". DO NOT EDIT.
  2// See https://github.com/valyala/quicktemplate for details.
  3
  4//line templates/gititemblob.qtpl:1
  5package templates
  6
  7//line templates/gititemblob.qtpl:1
  8import "git.gabrielgio.me/cerrado/pkg/u"
  9
 10//line templates/gititemblob.qtpl:3
 11import (
 12	qtio422016 "io"
 13
 14	qt422016 "github.com/valyala/quicktemplate"
 15)
 16
 17//line templates/gititemblob.qtpl:3
 18var (
 19	_ = qtio422016.Copy
 20	_ = qt422016.AcquireByteBuffer
 21)
 22
 23//line templates/gititemblob.qtpl:4
 24type GitItemBlobPage struct {
 25	Path    []string
 26	Content []byte
 27}
 28
 29//line templates/gititemblob.qtpl:10
 30func (g *GitItemBlobPage) StreamNav(qw422016 *qt422016.Writer, name, ref string) {
 31//line templates/gititemblob.qtpl:10
 32	StreamGitItemNav(qw422016, name, ref, Tree)
 33//line templates/gititemblob.qtpl:10
 34}
 35
 36//line templates/gititemblob.qtpl:10
 37func (g *GitItemBlobPage) WriteNav(qq422016 qtio422016.Writer, name, ref string) {
 38//line templates/gititemblob.qtpl:10
 39	qw422016 := qt422016.AcquireWriter(qq422016)
 40//line templates/gititemblob.qtpl:10
 41	g.StreamNav(qw422016, name, ref)
 42//line templates/gititemblob.qtpl:10
 43	qt422016.ReleaseWriter(qw422016)
 44//line templates/gititemblob.qtpl:10
 45}
 46
 47//line templates/gititemblob.qtpl:10
 48func (g *GitItemBlobPage) Nav(name, ref string) string {
 49//line templates/gititemblob.qtpl:10
 50	qb422016 := qt422016.AcquireByteBuffer()
 51//line templates/gititemblob.qtpl:10
 52	g.WriteNav(qb422016, name, ref)
 53//line templates/gititemblob.qtpl:10
 54	qs422016 := string(qb422016.B)
 55//line templates/gititemblob.qtpl:10
 56	qt422016.ReleaseByteBuffer(qb422016)
 57//line templates/gititemblob.qtpl:10
 58	return qs422016
 59//line templates/gititemblob.qtpl:10
 60}
 61
 62//line templates/gititemblob.qtpl:12
 63func (g *GitItemBlobPage) StreamGitContent(qw422016 *qt422016.Writer, name, ref string) {
 64//line templates/gititemblob.qtpl:12
 65	qw422016.N().S(`
 66<div class="pathing">
 67    `)
 68//line templates/gititemblob.qtpl:15
 69	if len(g.Path) != 0 {
 70//line templates/gititemblob.qtpl:15
 71		qw422016.N().S(`<a href="`)
 72//line templates/gititemblob.qtpl:16
 73		qw422016.E().S(url(name, Folder, ref, Root, []string{}))
 74//line templates/gititemblob.qtpl:16
 75		qw422016.N().S(`">root/</a>`)
 76//line templates/gititemblob.qtpl:17
 77		for i, e := range g.Path[:len(g.Path)-1] {
 78//line templates/gititemblob.qtpl:17
 79			qw422016.N().S(`<a href="`)
 80//line templates/gititemblob.qtpl:18
 81			qw422016.E().S(url(name, Folder, ref, Root, g.Path[:1+i]))
 82//line templates/gititemblob.qtpl:18
 83			qw422016.N().S(`">`)
 84//line templates/gititemblob.qtpl:18
 85			qw422016.E().S(e)
 86//line templates/gititemblob.qtpl:18
 87			qw422016.N().S(`/</a>`)
 88//line templates/gititemblob.qtpl:19
 89		}
 90//line templates/gititemblob.qtpl:19
 91		qw422016.N().S(`<a>`)
 92//line templates/gititemblob.qtpl:20
 93		qw422016.E().S(u.LastOrZero(g.Path))
 94//line templates/gititemblob.qtpl:20
 95		qw422016.N().S(`</a>`)
 96//line templates/gititemblob.qtpl:21
 97	} else {
 98//line templates/gititemblob.qtpl:21
 99		qw422016.N().S(`<a>root/</a>`)
100//line templates/gititemblob.qtpl:23
101	}
102//line templates/gititemblob.qtpl:24
103	qw422016.N().S(`
104</div>
105<div class="code-view">
106`)
107//line templates/gititemblob.qtpl:27
108	qw422016.N().Z(g.Content)
109//line templates/gititemblob.qtpl:27
110	qw422016.N().S(`
111</div>
112`)
113//line templates/gititemblob.qtpl:29
114}
115
116//line templates/gititemblob.qtpl:29
117func (g *GitItemBlobPage) WriteGitContent(qq422016 qtio422016.Writer, name, ref string) {
118//line templates/gititemblob.qtpl:29
119	qw422016 := qt422016.AcquireWriter(qq422016)
120//line templates/gititemblob.qtpl:29
121	g.StreamGitContent(qw422016, name, ref)
122//line templates/gititemblob.qtpl:29
123	qt422016.ReleaseWriter(qw422016)
124//line templates/gititemblob.qtpl:29
125}
126
127//line templates/gititemblob.qtpl:29
128func (g *GitItemBlobPage) GitContent(name, ref string) string {
129//line templates/gititemblob.qtpl:29
130	qb422016 := qt422016.AcquireByteBuffer()
131//line templates/gititemblob.qtpl:29
132	g.WriteGitContent(qb422016, name, ref)
133//line templates/gititemblob.qtpl:29
134	qs422016 := string(qb422016.B)
135//line templates/gititemblob.qtpl:29
136	qt422016.ReleaseByteBuffer(qb422016)
137//line templates/gititemblob.qtpl:29
138	return qs422016
139//line templates/gititemblob.qtpl:29
140}