summaryrefslogtreecommitdiffstats
path: root/routers/repo/issue.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/repo/issue.go')
-rw-r--r--routers/repo/issue.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/routers/repo/issue.go b/routers/repo/issue.go
index 1cf5722ed1..104c893136 100644
--- a/routers/repo/issue.go
+++ b/routers/repo/issue.go
@@ -661,6 +661,15 @@ func ViewIssue(ctx *context.Context) {
}
}
+ if issue.IsPull {
+ pull := issue.PullRequest
+ ctx.Data["IsPullBranchDeletable"] = ctx.Repo.IsWriter() && ctx.Repo.GitRepo.IsBranchExist(pull.HeadBranch)
+
+ deleteBranchURL := ctx.Repo.RepoLink + "/branches/" + pull.HeadBranch + "/delete"
+ queryParams := "?redirect_to=" + ctx.Data["Link"].(string)
+ ctx.Data["DeleteBranchLink"] = deleteBranchURL + queryParams
+ }
+
ctx.Data["Participants"] = participants
ctx.Data["NumParticipants"] = len(participants)
ctx.Data["Issue"] = issue