mirror of
https://github.com/go-gitea/gitea.git
synced 2026-09-04 20:13:24 +09:00
43 lines
1.3 KiB
Handlebars
43 lines
1.3 KiB
Handlebars
<div class="dropzone-attachments">
|
|
{{if .Attachments}}
|
|
<div class="divider"></div>
|
|
{{end}}
|
|
{{$hasThumbnails := false}}
|
|
{{- range $att := .Attachments -}}
|
|
<div class="tw-flex">
|
|
<div class="tw-flex-1 tw-p-2">
|
|
<a target="_blank" href="{{$att.DownloadURL ctx}}" title="{{ctx.Locale.Tr "repo.issues.attachment.open_tab" $att.Name}}">
|
|
{{if FilenameIsImage $att.Name}}
|
|
{{if not (StringUtils.Contains (StringUtils.ToString $.RenderedContent) $att.UUID)}}
|
|
{{$hasThumbnails = true}}
|
|
{{end}}
|
|
{{svg "octicon-file"}}
|
|
{{else}}
|
|
{{svg "octicon-desktop-download"}}
|
|
{{end}}
|
|
<span><strong>{{$att.Name}}</strong></span>
|
|
</a>
|
|
</div>
|
|
<div class="flex-text-block tw-p-2">
|
|
<span class="ui tw-text-text-light">{{$att.Size | FormatByteSize}}</span>
|
|
</div>
|
|
</div>
|
|
{{end -}}
|
|
|
|
{{if $hasThumbnails}}
|
|
<div class="divider"></div>
|
|
<div class="ui small thumbnails">
|
|
{{- range .Attachments -}}
|
|
{{if FilenameIsImage .Name}}
|
|
{{if not (StringUtils.Contains (StringUtils.ToString $.RenderedContent) .UUID)}}
|
|
<a target="_blank" href="{{.DownloadURL ctx}}">
|
|
<img loading="lazy" alt="{{.Name}}" src="{{.DownloadURL ctx}}" title="{{ctx.Locale.Tr "repo.issues.attachment.open_tab" .Name}}">
|
|
</a>
|
|
{{end}}
|
|
{{end}}
|
|
{{end -}}
|
|
</div>
|
|
{{end}}
|
|
|
|
</div>
|