aboutsummaryrefslogtreecommitdiffstats
path: root/templates/repo/issue/view_content/attachments.tmpl
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2023-04-20 14:39:44 +0800
committerGitHub <noreply@github.com>2023-04-20 02:39:44 -0400
commitde2268ffab922de67f51e98541d0f9078795ac5d (patch)
treea9f79d0bcb2914d64ce1399a025fb01e887cc7eb /templates/repo/issue/view_content/attachments.tmpl
parent92e07f270aa925d518b13686f78befb63da0a747 (diff)
downloadgitea-de2268ffab922de67f51e98541d0f9078795ac5d.tar.gz
gitea-de2268ffab922de67f51e98541d0f9078795ac5d.zip
Fix issue attachment handling (#24202)
Close #24195 Some of the changes are taken from my another fix https://github.com/go-gitea/gitea/pull/20147/commits/f07b0de997125c9b79cc5af27966a7cdd1803a4d in #20147 (although that PR was discarded ....) The bug is: 1. The old code doesn't handle `removedfile` event correctly 2. The old code doesn't provide attachments for type=CommentTypeReview This PR doesn't intend to refactor the "upload" code to a perfect state (to avoid making the review difficult), so some legacy styles are kept. --------- Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: Giteabot <teabot@gitea.io>
Diffstat (limited to 'templates/repo/issue/view_content/attachments.tmpl')
-rw-r--r--templates/repo/issue/view_content/attachments.tmpl20
1 files changed, 10 insertions, 10 deletions
diff --git a/templates/repo/issue/view_content/attachments.tmpl b/templates/repo/issue/view_content/attachments.tmpl
index 3c0190b7d8..7a429c31ec 100644
--- a/templates/repo/issue/view_content/attachments.tmpl
+++ b/templates/repo/issue/view_content/attachments.tmpl
@@ -1,11 +1,11 @@
<div class="dropzone-attachments">
{{if .Attachments}}
- <div class="ui clearing divider"></div>
+ <div class="ui divider"></div>
{{end}}
- <div class="ui middle aligned padded grid">
- {{$hasThumbnails := false}}
- {{- range .Attachments -}}
- <div class="twelve wide column" style="padding: 6px;">
+ {{$hasThumbnails := false}}
+ {{- range .Attachments -}}
+ <div class="gt-df">
+ <div class="gt-f1 gt-p-3">
<a target="_blank" rel="noopener noreferrer" href="{{.DownloadURL}}" title='{{$.ctxData.locale.Tr "repo.issues.attachment.open_tab" .Name}}'>
{{if FilenameIsImage .Name}}
{{if not (containGeneric $.Content .UUID)}}
@@ -18,20 +18,20 @@
<span><strong>{{.Name}}</strong></span>
</a>
</div>
- <div class="four wide column" style="padding: 0px;">
+ <div class="gt-p-3 gt-df gt-ac">
<span class="ui text grey right">{{.Size | FileSize}}</span>
</div>
- {{end -}}
- </div>
+ </div>
+ {{end -}}
{{if $hasThumbnails}}
- <div class="ui clearing divider"></div>
+ <div class="ui divider"></div>
<div class="ui small thumbnails">
{{- range .Attachments -}}
{{if FilenameIsImage .Name}}
{{if not (containGeneric $.Content .UUID)}}
<a target="_blank" rel="noopener noreferrer" href="{{.DownloadURL}}">
- <img src="{{.DownloadURL}}" title='{{$.ctxData.locale.Tr "repo.issues.attachment.open_tab" .Name}}'>
+ <img alt="{{.Name}}" src="{{.DownloadURL}}" title='{{$.ctxData.locale.Tr "repo.issues.attachment.open_tab" .Name}}'>
</a>
{{end}}
{{end}}