|
|
@ -752,11 +752,27 @@ func ViewPullFiles(ctx *context.Context) { |
|
|
|
if ctx.Written() { |
|
|
|
if ctx.Written() { |
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
ctx.Data["CurrentReview"], err = models.GetCurrentReview(ctx.Doer, issue) |
|
|
|
|
|
|
|
|
|
|
|
currentReview, err := models.GetCurrentReview(ctx.Doer, issue) |
|
|
|
if err != nil && !models.IsErrReviewNotExist(err) { |
|
|
|
if err != nil && !models.IsErrReviewNotExist(err) { |
|
|
|
ctx.ServerError("GetCurrentReview", err) |
|
|
|
ctx.ServerError("GetCurrentReview", err) |
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
numPendingCodeComments := int64(0) |
|
|
|
|
|
|
|
if currentReview != nil { |
|
|
|
|
|
|
|
numPendingCodeComments, err = models.CountComments(&models.FindCommentsOptions{ |
|
|
|
|
|
|
|
Type: models.CommentTypeCode, |
|
|
|
|
|
|
|
ReviewID: currentReview.ID, |
|
|
|
|
|
|
|
IssueID: issue.ID, |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
if err != nil { |
|
|
|
|
|
|
|
ctx.ServerError("CountComments", err) |
|
|
|
|
|
|
|
return |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
ctx.Data["CurrentReview"] = currentReview |
|
|
|
|
|
|
|
ctx.Data["PendingCodeCommentNumber"] = numPendingCodeComments |
|
|
|
|
|
|
|
|
|
|
|
getBranchData(ctx, issue) |
|
|
|
getBranchData(ctx, issue) |
|
|
|
ctx.Data["IsIssuePoster"] = ctx.IsSigned && issue.IsPoster(ctx.Doer.ID) |
|
|
|
ctx.Data["IsIssuePoster"] = ctx.IsSigned && issue.IsPoster(ctx.Doer.ID) |
|
|
|
ctx.Data["HasIssuesOrPullsWritePermission"] = ctx.Repo.CanWriteIssuesOrPulls(issue.IsPull) |
|
|
|
ctx.Data["HasIssuesOrPullsWritePermission"] = ctx.Repo.CanWriteIssuesOrPulls(issue.IsPull) |
|
|
|