github.com/kyleu/dbaudit@v0.0.2-0.20240321155047-ff2f2c940496/views/vfile/List.html.go (about) 1 // Code generated by qtc from "List.html". DO NOT EDIT. 2 // See https://github.com/valyala/quicktemplate for details. 3 4 // <!-- Content managed by Project Forge, see [projectforge.md] for details. --> 5 6 //line views/vfile/List.html:2 7 package vfile 8 9 //line views/vfile/List.html:2 10 import ( 11 "path/filepath" 12 13 "github.com/kyleu/dbaudit/app" 14 "github.com/kyleu/dbaudit/app/controller/cutil" 15 "github.com/kyleu/dbaudit/app/lib/filesystem" 16 "github.com/kyleu/dbaudit/views/components" 17 ) 18 19 //line views/vfile/List.html:11 20 import ( 21 qtio422016 "io" 22 23 qt422016 "github.com/valyala/quicktemplate" 24 ) 25 26 //line views/vfile/List.html:11 27 var ( 28 _ = qtio422016.Copy 29 _ = qt422016.AcquireByteBuffer 30 ) 31 32 //line views/vfile/List.html:11 33 func StreamList(qw422016 *qt422016.Writer, path []string, files filesystem.FileInfos, fl filesystem.FileLoader, urlPrefix string, as *app.State, ps *cutil.PageState) { 34 //line views/vfile/List.html:11 35 qw422016.N().S(` 36 <h3><a href="`) 37 //line views/vfile/List.html:12 38 qw422016.E().S(urlPrefix) 39 //line views/vfile/List.html:12 40 qw422016.N().S(`">.</a>`) 41 //line views/vfile/List.html:12 42 for idx, p := range path { 43 //line views/vfile/List.html:12 44 qw422016.N().S(`/<a href="`) 45 //line views/vfile/List.html:12 46 qw422016.E().S(urlPrefix) 47 //line views/vfile/List.html:12 48 qw422016.N().S(`/`) 49 //line views/vfile/List.html:12 50 qw422016.E().S(filepath.Join(path[:idx+1]...)) 51 //line views/vfile/List.html:12 52 qw422016.N().S(`">`) 53 //line views/vfile/List.html:12 54 qw422016.E().S(p) 55 //line views/vfile/List.html:12 56 qw422016.N().S(`</a>`) 57 //line views/vfile/List.html:12 58 } 59 //line views/vfile/List.html:12 60 qw422016.N().S(`</h3> 61 <div class="mt"> 62 `) 63 //line views/vfile/List.html:14 64 for _, f := range files { 65 //line views/vfile/List.html:16 66 icon := "file" 67 if f.IsDir { 68 icon = "folder" 69 } 70 x := []string{urlPrefix} 71 x = append(x, path...) 72 x = append(x, f.Name) 73 u := filepath.Join(x...) 74 75 //line views/vfile/List.html:24 76 qw422016.N().S(` <div><a href="`) 77 //line views/vfile/List.html:25 78 qw422016.E().S(u) 79 //line views/vfile/List.html:25 80 qw422016.N().S(`">`) 81 //line views/vfile/List.html:25 82 components.StreamSVGRef(qw422016, icon, 16, 16, `icon`, ps) 83 //line views/vfile/List.html:25 84 qw422016.E().S(f.Name) 85 //line views/vfile/List.html:25 86 qw422016.N().S(`</a></div> 87 `) 88 //line views/vfile/List.html:26 89 } 90 //line views/vfile/List.html:26 91 qw422016.N().S(` </div> 92 `) 93 //line views/vfile/List.html:28 94 } 95 96 //line views/vfile/List.html:28 97 func WriteList(qq422016 qtio422016.Writer, path []string, files filesystem.FileInfos, fl filesystem.FileLoader, urlPrefix string, as *app.State, ps *cutil.PageState) { 98 //line views/vfile/List.html:28 99 qw422016 := qt422016.AcquireWriter(qq422016) 100 //line views/vfile/List.html:28 101 StreamList(qw422016, path, files, fl, urlPrefix, as, ps) 102 //line views/vfile/List.html:28 103 qt422016.ReleaseWriter(qw422016) 104 //line views/vfile/List.html:28 105 } 106 107 //line views/vfile/List.html:28 108 func List(path []string, files filesystem.FileInfos, fl filesystem.FileLoader, urlPrefix string, as *app.State, ps *cutil.PageState) string { 109 //line views/vfile/List.html:28 110 qb422016 := qt422016.AcquireByteBuffer() 111 //line views/vfile/List.html:28 112 WriteList(qb422016, path, files, fl, urlPrefix, as, ps) 113 //line views/vfile/List.html:28 114 qs422016 := string(qb422016.B) 115 //line views/vfile/List.html:28 116 qt422016.ReleaseByteBuffer(qb422016) 117 //line views/vfile/List.html:28 118 return qs422016 119 //line views/vfile/List.html:28 120 }