diff --git a/templates/repo/diff/box.tmpl b/templates/repo/diff/box.tmpl index f6e49126b..61b278899 100644 --- a/templates/repo/diff/box.tmpl +++ b/templates/repo/diff/box.tmpl @@ -57,14 +57,12 @@

- {{if not $file.IsRenamed}} - + {{.Addition}} - -
-
-
- - {{.Deletion}} - {{end}} + + {{.Addition}} + +
+
+
+ - {{.Deletion}}
{{$file.Name}}
{{$.i18n.Tr "repo.diff.file_suppressed"}}
@@ -97,7 +95,7 @@
{{if $file.IsBin}} {{$.i18n.Tr "repo.diff.bin"}} - {{else if not $file.IsRenamed}} + {{else}} + {{.Addition}}
@@ -119,138 +117,136 @@ {{end}}

- {{if ne $file.Type 4}} -
- - - {{if $isImage}} - {{template "repo/diff/image_diff" dict "file" . "root" $}} - {{else}} - {{if $.IsSplitStyle}} - {{range $j, $section := $file.Sections}} - {{range $k, $line := $section.Lines}} - - {{if eq .GetType 4}} - - - {{else}} - - - - - - - {{end}} - - {{if gt (len $line.Comments) 0}} - {{$resolved := (index $line.Comments 0).IsResolved}} - {{$resolveDoer := (index $line.Comments 0).ResolveDoer}} - {{$isNotPending := (not (eq (index $line.Comments 0).Review.Type 0))}} - - - - - - - - +
+
- {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 5) }} - - {{svg "octicon-fold-down"}} - - {{end}} - {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 4) }} - - {{svg "octicon-fold-up"}} - - {{end}} - {{if eq $line.GetExpandDirection 2}} - - {{svg "octicon-fold"}} - - {{end}} - {{$section.GetComputedInlineDiffFor $line}}{{if $line.LeftIdx}}{{end}}{{if and $.SignedUserID $line.CanComment $.PageIsPullFiles (not (eq .GetType 2))}}{{end}}{{if $line.LeftIdx}}{{$section.GetComputedInlineDiffFor $line}}{{end}}{{if $line.RightIdx}}{{end}}{{if and $.SignedUserID $line.CanComment $.PageIsPullFiles (not (eq .GetType 3))}}{{end}}{{if $line.RightIdx}}{{$section.GetComputedInlineDiffFor $line}}{{end}}
-
- {{if and $resolved (eq $line.GetCommentSide "previous")}} -
- {{$resolveDoer.Name}} {{$.i18n.Tr "repo.issues.review.resolved_by"}} - - -
- {{end}} - {{if eq $line.GetCommentSide "previous"}} -
-
- - {{ template "repo/diff/comments" dict "root" $ "comments" $line.Comments}} - -
- {{template "repo/diff/comment_form_datahandler" dict "reply" (index $line.Comments 0).ReviewID "hidden" true "root" $ "comment" (index $line.Comments 0)}} - {{if and $.CanMarkConversation $isNotPending}} - - {{end}} -
- {{end}} -
-
-
- {{if and $resolved (eq $line.GetCommentSide "proposed")}} -
- {{$resolveDoer.Name}} {{$.i18n.Tr "repo.issues.review.resolved_by"}} - - -
- {{end}} - {{if eq $line.GetCommentSide "proposed"}} -
-
- - {{ template "repo/diff/comments" dict "root" $ "comments" $line.Comments}} - -
- {{template "repo/diff/comment_form_datahandler" dict "reply" (index $line.Comments 0).ReviewID "hidden" true "root" $ "comment" (index $line.Comments 0)}} - {{if and $.CanMarkConversation $isNotPending}} - - {{end}} -
- {{end}} -
-
+ + {{if $isImage}} + {{template "repo/diff/image_diff" dict "file" . "root" $}} + {{else}} + {{if $.IsSplitStyle}} + {{range $j, $section := $file.Sections}} + {{range $k, $line := $section.Lines}} + + {{if eq .GetType 4}} + + + {{else}} + + + + + + {{end}} + + {{if gt (len $line.Comments) 0}} + {{$resolved := (index $line.Comments 0).IsResolved}} + {{$resolveDoer := (index $line.Comments 0).ResolveDoer}} + {{$isNotPending := (not (eq (index $line.Comments 0).Review.Type 0))}} + + + + + + + + {{end}} {{end}} - {{else}} - {{template "repo/diff/section_unified" dict "file" . "root" $}} {{end}} + {{else}} + {{template "repo/diff/section_unified" dict "file" . "root" $}} {{end}} - -
+ {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 5) }} + + {{svg "octicon-fold-down"}} + + {{end}} + {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 4) }} + + {{svg "octicon-fold-up"}} + + {{end}} + {{if eq $line.GetExpandDirection 2}} + + {{svg "octicon-fold"}} + + {{end}} + {{$section.GetComputedInlineDiffFor $line}}{{if $line.LeftIdx}}{{end}}{{if and $.SignedUserID $line.CanComment $.PageIsPullFiles (not (eq .GetType 2))}}{{end}}{{if $line.LeftIdx}}{{$section.GetComputedInlineDiffFor $line}}{{end}}{{if $line.RightIdx}}{{end}}{{if and $.SignedUserID $line.CanComment $.PageIsPullFiles (not (eq .GetType 3))}}{{end}}{{if $line.RightIdx}}{{$section.GetComputedInlineDiffFor $line}}{{end}}
+
+ {{if and $resolved (eq $line.GetCommentSide "previous")}} +
+ {{$resolveDoer.Name}} {{$.i18n.Tr "repo.issues.review.resolved_by"}} + + +
+ {{end}} + {{if eq $line.GetCommentSide "previous"}} +
+
+ + {{ template "repo/diff/comments" dict "root" $ "comments" $line.Comments}} + +
+ {{template "repo/diff/comment_form_datahandler" dict "reply" (index $line.Comments 0).ReviewID "hidden" true "root" $ "comment" (index $line.Comments 0)}} + {{if and $.CanMarkConversation $isNotPending}} + + {{end}} +
+ {{end}} +
+
+
+ {{if and $resolved (eq $line.GetCommentSide "proposed")}} +
+ {{$resolveDoer.Name}} {{$.i18n.Tr "repo.issues.review.resolved_by"}} + + +
+ {{end}} + {{if eq $line.GetCommentSide "proposed"}} +
+
+ + {{ template "repo/diff/comments" dict "root" $ "comments" $line.Comments}} + +
+ {{template "repo/diff/comment_form_datahandler" dict "reply" (index $line.Comments 0).ReviewID "hidden" true "root" $ "comment" (index $line.Comments 0)}} + {{if and $.CanMarkConversation $isNotPending}} + + {{end}} +
+ {{end}} +
+
-
- {{end}} + {{end}} + + +
{{end}}