diff options
author | Gabriel A. Giovanini <mail@gabrielgio.me> | 2024-08-04 14:44:36 +0200 |
---|---|---|
committer | Gabriel A. Giovanini <mail@gabrielgio.me> | 2024-08-04 14:44:36 +0200 |
commit | 60004cfb97fe0eb64d1c8310e7c9caae96b8adbe (patch) | |
tree | 2267cf703f6870b05d68c73be7af1fc57190e770 /templates | |
parent | aa559681fcf8df993029370f28e0011315ca8761 (diff) | |
download | cerrado-60004cfb97fe0eb64d1c8310e7c9caae96b8adbe.tar.gz cerrado-60004cfb97fe0eb64d1c8310e7c9caae96b8adbe.tar.bz2 cerrado-60004cfb97fe0eb64d1c8310e7c9caae96b8adbe.zip |
feat: Add diff view
Adds a very simple diff view for a commit
Diffstat (limited to 'templates')
-rw-r--r-- | templates/gititemcommit.qtpl | 6 | ||||
-rw-r--r-- | templates/gititemcommit.qtpl.go | 48 |
2 files changed, 29 insertions, 25 deletions
diff --git a/templates/gititemcommit.qtpl b/templates/gititemcommit.qtpl index 77536f1..d223315 100644 --- a/templates/gititemcommit.qtpl +++ b/templates/gititemcommit.qtpl @@ -3,6 +3,7 @@ {% code type GitItemCommitPage struct { Commit *object.Commit + Diff string } %} @@ -12,8 +13,7 @@ type GitItemCommitPage struct { <div class="event-list"> {%= Commit(name, g.Commit, true) %} </div> - -<div class="alert alert-info text-center" role="alert"> - This page is work in progress. +<div class="code-view"> +<pre>{%s g.Diff %}</pre> </div> {% endfunc %} diff --git a/templates/gititemcommit.qtpl.go b/templates/gititemcommit.qtpl.go index f94a1c2..39348ee 100644 --- a/templates/gititemcommit.qtpl.go +++ b/templates/gititemcommit.qtpl.go @@ -23,55 +23,59 @@ var ( //line gititemcommit.qtpl:4 type GitItemCommitPage struct { Commit *object.Commit + Diff string } -//line gititemcommit.qtpl:9 +//line gititemcommit.qtpl:10 func (g *GitItemCommitPage) StreamNav(qw422016 *qt422016.Writer, name, ref string) { -//line gititemcommit.qtpl:9 +//line gititemcommit.qtpl:10 StreamGitItemNav(qw422016, name, ref, Log) -//line gititemcommit.qtpl:9 +//line gititemcommit.qtpl:10 } -//line gititemcommit.qtpl:9 +//line gititemcommit.qtpl:10 func (g *GitItemCommitPage) WriteNav(qq422016 qtio422016.Writer, name, ref string) { -//line gititemcommit.qtpl:9 +//line gititemcommit.qtpl:10 qw422016 := qt422016.AcquireWriter(qq422016) -//line gititemcommit.qtpl:9 +//line gititemcommit.qtpl:10 g.StreamNav(qw422016, name, ref) -//line gititemcommit.qtpl:9 +//line gititemcommit.qtpl:10 qt422016.ReleaseWriter(qw422016) -//line gititemcommit.qtpl:9 +//line gititemcommit.qtpl:10 } -//line gititemcommit.qtpl:9 +//line gititemcommit.qtpl:10 func (g *GitItemCommitPage) Nav(name, ref string) string { -//line gititemcommit.qtpl:9 +//line gititemcommit.qtpl:10 qb422016 := qt422016.AcquireByteBuffer() -//line gititemcommit.qtpl:9 +//line gititemcommit.qtpl:10 g.WriteNav(qb422016, name, ref) -//line gititemcommit.qtpl:9 +//line gititemcommit.qtpl:10 qs422016 := string(qb422016.B) -//line gititemcommit.qtpl:9 +//line gititemcommit.qtpl:10 qt422016.ReleaseByteBuffer(qb422016) -//line gititemcommit.qtpl:9 +//line gititemcommit.qtpl:10 return qs422016 -//line gititemcommit.qtpl:9 +//line gititemcommit.qtpl:10 } -//line gititemcommit.qtpl:11 +//line gititemcommit.qtpl:12 func (g *GitItemCommitPage) StreamGitContent(qw422016 *qt422016.Writer, name, ref string) { -//line gititemcommit.qtpl:11 +//line gititemcommit.qtpl:12 qw422016.N().S(` <div class="event-list"> `) -//line gititemcommit.qtpl:13 +//line gititemcommit.qtpl:14 StreamCommit(qw422016, name, g.Commit, true) -//line gititemcommit.qtpl:13 +//line gititemcommit.qtpl:14 qw422016.N().S(` </div> - -<div class="alert alert-info text-center" role="alert"> - This page is work in progress. +<div class="code-view"> +<pre>`) +//line gititemcommit.qtpl:17 + qw422016.E().S(g.Diff) +//line gititemcommit.qtpl:17 + qw422016.N().S(`</pre> </div> `) //line gititemcommit.qtpl:19 |