Skip to content

Commit 9ba07c1

Browse files
committed
Tweak pull request branch delete ui
1 parent 8dc6eab commit 9ba07c1

File tree

1 file changed

+16
-15
lines changed

1 file changed

+16
-15
lines changed

templates/repo/issue/view_content/pull.tmpl

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -131,24 +131,25 @@
131131
{{$showGeneralMergeForm := false}}
132132
<div class="ui attached merge-section segment {{if not $.LatestCommitStatus}}no-header{{end}}">
133133
{{if .Issue.PullRequest.HasMerged}}
134-
<div class="item text">
135-
{{if .Issue.PullRequest.MergedCommitID}}
136-
{{$link := printf "%s/commit/%s" $.Repository.Link (.Issue.PullRequest.MergedCommitID|PathEscape)}}
137-
{{if eq $.Issue.PullRequest.Status 3}}
138-
{{$.locale.Tr "repo.pulls.manually_merged_as" ($link|Escape) (ShortSha .Issue.PullRequest.MergedCommitID) | Safe}}
134+
<div class="item item-section text gt-f1">
135+
<div class="item-section-left">
136+
{{if .Issue.PullRequest.MergedCommitID}}
137+
{{$link := printf "%s/commit/%s" $.Repository.Link (.Issue.PullRequest.MergedCommitID|PathEscape)}}
138+
{{if eq $.Issue.PullRequest.Status 3}}
139+
{{$.locale.Tr "repo.pulls.manually_merged_as" ($link|Escape) (ShortSha .Issue.PullRequest.MergedCommitID) | Safe}}
140+
{{else}}
141+
{{$.locale.Tr "repo.pulls.merged_as" ($link|Escape) (ShortSha .Issue.PullRequest.MergedCommitID) | Safe}}
142+
{{end}}
139143
{{else}}
140-
{{$.locale.Tr "repo.pulls.merged_as" ($link|Escape) (ShortSha .Issue.PullRequest.MergedCommitID) | Safe}}
144+
{{$.locale.Tr "repo.pulls.has_merged"}}
141145
{{end}}
142-
{{else}}
143-
{{$.locale.Tr "repo.pulls.has_merged"}}
146+
</div>
147+
{{if .IsPullBranchDeletable}}
148+
<div class="item-section-right">
149+
<button class="delete-button ui button" data-url="{{.DeleteBranchLink}}">{{$.locale.Tr "repo.branch.delete_html"}}</a>
150+
</div>
144151
{{end}}
145152
</div>
146-
{{if .IsPullBranchDeletable}}
147-
<div class="ui divider"></div>
148-
<div>
149-
<a class="delete-button ui red button" href="" data-url="{{.DeleteBranchLink}}">{{$.locale.Tr "repo.branch.delete" .HeadTarget}}</a>
150-
</div>
151-
{{end}}
152153
{{else if .Issue.IsClosed}}
153154
<div class="item text">
154155
{{if .IsPullRequestBroken}}
@@ -471,7 +472,7 @@
471472
</div>
472473
{{end}}
473474

474-
{{if and .ShowMergeInstructions .Issue.PullRequest.HeadRepo}}
475+
{{if and .ShowMergeInstructions .Issue.PullRequest.HeadRepo (not .Issue.PullRequest.HasMerged)}}
475476
{{template "repo/issue/view_content/pull_merge_instruction" (dict "locale" .locale "Issue" .Issue)}}
476477
{{end}}
477478
</div>

0 commit comments

Comments
 (0)