From 8c909820a9fd1697bb690ec0451c4ead97b51505 Mon Sep 17 00:00:00 2001 From: blueworrybear Date: Tue, 15 Oct 2019 20:19:32 +0800 Subject: Enable Uploading/Removing Attachments When Editing an Issue/Comment (#8426) --- templates/repo/issue/view_content.tmpl | 25 +++++++++++++--------- templates/repo/issue/view_content/attachments.tmpl | 9 ++++++++ templates/repo/issue/view_content/comments.tmpl | 12 ++--------- 3 files changed, 26 insertions(+), 20 deletions(-) create mode 100644 templates/repo/issue/view_content/attachments.tmpl (limited to 'templates') diff --git a/templates/repo/issue/view_content.tmpl b/templates/repo/issue/view_content.tmpl index acabe34782..29d48d7089 100644 --- a/templates/repo/issue/view_content.tmpl +++ b/templates/repo/issue/view_content.tmpl @@ -46,7 +46,7 @@ {{end}}
{{.Issue.Content}}
-
+
{{$reactions := .Issue.Reactions.GroupByType}} {{if $reactions}} @@ -57,15 +57,7 @@ {{if .Issue.Attachments}}
- {{range .Issue.Attachments}} - - {{if FilenameIsImage .Name}} - - {{else}} - - {{end}} - - {{end}} + {{template "repo/issue/view_content/attachments" Dict "ctx" $ "Attachments" .Issue.Attachments}}
{{end}} @@ -182,6 +174,19 @@
{{$.i18n.Tr "loading"}}
+ {{if .IsAttachmentEnabled}} +
+
+
+ {{end}}
{{.i18n.Tr "repo.issues.cancel"}}
{{.i18n.Tr "repo.issues.save"}}
diff --git a/templates/repo/issue/view_content/attachments.tmpl b/templates/repo/issue/view_content/attachments.tmpl new file mode 100644 index 0000000000..e2d7d1b9de --- /dev/null +++ b/templates/repo/issue/view_content/attachments.tmpl @@ -0,0 +1,9 @@ +{{range .Attachments}} + + {{if FilenameIsImage .Name}} + + {{else}} + + {{end}} + +{{end}} \ No newline at end of file diff --git a/templates/repo/issue/view_content/comments.tmpl b/templates/repo/issue/view_content/comments.tmpl index a5f25954c7..e3ea9ba822 100644 --- a/templates/repo/issue/view_content/comments.tmpl +++ b/templates/repo/issue/view_content/comments.tmpl @@ -55,7 +55,7 @@ {{end}}
{{.Content}}
-
+
{{$reactions := .Reactions.GroupByType}} {{if $reactions}} @@ -66,15 +66,7 @@ {{if .Attachments}}
- {{range .Attachments}} - - {{if FilenameIsImage .Name}} - - {{else}} - - {{end}} - - {{end}} + {{template "repo/issue/view_content/attachments" Dict "ctx" $ "Attachments" .Attachments}}
{{end}} -- cgit v1.2.3