mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 16:40:24 +08:00 
			
		
		
		
	[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
This commit is contained in:
		@@ -105,6 +105,7 @@ _Symbols used in table:_
 | 
				
			|||||||
| Revert specific commits or a merge request | [✘](https://github.com/go-gitea/gitea/issues/5158) | ✘ | ✓ | ✓ | ✓ | ✓ | ✘ |
 | 
					| Revert specific commits or a merge request | [✘](https://github.com/go-gitea/gitea/issues/5158) | ✘ | ✓ | ✓ | ✓ | ✓ | ✘ |
 | 
				
			||||||
| Pull/Merge requests templates | ✓ | ✓ | ✓ | ✓ | ✓ | ✘ | ✘ |
 | 
					| Pull/Merge requests templates | ✓ | ✓ | ✓ | ✓ | ✓ | ✘ | ✘ |
 | 
				
			||||||
| Cherry-picking changes | [✘](https://github.com/go-gitea/gitea/issues/5158) | ✘ | ✘ | ✓ | ✓ | ✘ | ✘ |
 | 
					| Cherry-picking changes | [✘](https://github.com/go-gitea/gitea/issues/5158) | ✘ | ✘ | ✓ | ✓ | ✘ | ✘ |
 | 
				
			||||||
 | 
					| Download Patch | ✓ | ✘ | ✓ | ✓ | ✓ | [/](https://jira.atlassian.com/plugins/servlet/mobile#issue/BCLOUD-8323) | ✘ |
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#### 3rd-party integrations
 | 
					#### 3rd-party integrations
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1370,7 +1370,10 @@ diff.parent = parent
 | 
				
			|||||||
diff.commit = commit
 | 
					diff.commit = commit
 | 
				
			||||||
diff.git-notes = Notes
 | 
					diff.git-notes = Notes
 | 
				
			||||||
diff.data_not_available = Diff Content Not Available
 | 
					diff.data_not_available = Diff Content Not Available
 | 
				
			||||||
diff.show_diff_stats = Show Diff Stats
 | 
					diff.options_button = Diff Options
 | 
				
			||||||
 | 
					diff.show_diff_stats = Show Stats
 | 
				
			||||||
 | 
					diff.download_patch = Download Patch File
 | 
				
			||||||
 | 
					diff.download_diff = Download Diff File
 | 
				
			||||||
diff.show_split_view = Split View
 | 
					diff.show_split_view = Split View
 | 
				
			||||||
diff.show_unified_view = Unified View
 | 
					diff.show_unified_view = Unified View
 | 
				
			||||||
diff.whitespace_button = Whitespace
 | 
					diff.whitespace_button = Whitespace
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -7,7 +7,7 @@
 | 
				
			|||||||
				{{else}}
 | 
									{{else}}
 | 
				
			||||||
					<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>
 | 
										<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>
 | 
				
			||||||
				{{end}}
 | 
									{{end}}
 | 
				
			||||||
				<a class="ui tiny basic toggle button" data-target="#diff-files">{{.i18n.Tr "repo.diff.show_diff_stats"}}</a>
 | 
									{{template "repo/diff/options_dropdown" .}}
 | 
				
			||||||
				{{if and .PageIsPullFiles $.SignedUserID (not .IsArchived)}}
 | 
									{{if and .PageIsPullFiles $.SignedUserID (not .IsArchived)}}
 | 
				
			||||||
					{{template "repo/diff/new_review" .}}
 | 
										{{template "repo/diff/new_review" .}}
 | 
				
			||||||
				{{end}}
 | 
									{{end}}
 | 
				
			||||||
@@ -26,7 +26,7 @@
 | 
				
			|||||||
				{{else}}
 | 
									{{else}}
 | 
				
			||||||
					<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>
 | 
										<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>
 | 
				
			||||||
				{{end}}
 | 
									{{end}}
 | 
				
			||||||
				<a class="ui tiny basic toggle button" data-target="#diff-files">{{.i18n.Tr "repo.diff.show_diff_stats"}}</a>
 | 
									{{template "repo/diff/options_dropdown" .}}
 | 
				
			||||||
				{{if and .PageIsPullFiles $.SignedUserID (not .IsArchived)}}
 | 
									{{if and .PageIsPullFiles $.SignedUserID (not .IsArchived)}}
 | 
				
			||||||
					{{template "repo/diff/new_review" .}}
 | 
										{{template "repo/diff/new_review" .}}
 | 
				
			||||||
				{{end}}
 | 
									{{end}}
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										9
									
								
								templates/repo/diff/options_dropdown.tmpl
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								templates/repo/diff/options_dropdown.tmpl
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,9 @@
 | 
				
			|||||||
 | 
					<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>
 | 
				
			||||||
 | 
							<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>
 | 
				
			||||||
 | 
						</div>
 | 
				
			||||||
 | 
					</div>
 | 
				
			||||||
		Reference in New Issue
	
	Block a user