diff options
author | a1012112796 <1012112796@qq.com> | 2021-08-31 22:03:45 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-31 16:03:45 +0200 |
commit | cbf05c3f795c1eed999dafe8d0757495e07f1ee2 (patch) | |
tree | e9b227ef8dd8d836b04bd126806c8a1264b750ee /templates/repo/issue | |
parent | 2bb32006fd560af44426a06f63f83e3c70c3f258 (diff) | |
download | gitea-cbf05c3f795c1eed999dafe8d0757495e07f1ee2.tar.gz gitea-cbf05c3f795c1eed999dafe8d0757495e07f1ee2.zip |
Add option to update pull request by `rebase` (#16125)
* add option to update pull request by `rebase`
Signed-off-by: a1012112796 <1012112796@qq.com>
Diffstat (limited to 'templates/repo/issue')
-rw-r--r-- | templates/repo/issue/view_content/pull.tmpl | 42 |
1 files changed, 40 insertions, 2 deletions
diff --git a/templates/repo/issue/view_content/pull.tmpl b/templates/repo/issue/view_content/pull.tmpl index 15ce63b4d3..2e624a9fbf 100644 --- a/templates/repo/issue/view_content/pull.tmpl +++ b/templates/repo/issue/view_content/pull.tmpl @@ -281,7 +281,26 @@ {{$.i18n.Tr "repo.pulls.outdated_with_base_branch"}} </div> <div class="item-section-right"> - {{if .UpdateAllowed}} + {{if and .UpdateAllowed .UpdateByRebaseAllowed }} + <div class="dib"> + <div class="ui buttons update-button"> + <button class="ui button" data-do="{{.Link}}/update" data-redirect="{{.Link}}"> + <span class="button-text"> + {{$.i18n.Tr "repo.pulls.update_branch"}} + </span> + </button> + + <div class="ui dropdown icon button no-text"> + {{svg "octicon-triangle-down" 14 "dropdown icon"}} + <div class="menu"> + <div class="item active selected" data-do="{{.Link}}/update">{{$.i18n.Tr "repo.pulls.update_branch"}}</div> + <div class="item" data-do="{{.Link}}/update?style=rebase">{{$.i18n.Tr "repo.pulls.update_branch_rebase"}}</div> + </div> + </div> + </div> + </div> + {{end}} + {{if and .UpdateAllowed (not .UpdateByRebaseAllowed)}} <form action="{{.Link}}/update" method="post" class="ui update-branch-form"> {{.CsrfTokenHtml}} <button class="ui compact button" data-do="update"> @@ -560,7 +579,26 @@ {{$.i18n.Tr "repo.pulls.outdated_with_base_branch"}} </div> <div> - {{if .UpdateAllowed}} + {{if and .UpdateAllowed .UpdateByRebaseAllowed }} + <div class="dib"> + <div class="ui buttons update-button"> + <button class="ui button" data-do="{{.Link}}/update" data-redirect="{{.Link}}"> + <span class="button-text"> + {{$.i18n.Tr "repo.pulls.update_branch"}} + </span> + </button> + + <div class="ui dropdown icon button no-text"> + {{svg "octicon-triangle-down" 14 "dropdown icon"}} + <div class="menu"> + <div class="item active selected" data-do="{{.Link}}/update">{{$.i18n.Tr "repo.pulls.update_branch"}}</div> + <div class="item" data-do="{{.Link}}/update?style=rebase">{{$.i18n.Tr "repo.pulls.update_branch_rebase"}}</div> + </div> + </div> + </div> + </div> + {{end}} + {{if and .UpdateAllowed (not .UpdateByRebaseAllowed)}} <form action="{{.Link}}/update" method="post"> {{.CsrfTokenHtml}} <button class="ui compact button" data-do="update"> |