mirror of
https://github.com/go-gitea/gitea.git
synced 2025-10-16 21:56:05 +00:00
Improved comment rendering in "Files" view by adding Comments to DiffLine
Signed-off-by: Jonas Franz <info@jonasfranz.software>
This commit is contained in:
@@ -456,6 +456,12 @@ func ViewPullFiles(ctx *context.Context) {
|
||||
ctx.ServerError("GetDiffRange", err)
|
||||
return
|
||||
}
|
||||
|
||||
if err = diff.LoadComments(issue, ctx.User); err != nil {
|
||||
ctx.ServerError("LoadComments", err)
|
||||
return
|
||||
}
|
||||
|
||||
ctx.Data["Diff"] = diff
|
||||
ctx.Data["DiffNotAvailable"] = diff.NumFiles() == 0
|
||||
|
||||
@@ -470,13 +476,6 @@ func ViewPullFiles(ctx *context.Context) {
|
||||
ctx.Data["BeforeSourcePath"] = setting.AppSubURL + "/" + path.Join(headTarget, "src", "commit", startCommitID)
|
||||
ctx.Data["RawPath"] = setting.AppSubURL + "/" + path.Join(headTarget, "raw", "commit", endCommitID)
|
||||
ctx.Data["RequireHighlightJS"] = true
|
||||
|
||||
pathToLineToComment, err := models.FetchCodeComments(issue, ctx.User)
|
||||
if err != nil {
|
||||
ctx.ServerError("FetchCodeComments", err)
|
||||
return
|
||||
}
|
||||
ctx.Data["CodeComments"] = pathToLineToComment
|
||||
ctx.Data["CurrentReview"], err = models.GetCurrentReview(ctx.User, issue)
|
||||
if err != nil && !models.IsErrReviewNotExist(err) {
|
||||
ctx.ServerError("GetCurrentReview", err)
|
||||
|
Reference in New Issue
Block a user