From 30a783879f86fc69409d2e2dae2945ea6ae52f0c Mon Sep 17 00:00:00 2001 From: sebastian-sauer Date: Thu, 22 Jun 2023 10:34:42 +0200 Subject: Show outdated comments in files changed tab (#24936) (#25428) Backport #24936 If enabled show a clickable label in the comment. A click on the label opens the Conversation tab with the comment focussed - there you're able to view the old diff (or original diff the comment was created on). **Screenshots** ![image](https://github.com/go-gitea/gitea/assets/1135157/63ab9571-a9ee-4900-9f02-94ab0095f9e7) ![image](https://github.com/go-gitea/gitea/assets/1135157/78f7c225-8d76-46f5-acfd-9b8aab988a6c) When resolved and outdated: ![image](https://github.com/go-gitea/gitea/assets/1135157/6ece9ebd-c792-4aa5-9c35-628694e9d093) Option to enable/disable this (stored in user settings - default is disabled): ![image](https://github.com/go-gitea/gitea/assets/1135157/ed99dfe4-76dc-4c12-bd96-e7e62da50ab5) ![image](https://github.com/go-gitea/gitea/assets/1135157/e837a052-e92e-4a28-906d-9db5bacf93a6) fixes #24913 Co-authored-by: silverwind --- templates/repo/diff/comments.tmpl | 6 ++++++ templates/repo/diff/conversation.tmpl | 15 +++++++++++++-- templates/repo/diff/options_dropdown.tmpl | 15 +++++++++++++++ templates/repo/diff/whitespace_dropdown.tmpl | 10 +++++----- templates/repo/issue/view_content/comments.tmpl | 2 +- 5 files changed, 40 insertions(+), 8 deletions(-) (limited to 'templates') diff --git a/templates/repo/diff/comments.tmpl b/templates/repo/diff/comments.tmpl index 5b0b32cc97..d19ac1f047 100644 --- a/templates/repo/diff/comments.tmpl +++ b/templates/repo/diff/comments.tmpl @@ -31,6 +31,12 @@ {{end}}
+ {{if .Invalidated}} + {{$referenceUrl := printf "%s#%s" $.root.Issue.Link .HashTag}} + + {{$.root.locale.Tr "repo.issues.review.outdated"}} + + {{end}} {{if and .Review}} {{if eq .Review.Type 0}}
diff --git a/templates/repo/diff/conversation.tmpl b/templates/repo/diff/conversation.tmpl index 8d4064967e..ce344794ea 100644 --- a/templates/repo/diff/conversation.tmpl +++ b/templates/repo/diff/conversation.tmpl @@ -1,14 +1,25 @@ {{$resolved := (index .comments 0).IsResolved}} +{{$invalid := (index .comments 0).Invalidated}} {{$resolveDoer := (index .comments 0).ResolveDoer}} {{$isNotPending := (not (eq (index .comments 0).Review.Type 0))}} +{{$referenceUrl := printf "%s#%s" $.Issue.Link (index .comments 0).HashTag}}
{{if $resolved}}
-
+
{{svg "octicon-check" 16 "icon gt-mr-2"}} {{$resolveDoer.Name}} {{$.locale.Tr "repo.issues.review.resolved_by"}} + {{if $invalid}} + + + {{$.locale.Tr "repo.issues.review.outdated"}} + + {{end}}
-
+
diff --git a/templates/repo/diff/whitespace_dropdown.tmpl b/templates/repo/diff/whitespace_dropdown.tmpl index cf2ec92e7d..2bd8f2fb79 100644 --- a/templates/repo/diff/whitespace_dropdown.tmpl +++ b/templates/repo/diff/whitespace_dropdown.tmpl @@ -1,25 +1,25 @@ -{{if .IsSplitStyle}}{{svg "gitea-join"}}{{else}}{{svg "gitea-split"}}{{end}} +{{if .IsSplitStyle}}{{svg "gitea-join"}}{{else}}{{svg "gitea-split"}}{{end}} diff --git a/templates/repo/issue/view_content/comments.tmpl b/templates/repo/issue/view_content/comments.tmpl index 0652198adf..5fd46e9e68 100644 --- a/templates/repo/issue/view_content/comments.tmpl +++ b/templates/repo/issue/view_content/comments.tmpl @@ -488,7 +488,7 @@
{{$filename}} {{if $invalid}} - + {{$.locale.Tr "repo.issues.review.outdated"}} {{end}} -- cgit v1.2.3