1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

[Fix] Release attachment should use DownloadURL() not Name (#9529)

* Handle if two or more attachments have the same name
* previously only the first could be downloaded - now each is downloadable
* dos also take care of  #6506 (fix was: #6512)
* use func DownloadURL() at issue attatchments too
This commit is contained in:
6543
2019-12-29 00:33:13 +01:00
committed by zeripath
parent 599c0ee75f
commit 261c3a56a2
3 changed files with 8 additions and 8 deletions

View File

@@ -1,9 +1,9 @@
{{range .Attachments}}
<a target="_blank" rel="noopener noreferrer" href="{{AppSubUrl}}/attachments/{{.UUID}}">
<a target="_blank" rel="noopener noreferrer" href="{{.DownloadURL}}">
{{if FilenameIsImage .Name}}
<img class="ui image" src="{{AppSubUrl}}/attachments/{{.UUID}}" title='{{$.ctx.i18n.Tr "repo.issues.attachment.open_tab" .Name}}'>
<img class="ui image" src="{{.DownloadURL}}" title='{{$.ctx.i18n.Tr "repo.issues.attachment.open_tab" .Name}}'>
{{else}}
<span class="ui image octicon octicon-desktop-download" title='{{$.ctx.i18n.Tr "repo.issues.attachment.download" .Name}}'></span>
{{end}}
</a>
{{end}}
{{end}}