From e252d3bdb54a3344f59ea2ce179a1925806e130d Mon Sep 17 00:00:00 2001 From: Jonas Franz Date: Fri, 11 May 2018 11:05:09 +0200 Subject: [PATCH] Move new comment form to its own file Signed-off-by: Jonas Franz --- templates/repo/diff/box.tmpl | 54 ++++++--------------------- templates/repo/diff/comment_form.tmpl | 32 ++++++++++++++++ templates/repo/diff/new_comment.tmpl | 33 +--------------- 3 files changed, 45 insertions(+), 74 deletions(-) create mode 100644 templates/repo/diff/comment_form.tmpl 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" .}}