-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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>
- Loading branch information
1 parent
50475ff
commit 33176e8
Showing
3 changed files
with
25 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters