diff --git a/templates/repo/diff/box.tmpl b/templates/repo/diff/box.tmpl index a91a1bb91c..36fb7e01f9 100644 --- a/templates/repo/diff/box.tmpl +++ b/templates/repo/diff/box.tmpl @@ -114,48 +114,18 @@ + {{end}} - {{if index $.CodeComments $file.Name (mul $line.LeftIdx -1)}} - -
-
- - {{ template "repo/diff/comments" dict "root" $ "comments" (index $.CodeComments $file.Name (mul $line.LeftIdx -1))}} - -
-
- - - - - - - - - - -
-
- -
-
-
- -
-
- - - {{end}} + {{if index $.CodeComments $file.Name (mul $line.LeftIdx -1)}} + +
+
+ + {{ template "repo/diff/comments" dict "root" $ "comments" (index $.CodeComments $file.Name (mul $line.LeftIdx -1))}} + +
+ {{template "repo/diff/comment_form" .}} +
+ + {{end}}
{{if $line.RightIdx}}{{$section.GetComputedInlineDiffFor $line}}{{end}}
diff --git a/templates/repo/diff/comment_form.tmpl b/templates/repo/diff/comment_form.tmpl new file mode 100644 index 0000000000..ea604bcc45 --- /dev/null +++ b/templates/repo/diff/comment_form.tmpl @@ -0,0 +1,32 @@ +
+{{.CsrfTokenHtml}} + + + + + + + + + +
+
+ +
+
+
+ {{.i18n.Tr "loading"}} +
+ +
diff --git a/templates/repo/diff/new_comment.tmpl b/templates/repo/diff/new_comment.tmpl index f586c1567e..12779c0e6f 100644 --- a/templates/repo/diff/new_comment.tmpl +++ b/templates/repo/diff/new_comment.tmpl @@ -1,34 +1,3 @@
-
- {{.CsrfTokenHtml}} - - - - - - - - - -
-
- -
-
-
- {{.i18n.Tr "loading"}} -
- -
+ {{ template "repo/diff/comment_form" .}}