diff --git a/appview/pages/templates/repo/commit.html b/appview/pages/templates/repo/commit.html index 3b992670..57e7c7ec 100644 --- a/appview/pages/templates/repo/commit.html +++ b/appview/pages/templates/repo/commit.html @@ -153,5 +153,5 @@ {{ define "contentAfter" }} - {{ template "repo/fragments/diff" (list .Diff .DiffOpts) }} + {{ template "repo/fragments/diff" (list .Diff .DiffOpts "" (printf "/%s/blob/%s" .RepoInfo.FullName (pathEscape .Diff.Commit.This))) }} {{end}} diff --git a/appview/pages/templates/repo/compare/compare.html b/appview/pages/templates/repo/compare/compare.html index 36af0e99..a744f9c0 100644 --- a/appview/pages/templates/repo/compare/compare.html +++ b/appview/pages/templates/repo/compare/compare.html @@ -21,5 +21,5 @@ {{ end }} {{ define "contentAfter" }} - {{ template "repo/fragments/diff" (list .Diff .DiffOpts) }} + {{ template "repo/fragments/diff" (list .Diff .DiffOpts "" (printf "/%s/blob/%s" .RepoInfo.FullName (pathEscape .Head))) }} {{end}} diff --git a/appview/pages/templates/repo/fragments/diff.html b/appview/pages/templates/repo/fragments/diff.html index 8e74fbf7..3a0edc07 100644 --- a/appview/pages/templates/repo/fragments/diff.html +++ b/appview/pages/templates/repo/fragments/diff.html @@ -101,7 +101,9 @@ {{ define "diffLayout" }} {{ $diff := index . 0 }} {{ $opts := index . 1 }} - {{ $padBottom := gt (len .) 2 }} + {{ $padBottom := and (gt (len .) 2) (index . 2) }} + {{ $blobBase := "" }} + {{ if gt (len .) 3 }}{{ $blobBase = index . 3 }}{{ end }}