summaryrefslogtreecommitdiffstats
path: root/templates/repo/diff
diff options
context:
space:
mode:
author6543 <24977596+6543@users.noreply.github.com>2019-10-15 12:44:36 +0200
committerLauris BH <lauris@nix.lv>2019-10-15 13:44:36 +0300
commitd7d348ea86bd8066aeb079ad121120095d5cba4d (patch)
tree20ae4c56632dcf03889cbd3a86c27ada62ff46e5 /templates/repo/diff
parent1e9b33052553bb546ca526f04816579e2853c8da (diff)
downloadgitea-d7d348ea86bd8066aeb079ad121120095d5cba4d.tar.gz
gitea-d7d348ea86bd8066aeb079ad121120095d5cba4d.zip
[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
Diffstat (limited to 'templates/repo/diff')
-rw-r--r--templates/repo/diff/box.tmpl4
-rw-r--r--templates/repo/diff/options_dropdown.tmpl9
2 files changed, 11 insertions, 2 deletions
diff --git a/templates/repo/diff/box.tmpl b/templates/repo/diff/box.tmpl
index b5fde36a6f..0179af2a51 100644
--- a/templates/repo/diff/box.tmpl
+++ b/templates/repo/diff/box.tmpl
@@ -7,7 +7,7 @@
{{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>
{{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)}}
{{template "repo/diff/new_review" .}}
{{end}}
@@ -26,7 +26,7 @@
{{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>
{{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)}}
{{template "repo/diff/new_review" .}}
{{end}}
diff --git a/templates/repo/diff/options_dropdown.tmpl b/templates/repo/diff/options_dropdown.tmpl
new file mode 100644
index 0000000000..9fca069f0a
--- /dev/null
+++ b/templates/repo/diff/options_dropdown.tmpl
@@ -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>