aboutsummaryrefslogtreecommitdiffstats
path: root/templates/repo
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2020-10-11 00:49:59 +0100
committerGitHub <noreply@github.com>2020-10-11 00:49:59 +0100
commit7eb846013299465e4cd73f76f13a00984183146e (patch)
tree0263f6af28d7b3247545fff3632ba94c9119a58e /templates/repo
parent6f2784911fe739d3b83787b7984c1b8a2fb31690 (diff)
downloadgitea-7eb846013299465e4cd73f76f13a00984183146e.tar.gz
gitea-7eb846013299465e4cd73f76f13a00984183146e.zip
Fix attachments list in edit comment (#13036)
#11141 broke the appearance of dropzone attachments when editting comments causing poorly updating lists. This PR fixes this. Fix #12583 Signed-off-by: Andrew Thornton art27@cantab.net
Diffstat (limited to 'templates/repo')
-rw-r--r--templates/repo/issue/view_content.tmpl8
-rw-r--r--templates/repo/issue/view_content/attachments.tmpl2
-rw-r--r--templates/repo/issue/view_content/comments.tmpl8
-rw-r--r--templates/repo/upload.tmpl1
4 files changed, 12 insertions, 7 deletions
diff --git a/templates/repo/issue/view_content.tmpl b/templates/repo/issue/view_content.tmpl
index a4ce0a7106..190f5117b8 100644
--- a/templates/repo/issue/view_content.tmpl
+++ b/templates/repo/issue/view_content.tmpl
@@ -65,9 +65,11 @@
<div id="comment-{{.Issue.ID}}" class="raw-content hide">{{.Issue.Content}}</div>
<div class="edit-content-zone hide" data-write="issue-{{.Issue.ID}}-write" data-preview="issue-{{.Issue.ID}}-preview" data-update-url="{{$.RepoLink}}/issues/{{.Issue.Index}}/content" data-context="{{.RepoLink}}" data-attachment-url="{{$.RepoLink}}/issues/{{.Issue.Index}}/attachments" data-view-attachment-url="{{$.RepoLink}}/issues/{{.Issue.Index}}/view-attachments"></div>
{{if .Issue.Attachments}}
- <div class="ui clearing divider"></div>
- <div class="ui middle aligned padded grid">
- {{template "repo/issue/view_content/attachments" Dict "ctx" $ "Attachments" .Issue.Attachments}}
+ <div class="dropzone-attachments">
+ <div class="ui clearing divider"></div>
+ <div class="ui middle aligned padded grid">
+ {{template "repo/issue/view_content/attachments" Dict "ctx" $ "Attachments" .Issue.Attachments}}
+ </div>
</div>
{{end}}
</div>
diff --git a/templates/repo/issue/view_content/attachments.tmpl b/templates/repo/issue/view_content/attachments.tmpl
index 1144b9a77a..d76c0bbfa2 100644
--- a/templates/repo/issue/view_content/attachments.tmpl
+++ b/templates/repo/issue/view_content/attachments.tmpl
@@ -2,7 +2,7 @@
<div class="twelve wide column" style="padding: 6px;">
<a target="_blank" rel="noopener noreferrer" href="{{.DownloadURL}}" title='{{$.ctx.i18n.Tr "repo.issues.attachment.open_tab" .Name}}'>
{{if FilenameIsImage .Name}}
- <span class="ui image">{{svg "octicon-file-media"}}</span>
+ <span class="ui image">{{svg "octicon-file"}}</span>
{{else}}
<span class="ui image">{{svg "octicon-desktop-download"}}</span>
{{end}}
diff --git a/templates/repo/issue/view_content/comments.tmpl b/templates/repo/issue/view_content/comments.tmpl
index a730bd5e8b..3b70a10715 100644
--- a/templates/repo/issue/view_content/comments.tmpl
+++ b/templates/repo/issue/view_content/comments.tmpl
@@ -57,9 +57,11 @@
<div id="comment-{{.ID}}" class="raw-content hide">{{.Content}}</div>
<div class="edit-content-zone hide" data-write="issuecomment-{{.ID}}-write" data-preview="issuecomment-{{.ID}}-preview" data-update-url="{{$.RepoLink}}/comments/{{.ID}}" data-context="{{$.RepoLink}}" data-attachment-url="{{$.RepoLink}}/comments/{{.ID}}/attachments"></div>
{{if .Attachments}}
- <div class="ui clearing divider"></div>
- <div class="ui middle aligned padded grid">
- {{template "repo/issue/view_content/attachments" Dict "ctx" $ "Attachments" .Attachments}}
+ <div class="dropzone-attachments">
+ <div class="ui clearing divider"></div>
+ <div class="ui middle aligned padded grid">
+ {{template "repo/issue/view_content/attachments" Dict "ctx" $ "Attachments" .Attachments}}
+ </div>
</div>
{{end}}
</div>
diff --git a/templates/repo/upload.tmpl b/templates/repo/upload.tmpl
index 93bc098dae..9215da2b19 100644
--- a/templates/repo/upload.tmpl
+++ b/templates/repo/upload.tmpl
@@ -1,6 +1,7 @@
<div
class="ui dropzone"
id="dropzone"
+ data-link-url="{{.UploadLinkUrl}}"
data-upload-url="{{.UploadUrl}}"
data-remove-url="{{.UploadRemoveUrl}}"
data-accepts="{{.UploadAccepts}}"