diff options
Diffstat (limited to 'templates')
-rw-r--r-- | templates/repo/issue/view_content/pull.tmpl | 42 | ||||
-rw-r--r-- | templates/swagger/v1_json.tmpl | 10 |
2 files changed, 50 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"> diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl index ee759ba6b1..90a32e28af 100644 --- a/templates/swagger/v1_json.tmpl +++ b/templates/swagger/v1_json.tmpl @@ -8128,6 +8128,16 @@ "name": "index", "in": "path", "required": true + }, + { + "enum": [ + "merge", + "rebase" + ], + "type": "string", + "description": "how to update pull request", + "name": "style", + "in": "query" } ], "responses": { |