diff options
author | Gabriel A. Giovanini <mail@gabrielgio.me> | 2024-06-25 20:37:40 +0200 |
---|---|---|
committer | Gabriel A. Giovanini <mail@gabrielgio.me> | 2024-06-25 20:37:40 +0200 |
commit | 907c13566c775ac1210bc66de99f7273e7c8a507 (patch) | |
tree | b2c3f6a647441d452e8a5c119f7d00dd947b7dff /templates | |
parent | 75d3ee252e7d966055bb76258d3e0da28488d261 (diff) | |
download | cerrado-907c13566c775ac1210bc66de99f7273e7c8a507.tar.gz cerrado-907c13566c775ac1210bc66de99f7273e7c8a507.tar.bz2 cerrado-907c13566c775ac1210bc66de99f7273e7c8a507.zip |
feat: Add commit page
Diffstat (limited to 'templates')
-rw-r--r-- | templates/gititemcommit.qtpl | 19 | ||||
-rw-r--r-- | templates/gititemcommit.qtpl.go | 104 |
2 files changed, 123 insertions, 0 deletions
diff --git a/templates/gititemcommit.qtpl b/templates/gititemcommit.qtpl new file mode 100644 index 0000000..e685f23 --- /dev/null +++ b/templates/gititemcommit.qtpl @@ -0,0 +1,19 @@ +{% import "github.com/go-git/go-git/v5/plumbing/object" %} + +{% code +type GitItemCommitPage struct { + Commit *object.Commit +} +%} + +{% func (g *GitItemCommitPage) Nav(name, ref string) %}{%= GitItemNav(name, ref, Log) %}{% endfunc %} + +{% func (g *GitItemCommitPage) GitContent(name, ref string) %} +<div class="event-list"> + {%= Commit(name, g.Commit) %} +</div> + +<div class="alert alert-info text-center" role="alert"> + This page is work in progress. +</div> +{% endfunc %} diff --git a/templates/gititemcommit.qtpl.go b/templates/gititemcommit.qtpl.go new file mode 100644 index 0000000..13c1fa9 --- /dev/null +++ b/templates/gititemcommit.qtpl.go @@ -0,0 +1,104 @@ +// Code generated by qtc from "gititemcommit.qtpl". DO NOT EDIT. +// See https://github.com/valyala/quicktemplate for details. + +//line gititemcommit.qtpl:1 +package templates + +//line gititemcommit.qtpl:1 +import "github.com/go-git/go-git/v5/plumbing/object" + +//line gititemcommit.qtpl:3 +import ( + qtio422016 "io" + + qt422016 "github.com/valyala/quicktemplate" +) + +//line gititemcommit.qtpl:3 +var ( + _ = qtio422016.Copy + _ = qt422016.AcquireByteBuffer +) + +//line gititemcommit.qtpl:4 +type GitItemCommitPage struct { + Commit *object.Commit +} + +//line gititemcommit.qtpl:9 +func (g *GitItemCommitPage) StreamNav(qw422016 *qt422016.Writer, name, ref string) { +//line gititemcommit.qtpl:9 + StreamGitItemNav(qw422016, name, ref, Log) +//line gititemcommit.qtpl:9 +} + +//line gititemcommit.qtpl:9 +func (g *GitItemCommitPage) WriteNav(qq422016 qtio422016.Writer, name, ref string) { +//line gititemcommit.qtpl:9 + qw422016 := qt422016.AcquireWriter(qq422016) +//line gititemcommit.qtpl:9 + g.StreamNav(qw422016, name, ref) +//line gititemcommit.qtpl:9 + qt422016.ReleaseWriter(qw422016) +//line gititemcommit.qtpl:9 +} + +//line gititemcommit.qtpl:9 +func (g *GitItemCommitPage) Nav(name, ref string) string { +//line gititemcommit.qtpl:9 + qb422016 := qt422016.AcquireByteBuffer() +//line gititemcommit.qtpl:9 + g.WriteNav(qb422016, name, ref) +//line gititemcommit.qtpl:9 + qs422016 := string(qb422016.B) +//line gititemcommit.qtpl:9 + qt422016.ReleaseByteBuffer(qb422016) +//line gititemcommit.qtpl:9 + return qs422016 +//line gititemcommit.qtpl:9 +} + +//line gititemcommit.qtpl:11 +func (g *GitItemCommitPage) StreamGitContent(qw422016 *qt422016.Writer, name, ref string) { +//line gititemcommit.qtpl:11 + qw422016.N().S(` +<div class="event-list"> + `) +//line gititemcommit.qtpl:13 + StreamCommit(qw422016, name, g.Commit) +//line gititemcommit.qtpl:13 + qw422016.N().S(` +</div> + +<div class="alert alert-info text-center" role="alert"> + This page is work in progress. +</div> +`) +//line gititemcommit.qtpl:19 +} + +//line gititemcommit.qtpl:19 +func (g *GitItemCommitPage) WriteGitContent(qq422016 qtio422016.Writer, name, ref string) { +//line gititemcommit.qtpl:19 + qw422016 := qt422016.AcquireWriter(qq422016) +//line gititemcommit.qtpl:19 + g.StreamGitContent(qw422016, name, ref) +//line gititemcommit.qtpl:19 + qt422016.ReleaseWriter(qw422016) +//line gititemcommit.qtpl:19 +} + +//line gititemcommit.qtpl:19 +func (g *GitItemCommitPage) GitContent(name, ref string) string { +//line gititemcommit.qtpl:19 + qb422016 := qt422016.AcquireByteBuffer() +//line gititemcommit.qtpl:19 + g.WriteGitContent(qb422016, name, ref) +//line gititemcommit.qtpl:19 + qs422016 := string(qb422016.B) +//line gititemcommit.qtpl:19 + qt422016.ReleaseByteBuffer(qb422016) +//line gititemcommit.qtpl:19 + return qs422016 +//line gititemcommit.qtpl:19 +} |