Improve representation of attachments in issues (#11141)
* Improves representation of attachments in issues to a list showing the file name and file size (see #6500 and #6089). Signed-off-by: Matthias Schoettle <git@mattsch.com> * Fixes indentation. Co-authored-by: zeripath <art27@cantab.net>tokarchuk/v1.17
parent
50475fff06
commit
33176e8d27
@ -1,9 +1,15 @@ |
||||
{{range .Attachments}} |
||||
<a target="_blank" rel="noopener noreferrer" href="{{.DownloadURL}}"> |
||||
{{if FilenameIsImage .Name}} |
||||
<img class="ui image" src="{{.DownloadURL}}" title='{{$.ctx.i18n.Tr "repo.issues.attachment.open_tab" .Name}}'> |
||||
{{else}} |
||||
<span class="ui image" title='{{$.ctx.i18n.Tr "repo.issues.attachment.download" .Name}}'>{{svg "octicon-desktop-download" 16}}</span> |
||||
{{end}} |
||||
</a> |
||||
<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" 16}}</span> |
||||
{{else}} |
||||
<span class="ui image">{{svg "octicon-desktop-download" 16}}</span> |
||||
{{end}} |
||||
<span><strong>{{.Name}}</strong></span> |
||||
</a> |
||||
</div> |
||||
<div class="four wide column" style="padding: 0px;"> |
||||
<span class="ui text grey right">{{.Size | FileSize}}</span> |
||||
</div> |
||||
{{end}} |
||||
|
Loading…
Reference in new issue