forked from tangled.org/core
Monorepo for Tangled

appview/pages: fix `pages.RepoComparedDiffFragment()`

- remove unused parameters
- pass correct parameters
- rename with `*Fragment` suffix

Signed-off-by: Seongmin Lee <git@boltless.me>

authored by boltless.me and committed by Tangled 3a7730c5 5ff1be1b

Changed files
+10 -12
appview
pages
templates
repo
compare
fragments
pulls
+5 -6
appview/pages/pages.go
··· 1258 1258 return p.executePlain("repo/fragments/compareAllowPull", w, params) 1259 1259 } 1260 1260 1261 - type RepoCompareDiffParams struct { 1262 - LoggedInUser *oauth.User 1263 - RepoInfo repoinfo.RepoInfo 1264 - Diff types.NiceDiff 1261 + type RepoCompareDiffFragmentParams struct { 1262 + Diff types.NiceDiff 1263 + DiffOpts types.DiffOpts 1265 1264 } 1266 1265 1267 - func (p *Pages) RepoCompareDiff(w io.Writer, params RepoCompareDiffParams) error { 1268 - return p.executePlain("repo/fragments/diff", w, []any{params.RepoInfo.FullName, &params.Diff}) 1266 + func (p *Pages) RepoCompareDiffFragment(w io.Writer, params RepoCompareDiffFragmentParams) error { 1267 + return p.executePlain("repo/fragments/diff", w, []any{&params.Diff, &params.DiffOpts}) 1269 1268 } 1270 1269 1271 1270 type LabelPanelParams struct {
+1 -1
appview/pages/templates/repo/commit.html
··· 111 111 {{ end }} 112 112 113 113 {{ define "contentAfter" }} 114 - {{ template "repo/fragments/diff" (list .RepoInfo.FullName .Diff .DiffOpts) }} 114 + {{ template "repo/fragments/diff" (list .Diff .DiffOpts) }} 115 115 {{end}} 116 116 117 117 {{ define "contentAfterLeft" }}
+1 -1
appview/pages/templates/repo/compare/compare.html
··· 42 42 {{ end }} 43 43 44 44 {{ define "contentAfter" }} 45 - {{ template "repo/fragments/diff" (list .RepoInfo.FullName .Diff .DiffOpts) }} 45 + {{ template "repo/fragments/diff" (list .Diff .DiffOpts) }} 46 46 {{end}} 47 47 48 48 {{ define "contentAfterLeft" }}
+2 -3
appview/pages/templates/repo/fragments/diff.html
··· 1 1 {{ define "repo/fragments/diff" }} 2 - {{ $repo := index . 0 }} 3 - {{ $diff := index . 1 }} 4 - {{ $opts := index . 2 }} 2 + {{ $diff := index . 0 }} 3 + {{ $opts := index . 1 }} 5 4 6 5 {{ $commit := $diff.Commit }} 7 6 {{ $diff := $diff.Diff }}
+1 -1
appview/pages/templates/repo/pulls/patch.html
··· 54 54 {{ end }} 55 55 56 56 {{ define "contentAfter" }} 57 - {{ template "repo/fragments/diff" (list .RepoInfo.FullName .Diff .DiffOpts) }} 57 + {{ template "repo/fragments/diff" (list .Diff .DiffOpts) }} 58 58 {{end}} 59 59 60 60 {{ define "contentAfterLeft" }}