Skip to content

Commit d7d348e

Browse files
6543lafriks
authored andcommitted
[UI] Pull Request Download diff Button (#8470)
* Add Diff Download to Compare List * Add&Change Text for Diff Options * move button to seperate template * add drop down menue with options * Update: Compare update Gogs, BitBucket, RhodeCode and remove gitea issue link Co-Authored-By: Lauris BH <lauris@nix.lv> * remove last things from TESTing
1 parent 1e9b330 commit d7d348e

File tree

4 files changed

+16
-3
lines changed

4 files changed

+16
-3
lines changed

docs/content/doc/features/comparison.en-us.md

+1
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ _Symbols used in table:_
105105
| Revert specific commits or a merge request | [](https://github.com/go-gitea/gitea/issues/5158) |||||||
106106
| Pull/Merge requests templates ||||||||
107107
| Cherry-picking changes | [](https://github.com/go-gitea/gitea/issues/5158) |||||||
108+
| Download Patch |||||| [/](https://jira.atlassian.com/plugins/servlet/mobile#issue/BCLOUD-8323) ||
108109

109110

110111
#### 3rd-party integrations

options/locale/locale_en-US.ini

+4-1
Original file line numberDiff line numberDiff line change
@@ -1370,7 +1370,10 @@ diff.parent = parent
13701370
diff.commit = commit
13711371
diff.git-notes = Notes
13721372
diff.data_not_available = Diff Content Not Available
1373-
diff.show_diff_stats = Show Diff Stats
1373+
diff.options_button = Diff Options
1374+
diff.show_diff_stats = Show Stats
1375+
diff.download_patch = Download Patch File
1376+
diff.download_diff = Download Diff File
13741377
diff.show_split_view = Split View
13751378
diff.show_unified_view = Unified View
13761379
diff.whitespace_button = Whitespace

templates/repo/diff/box.tmpl

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
{{else}}
88
<a class="ui tiny basic toggle button" href="?style={{if .IsSplitStyle}}unified{{else}}split{{end}}">{{ if .IsSplitStyle }}{{.i18n.Tr "repo.diff.show_unified_view"}}{{else}}{{.i18n.Tr "repo.diff.show_split_view"}}{{end}}</a>
99
{{end}}
10-
<a class="ui tiny basic toggle button" data-target="#diff-files">{{.i18n.Tr "repo.diff.show_diff_stats"}}</a>
10+
{{template "repo/diff/options_dropdown" .}}
1111
{{if and .PageIsPullFiles $.SignedUserID (not .IsArchived)}}
1212
{{template "repo/diff/new_review" .}}
1313
{{end}}
@@ -26,7 +26,7 @@
2626
{{else}}
2727
<a class="ui tiny basic toggle button" href="?style={{if .IsSplitStyle}}unified{{else}}split{{end}}">{{ if .IsSplitStyle }}{{.i18n.Tr "repo.diff.show_unified_view"}}{{else}}{{.i18n.Tr "repo.diff.show_split_view"}}{{end}}</a>
2828
{{end}}
29-
<a class="ui tiny basic toggle button" data-target="#diff-files">{{.i18n.Tr "repo.diff.show_diff_stats"}}</a>
29+
{{template "repo/diff/options_dropdown" .}}
3030
{{if and .PageIsPullFiles $.SignedUserID (not .IsArchived)}}
3131
{{template "repo/diff/new_review" .}}
3232
{{end}}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<div class="ui dropdown tiny button">
2+
{{.i18n.Tr "repo.diff.options_button"}}
3+
<i class="dropdown icon"></i>
4+
<div class="menu">
5+
<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>
8+
</div>
9+
</div>

0 commit comments

Comments
 (0)