File tree Expand file tree Collapse file tree 3 files changed +4
-2
lines changed
templates/repo/issue/view_content Expand file tree Collapse file tree 3 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ import (
27
27
"code.gitea.io/gitea/modules/setting"
28
28
"code.gitea.io/gitea/modules/timeutil"
29
29
"code.gitea.io/gitea/modules/util"
30
+ "code.gitea.io/gitea/services/gitdiff"
30
31
31
32
"gopkg.in/editorconfig/editorconfig-core-go.v1"
32
33
)
@@ -230,6 +231,7 @@ func NewFuncMap() []template.FuncMap {
230
231
}
231
232
return float32 (n ) * 100 / float32 (sum )
232
233
},
234
+ "MustAsDiff" : gitdiff .CommentMustAsDiff ,
233
235
}}
234
236
}
235
237
Original file line number Diff line number Diff line change @@ -822,7 +822,7 @@ func CommentAsDiff(c *models.Comment) (*Diff, error) {
822
822
func CommentMustAsDiff (c * models.Comment ) * Diff {
823
823
diff , err := CommentAsDiff (c )
824
824
if err != nil {
825
- log .Warn ("MustAsDiff : %v" , err )
825
+ log .Warn ("CommentMustAsDiff : %v" , err )
826
826
}
827
827
return diff
828
828
}
Original file line number Diff line number Diff line change 319
319
{{end}}
320
320
<a href="{{(index $comms 0).CodeCommentURL}}" class="file-comment">{{$filename}}</a>
321
321
</div>
322
- {{$diff := ((index $comms 0).MustAsDiff )}}
322
+ {{$diff := (CommentMustAsDiff (index $comms 0))}}
323
323
{{if $diff}}
324
324
{{$file := (index $diff.Files 0)}}
325
325
<div id="code-preview-{{(index $comms 0).ID}}" class="ui table segment{{if $invalid}} hide{{end}}">
You can’t perform that action at this time.
0 commit comments