Skip to content

Commit 76185ed

Browse files
6543mrsdizzie
authored andcommitted
FIX download diff/patch from commit (#8792)
* send fix * restart CI * us Commit only when available * CI.redo() * more specific if statement Co-Authored-By: mrsdizzie <[email protected]>
1 parent 729708e commit 76185ed

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

templates/repo/diff/options_dropdown.tmpl

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,12 @@
33
<i class="dropdown icon"></i>
44
<div class="menu">
55
<a class="item tiny basic toggle button" data-target="#diff-files">{{.i18n.Tr "repo.diff.show_diff_stats"}}</a>
6-
<a class="item" href="{{$.RepoLink}}/pulls/{{.Issue.Index}}.patch" download="{{.Issue.Index}}.patch">{{.i18n.Tr "repo.diff.download_patch"}}</a>
7-
<a class="item" href="{{$.RepoLink}}/pulls/{{.Issue.Index}}.diff" download="{{.Issue.Index}}.diff">{{.i18n.Tr "repo.diff.download_diff"}}</a>
6+
{{if .Issue.Index}}
7+
<a class="item" href="{{$.RepoLink}}/pulls/{{.Issue.Index}}.patch" download="{{.Issue.Index}}.patch">{{.i18n.Tr "repo.diff.download_patch"}}</a>
8+
<a class="item" href="{{$.RepoLink}}/pulls/{{.Issue.Index}}.diff" download="{{.Issue.Index}}.diff">{{.i18n.Tr "repo.diff.download_diff"}}</a>
9+
{{else if .Commit.ID.String}}
10+
<a class="item" href="{{$.RepoLink}}/commit/{{.Commit.ID.String}}.patch" download="{{ShortSha .Commit.ID.String}}.patch">{{.i18n.Tr "repo.diff.download_patch"}}</a>
11+
<a class="item" href="{{$.RepoLink}}/commit/{{.Commit.ID.String}}.diff" download="{{ShortSha .Commit.ID.String}}.diff">{{.i18n.Tr "repo.diff.download_diff"}}</a>
12+
{{end}}
813
</div>
914
</div>

0 commit comments

Comments
 (0)