all repos — elgit @ 59ba5ba7dd66f7bf537d1f17a9d588acce6b5e16

fork of legit: web frontend for git, written in go

feat: Add route handler for file-specific commit diffs

Alan Pearce
commit

59ba5ba7dd66f7bf537d1f17a9d588acce6b5e16

parent

13e02db54aaa6d9fc5198a884e6dd8b4bee7e13f

1 file changed, 7 insertions(+), 2 deletions(-)

changed files
M templates/commit.gotemplates/commit.go
@@ -44,9 +44,14 @@ diff.Stat.Insertions, pluralise(diff.Stat.Insertions),
diff.Stat.Deletions, pluralise(diff.Stat.Deletions))), Div( Br(), - Strong(g.Text("jump to")), + Strong(g.Text("changed files")), Ul(g.Map(diff.Diff, func(d git.Diff) g.Node { - return Li(A(Href("#"+d.Name.New), g.Text(d.Name.New))) + return Li( + A( + Href(fmt.Sprintf("/%s/commit/%s/%s", data.Name, diff.Commit.This, d.Name.New)), + g.Text(d.Name.New), + ), + ) })), ), ),