diff options
author | Gabriel A. Giovanini <mail@gabrielgio.me> | 2024-07-07 20:28:42 +0200 |
---|---|---|
committer | Gabriel A. Giovanini <mail@gabrielgio.me> | 2024-07-07 21:44:29 +0200 |
commit | 44bc8e4078a09857ad86691a83e7ba7d4e3a69c4 (patch) | |
tree | 6788cafeaac286d381cc69e1917dab6ae58d1f85 /templates/tags.qtpl.go | |
parent | 8dff852753a1c4a708fd87e3cbb0f4844803aa95 (diff) | |
download | cerrado-44bc8e4078a09857ad86691a83e7ba7d4e3a69c4.tar.gz cerrado-44bc8e4078a09857ad86691a83e7ba7d4e3a69c4.tar.bz2 cerrado-44bc8e4078a09857ad86691a83e7ba7d4e3a69c4.zip |
ref: Simplify path builder code
Diffstat (limited to 'templates/tags.qtpl.go')
-rw-r--r-- | templates/tags.qtpl.go | 154 |
1 files changed, 154 insertions, 0 deletions
diff --git a/templates/tags.qtpl.go b/templates/tags.qtpl.go new file mode 100644 index 0000000..7d8eca8 --- /dev/null +++ b/templates/tags.qtpl.go @@ -0,0 +1,154 @@ +// Code generated by qtc from "tags.qtpl". DO NOT EDIT. +// See https://github.com/valyala/quicktemplate for details. + +//line tags.qtpl:1 +package templates + +//line tags.qtpl:1 +import "git.gabrielgio.me/cerrado/pkg/git" + +//line tags.qtpl:3 +import ( + qtio422016 "io" + + qt422016 "github.com/valyala/quicktemplate" +) + +//line tags.qtpl:3 +var ( + _ = qtio422016.Copy + _ = qt422016.AcquireByteBuffer +) + +//line tags.qtpl:3 +func StreamListTags(qw422016 *qt422016.Writer, name string, tags []*git.TagReference) { +//line tags.qtpl:3 + qw422016.N().S(` +`) +//line tags.qtpl:4 + if len(tags) > 0 { +//line tags.qtpl:4 + qw422016.N().S(` +<div class="event-list"> + `) +//line tags.qtpl:6 + for _, t := range tags { +//line tags.qtpl:6 + qw422016.N().S(` + <div class="event me-md-2"> + <div class="row "> + <div class="col-4"> + <a title="`) +//line tags.qtpl:10 + qw422016.E().S(t.HashString()) +//line tags.qtpl:10 + qw422016.N().S(`" href="/`) +//line tags.qtpl:10 + qw422016.E().S(name) +//line tags.qtpl:10 + qw422016.N().S(`/commit/`) +//line tags.qtpl:10 + qw422016.E().S(t.HashString()) +//line tags.qtpl:10 + qw422016.N().S(`">`) +//line tags.qtpl:10 + qw422016.E().S(t.ShortName()) +//line tags.qtpl:10 + qw422016.N().S(`</a> + </div> + <div class="col-8"> + <div class="float-end"> + <a href="/`) +//line tags.qtpl:14 + qw422016.E().S(name) +//line tags.qtpl:14 + qw422016.N().S(`/archive/`) +//line tags.qtpl:14 + qw422016.E().S(t.ShortName()) +//line tags.qtpl:14 + qw422016.N().S(`.tar.gz">tar.gz</a> + <a href="/`) +//line tags.qtpl:15 + qw422016.E().S(name) +//line tags.qtpl:15 + qw422016.N().S(`/tree/`) +//line tags.qtpl:15 + qw422016.E().S(t.ShortName()) +//line tags.qtpl:15 + qw422016.N().S(`/">tree</a> + <a href="/`) +//line tags.qtpl:16 + qw422016.E().S(name) +//line tags.qtpl:16 + qw422016.N().S(`/log/`) +//line tags.qtpl:16 + qw422016.E().S(t.ShortName()) +//line tags.qtpl:16 + qw422016.N().S(`/">log</a> + </div> + </div> + </div> + `) +//line tags.qtpl:20 + if t.Message() != "" { +//line tags.qtpl:20 + qw422016.N().S(` + <div class="code-view"> + <pre>`) +//line tags.qtpl:22 + qw422016.E().S(t.Message()) +//line tags.qtpl:22 + qw422016.N().S(`</pre> + </div> + `) +//line tags.qtpl:24 + } +//line tags.qtpl:24 + qw422016.N().S(` + </div> + `) +//line tags.qtpl:26 + } +//line tags.qtpl:26 + qw422016.N().S(` +</div> +`) +//line tags.qtpl:28 + } else { +//line tags.qtpl:28 + qw422016.N().S(` + <p> No tags </p> +`) +//line tags.qtpl:30 + } +//line tags.qtpl:30 + qw422016.N().S(` +`) +//line tags.qtpl:31 +} + +//line tags.qtpl:31 +func WriteListTags(qq422016 qtio422016.Writer, name string, tags []*git.TagReference) { +//line tags.qtpl:31 + qw422016 := qt422016.AcquireWriter(qq422016) +//line tags.qtpl:31 + StreamListTags(qw422016, name, tags) +//line tags.qtpl:31 + qt422016.ReleaseWriter(qw422016) +//line tags.qtpl:31 +} + +//line tags.qtpl:31 +func ListTags(name string, tags []*git.TagReference) string { +//line tags.qtpl:31 + qb422016 := qt422016.AcquireByteBuffer() +//line tags.qtpl:31 + WriteListTags(qb422016, name, tags) +//line tags.qtpl:31 + qs422016 := string(qb422016.B) +//line tags.qtpl:31 + qt422016.ReleaseByteBuffer(qb422016) +//line tags.qtpl:31 + return qs422016 +//line tags.qtpl:31 +} |