From cb9036aab96895ddf03cab68f75d3356f5227968 Mon Sep 17 00:00:00 2001 From: "Gabriel A. Giovanini" Date: Sun, 26 Jan 2025 14:53:14 +0100 Subject: feat: Add log pagination Now it is possible to navigate through all commit from a given repository. It implements a simple navigation which will plenty for now. --- templates/gititemlog.qtpl.go | 97 ++++++++++++++++++++++++++++---------------- 1 file changed, 61 insertions(+), 36 deletions(-) (limited to 'templates/gititemlog.qtpl.go') diff --git a/templates/gititemlog.qtpl.go b/templates/gititemlog.qtpl.go index 20fc1f5..719b71f 100644 --- a/templates/gititemlog.qtpl.go +++ b/templates/gititemlog.qtpl.go @@ -23,88 +23,113 @@ var ( //line templates/gititemlog.qtpl:4 type GitItemLogPage struct { Commits []*object.Commit + Next *object.Commit } -//line templates/gititemlog.qtpl:9 +//line templates/gititemlog.qtpl:10 func (g *GitItemLogPage) StreamNav(qw422016 *qt422016.Writer, name, ref string) { -//line templates/gititemlog.qtpl:9 +//line templates/gititemlog.qtpl:10 StreamGitItemNav(qw422016, name, ref, Log) -//line templates/gititemlog.qtpl:9 +//line templates/gititemlog.qtpl:10 } -//line templates/gititemlog.qtpl:9 +//line templates/gititemlog.qtpl:10 func (g *GitItemLogPage) WriteNav(qq422016 qtio422016.Writer, name, ref string) { -//line templates/gititemlog.qtpl:9 +//line templates/gititemlog.qtpl:10 qw422016 := qt422016.AcquireWriter(qq422016) -//line templates/gititemlog.qtpl:9 +//line templates/gititemlog.qtpl:10 g.StreamNav(qw422016, name, ref) -//line templates/gititemlog.qtpl:9 +//line templates/gititemlog.qtpl:10 qt422016.ReleaseWriter(qw422016) -//line templates/gititemlog.qtpl:9 +//line templates/gititemlog.qtpl:10 } -//line templates/gititemlog.qtpl:9 +//line templates/gititemlog.qtpl:10 func (g *GitItemLogPage) Nav(name, ref string) string { -//line templates/gititemlog.qtpl:9 +//line templates/gititemlog.qtpl:10 qb422016 := qt422016.AcquireByteBuffer() -//line templates/gititemlog.qtpl:9 +//line templates/gititemlog.qtpl:10 g.WriteNav(qb422016, name, ref) -//line templates/gititemlog.qtpl:9 +//line templates/gititemlog.qtpl:10 qs422016 := string(qb422016.B) -//line templates/gititemlog.qtpl:9 +//line templates/gititemlog.qtpl:10 qt422016.ReleaseByteBuffer(qb422016) -//line templates/gititemlog.qtpl:9 +//line templates/gititemlog.qtpl:10 return qs422016 -//line templates/gititemlog.qtpl:9 +//line templates/gititemlog.qtpl:10 } -//line templates/gititemlog.qtpl:11 +//line templates/gititemlog.qtpl:12 func (g *GitItemLogPage) StreamGitContent(qw422016 *qt422016.Writer, name, ref string) { -//line templates/gititemlog.qtpl:11 +//line templates/gititemlog.qtpl:12 qw422016.N().S(`
`) -//line templates/gititemlog.qtpl:13 +//line templates/gititemlog.qtpl:14 for _, c := range g.Commits { -//line templates/gititemlog.qtpl:13 +//line templates/gititemlog.qtpl:14 qw422016.N().S(` `) -//line templates/gititemlog.qtpl:14 +//line templates/gititemlog.qtpl:15 StreamCommit(qw422016, name, c, false) -//line templates/gititemlog.qtpl:14 +//line templates/gititemlog.qtpl:15 qw422016.N().S(` `) -//line templates/gititemlog.qtpl:15 +//line templates/gititemlog.qtpl:16 } -//line templates/gititemlog.qtpl:15 +//line templates/gititemlog.qtpl:16 + qw422016.N().S(` + `) +//line templates/gititemlog.qtpl:17 + if g.Next != nil { +//line templates/gititemlog.qtpl:17 + qw422016.N().S(` + Next + `) +//line templates/gititemlog.qtpl:19 + } +//line templates/gititemlog.qtpl:19 qw422016.N().S(` +
`) -//line templates/gititemlog.qtpl:17 +//line templates/gititemlog.qtpl:22 } -//line templates/gititemlog.qtpl:17 +//line templates/gititemlog.qtpl:22 func (g *GitItemLogPage) WriteGitContent(qq422016 qtio422016.Writer, name, ref string) { -//line templates/gititemlog.qtpl:17 +//line templates/gititemlog.qtpl:22 qw422016 := qt422016.AcquireWriter(qq422016) -//line templates/gititemlog.qtpl:17 +//line templates/gititemlog.qtpl:22 g.StreamGitContent(qw422016, name, ref) -//line templates/gititemlog.qtpl:17 +//line templates/gititemlog.qtpl:22 qt422016.ReleaseWriter(qw422016) -//line templates/gititemlog.qtpl:17 +//line templates/gititemlog.qtpl:22 } -//line templates/gititemlog.qtpl:17 +//line templates/gititemlog.qtpl:22 func (g *GitItemLogPage) GitContent(name, ref string) string { -//line templates/gititemlog.qtpl:17 +//line templates/gititemlog.qtpl:22 qb422016 := qt422016.AcquireByteBuffer() -//line templates/gititemlog.qtpl:17 +//line templates/gititemlog.qtpl:22 g.WriteGitContent(qb422016, name, ref) -//line templates/gititemlog.qtpl:17 +//line templates/gititemlog.qtpl:22 qs422016 := string(qb422016.B) -//line templates/gititemlog.qtpl:17 +//line templates/gititemlog.qtpl:22 qt422016.ReleaseByteBuffer(qb422016) -//line templates/gititemlog.qtpl:17 +//line templates/gititemlog.qtpl:22 return qs422016 -//line templates/gititemlog.qtpl:17 +//line templates/gititemlog.qtpl:22 } -- cgit v1.2.3