diff options
author | Gabriel A. Giovanini <mail@gabrielgio.me> | 2025-03-25 21:20:13 +0100 |
---|---|---|
committer | Gabriel A. Giovanini <mail@gabrielgio.me> | 2025-03-25 21:20:13 +0100 |
commit | 6006194c072dba9f65aa08c6e3be06ea8ead8910 (patch) | |
tree | e647fd2063efce999ac97761f05aaf38fee135dd /templates/gititemref.qtpl.go | |
parent | c1247a52e92523be8d225d20dc9592f32dca5088 (diff) | |
download | cerrado-6006194c072dba9f65aa08c6e3be06ea8ead8910.tar.gz cerrado-6006194c072dba9f65aa08c6e3be06ea8ead8910.tar.bz2 cerrado-6006194c072dba9f65aa08c6e3be06ea8ead8910.zip |
feat: Add ref page
Now there is page more tailored to a single ref.
Diffstat (limited to 'templates/gititemref.qtpl.go')
-rw-r--r-- | templates/gititemref.qtpl.go | 171 |
1 files changed, 171 insertions, 0 deletions
diff --git a/templates/gititemref.qtpl.go b/templates/gititemref.qtpl.go new file mode 100644 index 0000000..53ca1ec --- /dev/null +++ b/templates/gititemref.qtpl.go @@ -0,0 +1,171 @@ +// Code generated by qtc from "gititemref.qtpl". DO NOT EDIT. +// See https://github.com/valyala/quicktemplate for details. + +//line templates/gititemref.qtpl:1 +package templates + +//line templates/gititemref.qtpl:1 +import "git.gabrielgio.me/cerrado/pkg/git" + +//line templates/gititemref.qtpl:2 +import "git.gabrielgio.me/cerrado/pkg/humanize" + +//line templates/gititemref.qtpl:3 +import "github.com/go-git/go-git/v5/plumbing/object" + +//line templates/gititemref.qtpl:5 +import ( + qtio422016 "io" + + qt422016 "github.com/valyala/quicktemplate" +) + +//line templates/gititemref.qtpl:5 +var ( + _ = qtio422016.Copy + _ = qt422016.AcquireByteBuffer +) + +//line templates/gititemref.qtpl:6 +type GitItemRefPage struct { + Reference *git.TagReference + Commit *object.Commit +} + +//line templates/gititemref.qtpl:12 +func (g *GitItemRefPage) StreamNav(qw422016 *qt422016.Writer, name, ref string) { +//line templates/gititemref.qtpl:12 + StreamGitItemNav(qw422016, name, ref, Refs) +//line templates/gititemref.qtpl:12 +} + +//line templates/gititemref.qtpl:12 +func (g *GitItemRefPage) WriteNav(qq422016 qtio422016.Writer, name, ref string) { +//line templates/gititemref.qtpl:12 + qw422016 := qt422016.AcquireWriter(qq422016) +//line templates/gititemref.qtpl:12 + g.StreamNav(qw422016, name, ref) +//line templates/gititemref.qtpl:12 + qt422016.ReleaseWriter(qw422016) +//line templates/gititemref.qtpl:12 +} + +//line templates/gititemref.qtpl:12 +func (g *GitItemRefPage) Nav(name, ref string) string { +//line templates/gititemref.qtpl:12 + qb422016 := qt422016.AcquireByteBuffer() +//line templates/gititemref.qtpl:12 + g.WriteNav(qb422016, name, ref) +//line templates/gititemref.qtpl:12 + qs422016 := string(qb422016.B) +//line templates/gititemref.qtpl:12 + qt422016.ReleaseByteBuffer(qb422016) +//line templates/gititemref.qtpl:12 + return qs422016 +//line templates/gititemref.qtpl:12 +} + +//line templates/gititemref.qtpl:14 +func (g *GitItemRefPage) StreamGitContent(qw422016 *qt422016.Writer, name, ref string) { +//line templates/gititemref.qtpl:14 + qw422016.N().S(` +<div class="event-list"> + <div class="row event"> + <div class="row"> + <div class="col-md"> + <a title="`) +//line templates/gititemref.qtpl:19 + qw422016.E().S(g.Commit.Hash.String()) +//line templates/gititemref.qtpl:19 + qw422016.N().S(`" href="/`) +//line templates/gititemref.qtpl:19 + qw422016.E().S(name) +//line templates/gititemref.qtpl:19 + qw422016.N().S(`/commit/`) +//line templates/gititemref.qtpl:19 + qw422016.E().S(g.Commit.Hash.String()) +//line templates/gititemref.qtpl:19 + qw422016.N().S(`/">`) +//line templates/gititemref.qtpl:19 + qw422016.E().S(g.Commit.Hash.String()[0:8]) +//line templates/gititemref.qtpl:19 + qw422016.N().S(`</a> — + <a title="`) +//line templates/gititemref.qtpl:20 + qw422016.E().S(g.Commit.Committer.Email) +//line templates/gititemref.qtpl:20 + qw422016.N().S(`" href="mailto:`) +//line templates/gititemref.qtpl:20 + qw422016.E().S(g.Commit.Author.Email) +//line templates/gititemref.qtpl:20 + qw422016.N().S(`">`) +//line templates/gititemref.qtpl:20 + qw422016.E().S(g.Commit.Author.Name) +//line templates/gititemref.qtpl:20 + qw422016.N().S(`</a> + </div> + <div class="col-md text-md-center"> + <a title="tar.gz for `) +//line templates/gititemref.qtpl:23 + qw422016.E().S(g.Reference.ShortName()) +//line templates/gititemref.qtpl:23 + qw422016.N().S(`" href="/`) +//line templates/gititemref.qtpl:23 + qw422016.E().S(name) +//line templates/gititemref.qtpl:23 + qw422016.N().S(`/archive/`) +//line templates/gititemref.qtpl:23 + qw422016.E().S(g.Reference.ShortName()) +//line templates/gititemref.qtpl:23 + qw422016.N().S(`.tar.gz">tar.gz</a> + </div> + <div class="col-md text-md-end"> + <a title="`) +//line templates/gititemref.qtpl:26 + qw422016.E().S(g.Commit.Author.When.UTC().Format("2006-01-02 15:04:05")) +//line templates/gititemref.qtpl:26 + qw422016.N().S(` UTC">`) +//line templates/gititemref.qtpl:26 + qw422016.E().S(humanize.Time(g.Commit.Author.When)) +//line templates/gititemref.qtpl:26 + qw422016.N().S(`</a> + </div> + </div> + <div class="code-view"> + <pre>`) +//line templates/gititemref.qtpl:30 + qw422016.E().S(g.Reference.Message()) +//line templates/gititemref.qtpl:30 + qw422016.N().S(`</pre> + </div> + </div> +</div> +`) +//line templates/gititemref.qtpl:34 +} + +//line templates/gititemref.qtpl:34 +func (g *GitItemRefPage) WriteGitContent(qq422016 qtio422016.Writer, name, ref string) { +//line templates/gititemref.qtpl:34 + qw422016 := qt422016.AcquireWriter(qq422016) +//line templates/gititemref.qtpl:34 + g.StreamGitContent(qw422016, name, ref) +//line templates/gititemref.qtpl:34 + qt422016.ReleaseWriter(qw422016) +//line templates/gititemref.qtpl:34 +} + +//line templates/gititemref.qtpl:34 +func (g *GitItemRefPage) GitContent(name, ref string) string { +//line templates/gititemref.qtpl:34 + qb422016 := qt422016.AcquireByteBuffer() +//line templates/gititemref.qtpl:34 + g.WriteGitContent(qb422016, name, ref) +//line templates/gititemref.qtpl:34 + qs422016 := string(qb422016.B) +//line templates/gititemref.qtpl:34 + qt422016.ReleaseByteBuffer(qb422016) +//line templates/gititemref.qtpl:34 + return qs422016 +//line templates/gititemref.qtpl:34 +} |