Skip to content

Commit 70b577f

Browse files
committed
add download links to raw diff and patch in diff box options dropdown
1 parent a04c5b2 commit 70b577f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

templates/repo/diff/options_dropdown.tmpl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
{{else if .Commit.ID.String}}
1111
<a class="item" href="{{$.RepoLink}}/commit/{{PathEscape .Commit.ID.String}}.patch" download="{{ShortSha .Commit.ID.String}}.patch">{{ctx.Locale.Tr "repo.diff.download_patch"}}</a>
1212
<a class="item" href="{{$.RepoLink}}/commit/{{PathEscape .Commit.ID.String}}.diff" download="{{ShortSha .Commit.ID.String}}.diff">{{ctx.Locale.Tr "repo.diff.download_diff"}}</a>
13+
{{else if $.PageIsCompareDiff }}
14+
<a class="item" href="{{$.Link}}.patch" download="{{$.BaseBranch}}...{{$.HeadBranch}}.patch">{{ctx.Locale.Tr "repo.diff.download_patch"}}</a>
15+
<a class="item" href="{{$.Link}}.diff" download="{{$.BaseBranch}}...{{$.HeadBranch}}.diff">{{ctx.Locale.Tr "repo.diff.download_diff"}}</a>
1316
{{end}}
1417
<a id="expand-files-btn" class="item">{{ctx.Locale.Tr "repo.pulls.expand_files"}}</a>
1518
<a id="collapse-files-btn" class="item">{{ctx.Locale.Tr "repo.pulls.collapse_files"}}</a>

0 commit comments

Comments
 (0)