|
75 | 75 | {{- else}}red{{end}}">{{svg "octicon-git-merge" 32}}</a> |
76 | 76 | <div class="content"> |
77 | 77 | {{template "repo/pulls/status" .}} |
| 78 | + {{$canAutoMerge := false}} |
78 | 79 | <div class="ui attached merge-section segment {{if not $.LatestCommitStatus}}no-header{{end}}"> |
79 | 80 | {{if .Issue.PullRequest.HasMerged}} |
80 | 81 | <div class="item text purple"> |
|
188 | 189 | {{$.i18n.Tr (printf "repo.signing.wont_sign.%s" .WontSignReason) }} |
189 | 190 | </div> |
190 | 191 | {{end}} |
| 192 | + {{end}} |
| 193 | + |
| 194 | + {{$canAutoMerge = true}} |
| 195 | + {{if (gt .Issue.PullRequest.CommitsBehind 0)}} |
| 196 | + <div class="ui divider"></div> |
| 197 | + <div class="item item-section text grey"> |
| 198 | + <div class="item-section-left"> |
| 199 | + <i class="icon icon-octicon">{{svg "octicon-alert" 16}}</i> |
| 200 | + {{$.i18n.Tr "repo.pulls.outdated_with_base_branch"}} |
| 201 | + </div> |
| 202 | + <div class="item-section-right"> |
| 203 | + {{if .UpdateAllowed}} |
| 204 | + <form action="{{.Link}}/update" method="post" class="ui update-branch-form"> |
| 205 | + {{.CsrfTokenHtml}} |
| 206 | + <button class="ui compact button" data-do="update"> |
| 207 | + <span class="ui text">{{$.i18n.Tr "repo.pulls.update_branch"}}</span> |
| 208 | + </button> |
| 209 | + </form> |
| 210 | + {{end}} |
| 211 | + </div> |
| 212 | + </div> |
| 213 | + {{end}} |
| 214 | + |
| 215 | + {{if and (or $.IsRepoAdmin (not $notAllOverridableChecksOk)) (or (not .RequireSigned) .WillSign)}} |
191 | 216 | {{if .AllowMerge}} |
192 | 217 | {{$prUnit := .Repository.MustGetUnit $.UnitTypePullRequests}} |
193 | 218 | {{$approvers := .Issue.PullRequest.GetApprovers}} |
|
300 | 325 | </div> |
301 | 326 | </div> |
302 | 327 | {{else}} |
| 328 | + <div class="ui divider"></div> |
303 | 329 | <div class="item text red"> |
304 | 330 | {{svg "octicon-x" 16}} |
305 | 331 | {{$.i18n.Tr "repo.pulls.no_merge_desc"}} |
|
310 | 336 | </div> |
311 | 337 | {{end}} |
312 | 338 | {{else}} |
| 339 | + <div class="ui divider"></div> |
313 | 340 | <div class="item text grey"> |
314 | 341 | {{svg "octicon-info" 16}} |
315 | 342 | {{$.i18n.Tr "repo.pulls.no_merge_access"}} |
316 | 343 | </div> |
317 | 344 | {{end}} |
318 | 345 | {{end}} |
319 | | - {{if gt .Issue.PullRequest.CommitsBehind 0}} |
320 | | - <div class="ui very compact branch-update grid"> |
321 | | - <div class="row"> |
322 | | - <div class="item text gray eleven wide left floated column"> |
323 | | - <i class="icon icon-octicon">{{svg "octicon-alert" 16}}</i> |
324 | | - {{$.i18n.Tr "repo.pulls.outdated_with_base_branch"}} |
325 | | - </div> |
326 | | - {{if .UpdateAllowed}} |
327 | | - <div class="item text five wide right floated column"> |
328 | | - <form action="{{.Link}}/update" method="post"> |
329 | | - {{.CsrfTokenHtml}} |
330 | | - <button class="ui button" data-do="update"> |
331 | | - <span class="item text">{{$.i18n.Tr "repo.pulls.update_branch"}}</span> |
332 | | - </button> |
333 | | - </form> |
334 | | - </div> |
335 | | - {{end}} |
336 | | - </div> |
337 | | - </div> |
338 | | - {{end}} |
339 | 346 | {{else}} |
340 | 347 | {{/* Merge conflict without specific file. Suggest manual merge, only if all reviews and status checks OK. */}} |
341 | 348 | {{if .IsBlockedByApprovals}} |
|
374 | 381 | </div> |
375 | 382 | {{end}} |
376 | 383 | {{end}} |
| 384 | + |
| 385 | + {{if and (gt .Issue.PullRequest.CommitsBehind 0) (not .Issue.IsClosed) (not .Issue.PullRequest.IsChecking) (not .IsPullFilesConflicted) (not .IsPullRequestBroken) (not $canAutoMerge)}} |
| 386 | + <div class="item text grey"> |
| 387 | + <i class="icon icon-octicon">{{svg "octicon-alert" 16}}</i> |
| 388 | + {{$.i18n.Tr "repo.pulls.outdated_with_base_branch"}} |
| 389 | + {{if .UpdateAllowed}} |
| 390 | + <form action="{{.Link}}/update" method="post" class="ui floating right"> |
| 391 | + {{.CsrfTokenHtml}} |
| 392 | + <button class="ui compact button" data-do="update"> |
| 393 | + <span class="ui text">{{$.i18n.Tr "repo.pulls.update_branch"}}</span> |
| 394 | + </button> |
| 395 | + </form> |
| 396 | + {{end}} |
| 397 | + </div> |
| 398 | + {{end}} |
377 | 399 | </div> |
378 | 400 | </div> |
379 | 401 | </div> |
0 commit comments