diff options
author | Gabriel A. Giovanini <mail@gabrielgio.me> | 2025-01-26 14:53:14 +0100 |
---|---|---|
committer | Gabriel A. Giovanini <mail@gabrielgio.me> | 2025-01-26 14:54:52 +0100 |
commit | cb9036aab96895ddf03cab68f75d3356f5227968 (patch) | |
tree | bc97024b0e947a0624579552955ce7c1ea47c572 /templates | |
parent | f128f0a029430cb5ab4f89733d8297666a6b2fdf (diff) | |
download | cerrado-cb9036aab96895ddf03cab68f75d3356f5227968.tar.gz cerrado-cb9036aab96895ddf03cab68f75d3356f5227968.tar.bz2 cerrado-cb9036aab96895ddf03cab68f75d3356f5227968.zip |
Now it is possible to navigate through all commit from a given repository.
It implements a simple navigation which will plenty for now.
Diffstat (limited to 'templates')
-rw-r--r-- | templates/gititemlog.qtpl | 5 | ||||
-rw-r--r-- | templates/gititemlog.qtpl.go | 97 |
2 files changed, 66 insertions, 36 deletions
diff --git a/templates/gititemlog.qtpl b/templates/gititemlog.qtpl index e5bfc1b..b0c8cec 100644 --- a/templates/gititemlog.qtpl +++ b/templates/gititemlog.qtpl @@ -3,6 +3,7 @@ {% code type GitItemLogPage struct { Commits []*object.Commit + Next *object.Commit } %} @@ -13,5 +14,9 @@ type GitItemLogPage struct { {% for _, c := range g.Commits %} {%= Commit(name, c, false) %} {% endfor %} + {% if g.Next != nil %} + <a href="/{%s name %}/log/{%s ref %}/?from={%s g.Next.Hash.String() %}" class="btn btn-primary">Next</a> + {% endif %} + </div> {% endfunc %} 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(` <div class="event-list"> `) -//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(` + <a href="/`) +//line templates/gititemlog.qtpl:18 + qw422016.E().S(name) +//line templates/gititemlog.qtpl:18 + qw422016.N().S(`/log/`) +//line templates/gititemlog.qtpl:18 + qw422016.E().S(ref) +//line templates/gititemlog.qtpl:18 + qw422016.N().S(`/?from=`) +//line templates/gititemlog.qtpl:18 + qw422016.E().S(g.Next.Hash.String()) +//line templates/gititemlog.qtpl:18 + qw422016.N().S(`" class="btn btn-primary">Next</a> + `) +//line templates/gititemlog.qtpl:19 + } +//line templates/gititemlog.qtpl:19 qw422016.N().S(` + </div> `) -//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 } |