// Code generated by qtc from "gititemtree.qtpl". DO NOT EDIT. // See https://github.com/valyala/quicktemplate for details. //line templates/gititemtree.qtpl:1 package templates //line templates/gititemtree.qtpl:1 import "git.gabrielgio.me/cerrado/pkg/u" //line templates/gititemtree.qtpl:2 import "github.com/go-git/go-git/v5/plumbing/object" //line templates/gititemtree.qtpl:3 import "github.com/go-git/go-git/v5/plumbing/filemode" //line templates/gititemtree.qtpl:5 import ( qtio422016 "io" qt422016 "github.com/valyala/quicktemplate" ) //line templates/gititemtree.qtpl:5 var ( _ = qtio422016.Copy _ = qt422016.AcquireByteBuffer ) //line templates/gititemtree.qtpl:5 type GitItemTreePage struct { Path []string Tree *object.Tree } //line templates/gititemtree.qtpl:11 const ( Folder = "tree" Blob = "blob" Root = "" ) //line templates/gititemtree.qtpl:18 func url(name, mode, ref, filename string, path []string) string { return u.NewPathing(). AddPath(name). AddPath(mode). AddPath(ref). AddPaths(path). AddPath(filename). Done() } //line templates/gititemtree.qtpl:29 func (g *GitItemTreePage) StreamNav(qw422016 *qt422016.Writer, name, ref string) { //line templates/gititemtree.qtpl:29 StreamGitItemNav(qw422016, name, ref, Tree) //line templates/gititemtree.qtpl:29 } //line templates/gititemtree.qtpl:29 func (g *GitItemTreePage) WriteNav(qq422016 qtio422016.Writer, name, ref string) { //line templates/gititemtree.qtpl:29 qw422016 := qt422016.AcquireWriter(qq422016) //line templates/gititemtree.qtpl:29 g.StreamNav(qw422016, name, ref) //line templates/gititemtree.qtpl:29 qt422016.ReleaseWriter(qw422016) //line templates/gititemtree.qtpl:29 } //line templates/gititemtree.qtpl:29 func (g *GitItemTreePage) Nav(name, ref string) string { //line templates/gititemtree.qtpl:29 qb422016 := qt422016.AcquireByteBuffer() //line templates/gititemtree.qtpl:29 g.WriteNav(qb422016, name, ref) //line templates/gititemtree.qtpl:29 qs422016 := string(qb422016.B) //line templates/gititemtree.qtpl:29 qt422016.ReleaseByteBuffer(qb422016) //line templates/gititemtree.qtpl:29 return qs422016 //line templates/gititemtree.qtpl:29 } //line templates/gititemtree.qtpl:31 func (g *GitItemTreePage) StreamGitContent(qw422016 *qt422016.Writer, name, ref string) { //line templates/gititemtree.qtpl:31 qw422016.N().S(`
`) //line templates/gititemtree.qtpl:34 if len(g.Path) != 0 { //line templates/gititemtree.qtpl:34 qw422016.N().S(`root/`) //line templates/gititemtree.qtpl:36 for i, e := range g.Path[:len(g.Path)-1] { //line templates/gititemtree.qtpl:36 qw422016.N().S(``) //line templates/gititemtree.qtpl:37 qw422016.E().S(e) //line templates/gititemtree.qtpl:37 qw422016.N().S(`/`) //line templates/gititemtree.qtpl:38 } //line templates/gititemtree.qtpl:38 qw422016.N().S(``) //line templates/gititemtree.qtpl:39 qw422016.E().S(u.LastOrZero(g.Path)) //line templates/gititemtree.qtpl:39 qw422016.N().S(``) //line templates/gititemtree.qtpl:40 } else { //line templates/gititemtree.qtpl:40 qw422016.N().S(`root/`) //line templates/gititemtree.qtpl:42 } //line templates/gititemtree.qtpl:43 qw422016.N().S(`
`) //line templates/gititemtree.qtpl:48 if len(g.Path) != 0 { //line templates/gititemtree.qtpl:48 qw422016.N().S(`
`) //line templates/gititemtree.qtpl:54 } //line templates/gititemtree.qtpl:54 qw422016.N().S(` `) //line templates/gititemtree.qtpl:55 for _, e := range g.Tree.Entries { //line templates/gititemtree.qtpl:55 qw422016.N().S(` `) //line templates/gititemtree.qtpl:56 if e.Mode.IsFile() { //line templates/gititemtree.qtpl:56 qw422016.N().S(`
`) //line templates/gititemtree.qtpl:57 qw422016.E().S(Ignore(e.Mode.ToOSFileMode()).String()) //line templates/gititemtree.qtpl:57 qw422016.N().S(`
`) //line templates/gititemtree.qtpl:59 } else if e.Mode == filemode.Submodule { //line templates/gititemtree.qtpl:59 qw422016.N().S(`
m---------
`) //line templates/gititemtree.qtpl:61 qw422016.E().S(e.Name) //line templates/gititemtree.qtpl:61 qw422016.N().S(` (submodule)
`) //line templates/gititemtree.qtpl:62 } else { //line templates/gititemtree.qtpl:62 qw422016.N().S(`
d---------
`) //line templates/gititemtree.qtpl:65 } //line templates/gititemtree.qtpl:65 qw422016.N().S(`
`) //line templates/gititemtree.qtpl:68 qw422016.N().DL(Ignore(g.Tree.Size(e.Name))) //line templates/gititemtree.qtpl:68 qw422016.N().S(` KiB
`) //line templates/gititemtree.qtpl:69 } //line templates/gititemtree.qtpl:69 qw422016.N().S(`
`) //line templates/gititemtree.qtpl:73 } //line templates/gititemtree.qtpl:73 func (g *GitItemTreePage) WriteGitContent(qq422016 qtio422016.Writer, name, ref string) { //line templates/gititemtree.qtpl:73 qw422016 := qt422016.AcquireWriter(qq422016) //line templates/gititemtree.qtpl:73 g.StreamGitContent(qw422016, name, ref) //line templates/gititemtree.qtpl:73 qt422016.ReleaseWriter(qw422016) //line templates/gititemtree.qtpl:73 } //line templates/gititemtree.qtpl:73 func (g *GitItemTreePage) GitContent(name, ref string) string { //line templates/gititemtree.qtpl:73 qb422016 := qt422016.AcquireByteBuffer() //line templates/gititemtree.qtpl:73 g.WriteGitContent(qb422016, name, ref) //line templates/gititemtree.qtpl:73 qs422016 := string(qb422016.B) //line templates/gititemtree.qtpl:73 qt422016.ReleaseByteBuffer(qb422016) //line templates/gititemtree.qtpl:73 return qs422016 //line templates/gititemtree.qtpl:73 }