mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-12 13:16:49 +00:00
d5f2c9d74d
Backport #24202 Close #24195 Fix the bug: 1. The old code doesn't handle `removedfile` event correctly 2. The old code doesn't provide attachments for type=CommentTypeReview --------- Co-authored-by: silverwind <me@silverwind.io>
43 lines
1.2 KiB
Handlebars
43 lines
1.2 KiB
Handlebars
<div class="dropzone-attachments">
|
|
{{if .Attachments}}
|
|
<div class="ui divider"></div>
|
|
{{end}}
|
|
{{$hasThumbnails := false}}
|
|
{{- range .Attachments -}}
|
|
<div class="gt-df">
|
|
<div class="gt-f1 gt-p-3">
|
|
<a target="_blank" rel="noopener noreferrer" href="{{.DownloadURL}}" title='{{$.ctx.locale.Tr "repo.issues.attachment.open_tab" .Name}}'>
|
|
{{if FilenameIsImage .Name}}
|
|
{{if not (containGeneric $.Content .UUID)}}
|
|
{{$hasThumbnails = true}}
|
|
{{end}}
|
|
{{svg "octicon-file"}}
|
|
{{else}}
|
|
{{svg "octicon-desktop-download"}}
|
|
{{end}}
|
|
<span><strong>{{.Name}}</strong></span>
|
|
</a>
|
|
</div>
|
|
<div class="gt-p-3 gt-df gt-ac">
|
|
<span class="ui text grey right">{{.Size | FileSize}}</span>
|
|
</div>
|
|
</div>
|
|
{{end -}}
|
|
|
|
{{if $hasThumbnails}}
|
|
<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='{{$.ctx.locale.Tr "repo.issues.attachment.open_tab" .Name}}'>
|
|
</a>
|
|
{{end}}
|
|
{{end}}
|
|
{{end -}}
|
|
</div>
|
|
{{end}}
|
|
|
|
</div>
|