summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorKN4CK3R <admin@oldschoolhack.me>2021-06-15 03:12:33 +0200
committerGitHub <noreply@github.com>2021-06-14 21:12:33 -0400
commitebf253b841d56c5cb1e57cb1e5e50c06d315bdee (patch)
tree703f8c4d0302e578d402d6aa42635852303026df /templates
parent0adcea9ba6946e9479314e188afe53dcb39da6b0 (diff)
downloadgitea-ebf253b841d56c5cb1e57cb1e5e50c06d315bdee.tar.gz
gitea-ebf253b841d56c5cb1e57cb1e5e50c06d315bdee.zip
Add attachments for PR reviews (#16075)
* First step for multiple dropzones per page. * Allow attachments on review comments. * Lint. * Fixed accidental initialize of the review textarea. * Initialize SimpleMDE textarea. Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Diffstat (limited to 'templates')
-rw-r--r--templates/repo/diff/new_review.tmpl5
-rw-r--r--templates/repo/editor/upload.tmpl1
-rw-r--r--templates/repo/issue/comment_tab.tmpl1
-rw-r--r--templates/repo/issue/view_content.tmpl1
-rw-r--r--templates/repo/issue/view_content/comments.tmpl3
-rw-r--r--templates/repo/release/new.tmpl1
-rw-r--r--templates/repo/upload.tmpl5
7 files changed, 11 insertions, 6 deletions
diff --git a/templates/repo/diff/new_review.tmpl b/templates/repo/diff/new_review.tmpl
index 9e65d6d420..cbaabe255e 100644
--- a/templates/repo/diff/new_review.tmpl
+++ b/templates/repo/diff/new_review.tmpl
@@ -15,6 +15,11 @@
<div class="ui field">
<textarea name="content" tabindex="0" rows="2" placeholder="{{$.i18n.Tr "repo.diff.review.placeholder"}}"></textarea>
</div>
+ {{if .IsAttachmentEnabled}}
+ <div class="field">
+ {{template "repo/upload" .}}
+ </div>
+ {{end}}
<div class="ui divider"></div>
<button type="submit" name="type" value="approve" {{ if and $.IsSigned ($.Issue.IsPoster $.SignedUser.ID) }} disabled {{ end }} class="ui submit green tiny button btn-submit">{{$.i18n.Tr "repo.diff.review.approve"}}</button>
<button type="submit" name="type" value="comment" class="ui submit tiny basic button btn-submit">{{$.i18n.Tr "repo.diff.review.comment"}}</button>
diff --git a/templates/repo/editor/upload.tmpl b/templates/repo/editor/upload.tmpl
index 488465120e..fb00615abd 100644
--- a/templates/repo/editor/upload.tmpl
+++ b/templates/repo/editor/upload.tmpl
@@ -26,7 +26,6 @@
</div>
</div>
<div class="field">
- <div class="files"></div>
{{template "repo/upload" .}}
</div>
{{template "repo/editor/commit_form" .}}
diff --git a/templates/repo/issue/comment_tab.tmpl b/templates/repo/issue/comment_tab.tmpl
index 77e82930dc..22e1d5af84 100644
--- a/templates/repo/issue/comment_tab.tmpl
+++ b/templates/repo/issue/comment_tab.tmpl
@@ -14,7 +14,6 @@
</div>
{{if .IsAttachmentEnabled}}
<div class="field">
- <div class="files"></div>
{{template "repo/upload" .}}
</div>
{{end}}
diff --git a/templates/repo/issue/view_content.tmpl b/templates/repo/issue/view_content.tmpl
index 00ce61921d..d2928df342 100644
--- a/templates/repo/issue/view_content.tmpl
+++ b/templates/repo/issue/view_content.tmpl
@@ -197,7 +197,6 @@
</div>
{{if .IsAttachmentEnabled}}
<div class="field">
- <div class="comment-files"></div>
{{template "repo/upload" .}}
</div>
{{end}}
diff --git a/templates/repo/issue/view_content/comments.tmpl b/templates/repo/issue/view_content/comments.tmpl
index 53005cc820..de31430ce0 100644
--- a/templates/repo/issue/view_content/comments.tmpl
+++ b/templates/repo/issue/view_content/comments.tmpl
@@ -449,6 +449,9 @@
<span class="no-content">{{$.i18n.Tr "repo.issues.no_content"}}</span>
{{end}}
</div>
+ {{if .Attachments}}
+ {{template "repo/issue/view_content/attachments" Dict "ctx" $ "Attachments" .Attachments "Content" .RenderedContent}}
+ {{end}}
</div>
</div>
</div>
diff --git a/templates/repo/release/new.tmpl b/templates/repo/release/new.tmpl
index c4b36597c6..49759713aa 100644
--- a/templates/repo/release/new.tmpl
+++ b/templates/repo/release/new.tmpl
@@ -76,7 +76,6 @@
{{end}}
{{if .IsAttachmentEnabled}}
<div class="field">
- <div class="files"></div>
{{template "repo/upload" .}}
</div>
{{end}}
diff --git a/templates/repo/upload.tmpl b/templates/repo/upload.tmpl
index 9215da2b19..3dd40d1b27 100644
--- a/templates/repo/upload.tmpl
+++ b/templates/repo/upload.tmpl
@@ -1,6 +1,5 @@
<div
class="ui dropzone"
- id="dropzone"
data-link-url="{{.UploadLinkUrl}}"
data-upload-url="{{.UploadUrl}}"
data-remove-url="{{.UploadRemoveUrl}}"
@@ -11,4 +10,6 @@
data-invalid-input-type="{{.i18n.Tr "dropzone.invalid_input_type"}}"
data-file-too-big="{{.i18n.Tr "dropzone.file_too_big"}}"
data-remove-file="{{.i18n.Tr "dropzone.remove_file"}}"
-></div>
+>
+ <div class="files"></div>
+</div>