forgejo-federation/templates/repo/diff/options_dropdown.tmpl
6543 76185edd76 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 <info@mrsdizzie.com>
2019-11-02 18:47:25 -04:00

14 lines
949 B
Cheetah

<div class="ui dropdown tiny button">
{{.i18n.Tr "repo.diff.options_button"}}
<i class="dropdown icon"></i>
<div class="menu">
<a class="item tiny basic toggle button" data-target="#diff-files">{{.i18n.Tr "repo.diff.show_diff_stats"}}</a>
{{if .Issue.Index}}
<a class="item" href="{{$.RepoLink}}/pulls/{{.Issue.Index}}.patch" download="{{.Issue.Index}}.patch">{{.i18n.Tr "repo.diff.download_patch"}}</a>
<a class="item" href="{{$.RepoLink}}/pulls/{{.Issue.Index}}.diff" download="{{.Issue.Index}}.diff">{{.i18n.Tr "repo.diff.download_diff"}}</a>
{{else if .Commit.ID.String}}
<a class="item" href="{{$.RepoLink}}/commit/{{.Commit.ID.String}}.patch" download="{{ShortSha .Commit.ID.String}}.patch">{{.i18n.Tr "repo.diff.download_patch"}}</a>
<a class="item" href="{{$.RepoLink}}/commit/{{.Commit.ID.String}}.diff" download="{{ShortSha .Commit.ID.String}}.diff">{{.i18n.Tr "repo.diff.download_diff"}}</a>
{{end}}
</div>
</div>