mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-23 19:11:58 +01:00
[GITEA] always load outdated comments
(cherry picked from commit 2615dea9af
)
This commit is contained in:
parent
49b51cbdd7
commit
ecfc3cb3f0
2 changed files with 6 additions and 5 deletions
|
@ -153,7 +153,7 @@ func UpdateResolveConversation(ctx *context.Context) {
|
|||
}
|
||||
|
||||
func renderConversation(ctx *context.Context, comment *issues_model.Comment, origin string) {
|
||||
comments, err := issues_model.FetchCodeCommentsByLine(ctx, comment.Issue, ctx.Doer, comment.TreePath, comment.Line, ctx.Data["ShowOutdatedComments"].(bool))
|
||||
comments, err := issues_model.FetchCodeCommentsByLine(ctx, comment.Issue, ctx.Doer, comment.TreePath, comment.Line, true)
|
||||
if err != nil {
|
||||
ctx.ServerError("FetchCodeCommentsByLine", err)
|
||||
return
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
{{$invalid := (index .comments 0).Invalidated}}
|
||||
{{$resolved := (index .comments 0).IsResolved}}
|
||||
{{$resolveDoer := (index .comments 0).ResolveDoer}}
|
||||
{{$hideByDefault := or $resolved (and $invalid (not .ShowOutdatedComments))}}
|
||||
{{$isNotPending := (not (eq (index .comments 0).Review.Type 0))}}
|
||||
<div class="ui segments conversation-holder">
|
||||
<div class="ui segment collapsible-comment-box gt-py-3 gt-df gt-ac gt-sb">
|
||||
|
@ -14,7 +15,7 @@
|
|||
</div>
|
||||
<div>
|
||||
{{if or $invalid $resolved}}
|
||||
<button id="show-outdated-{{(index .comments 0).ID}}" data-comment="{{(index .comments 0).ID}}" class="{{if not $resolved}}gt-hidden {{end}}ui compact labeled button show-outdated gt-df gt-ac">
|
||||
<button id="show-outdated-{{(index .comments 0).ID}}" data-comment="{{(index .comments 0).ID}}" class="{{if not $hideByDefault}}gt-hidden {{end}}ui compact labeled button show-outdated gt-df gt-ac">
|
||||
{{svg "octicon-unfold" 16 "gt-mr-3"}}
|
||||
{{if $resolved}}
|
||||
{{ctx.Locale.Tr "repo.issues.review.show_resolved"}}
|
||||
|
@ -22,7 +23,7 @@
|
|||
{{ctx.Locale.Tr "repo.issues.review.show_outdated"}}
|
||||
{{end}}
|
||||
</button>
|
||||
<button id="hide-outdated-{{(index .comments 0).ID}}" data-comment="{{(index .comments 0).ID}}" class="{{if $resolved}}gt-hidden {{end}}ui compact labeled button hide-outdated gt-df gt-ac">
|
||||
<button id="hide-outdated-{{(index .comments 0).ID}}" data-comment="{{(index .comments 0).ID}}" class="{{if $hideByDefault}}gt-hidden {{end}}ui compact labeled button hide-outdated gt-df gt-ac">
|
||||
{{svg "octicon-fold" 16 "gt-mr-3"}}
|
||||
{{if $resolved}}
|
||||
{{ctx.Locale.Tr "repo.issues.review.hide_resolved"}}
|
||||
|
@ -36,7 +37,7 @@
|
|||
{{$diff := (CommentMustAsDiff ctx (index .comments 0))}}
|
||||
{{if $diff}}
|
||||
{{$file := (index $diff.Files 0)}}
|
||||
<div id="code-preview-{{(index .comments 0).ID}}" class="ui table segment{{if $resolved}} gt-hidden{{end}}">
|
||||
<div id="code-preview-{{(index .comments 0).ID}}" class="ui table segment{{if $hideByDefault}} gt-hidden{{end}}">
|
||||
<div class="diff-file-box diff-box file-content {{TabSizeClass $.Editorconfig $file.Name}}">
|
||||
<div class="file-body file-code code-view code-diff code-diff-unified unicode-escaped">
|
||||
<table>
|
||||
|
@ -48,7 +49,7 @@
|
|||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
<div id="code-comments-{{(index .comments 0).ID}}" class="comment-code-cloud ui segment{{if $resolved}} gt-hidden{{end}}">
|
||||
<div id="code-comments-{{(index .comments 0).ID}}" class="comment-code-cloud ui segment{{if $hideByDefault}} gt-hidden{{end}}">
|
||||
<div class="ui comments gt-mb-0">
|
||||
{{range .comments}}
|
||||
{{$createdSubStr:= TimeSinceUnix .CreatedUnix ctx.Locale}}
|
||||
|
|
Loading…
Reference in a new issue