1
0
mirror of https://github.com/jhillyerd/inbucket.git synced 2025-12-20 02:57:05 +00:00

Attachment display & downloading!

This commit is contained in:
James Hillyerd
2012-11-05 21:35:34 -08:00
parent 09b8534b9b
commit 1da98a9f7e
5 changed files with 120 additions and 41 deletions

View File

@@ -327,3 +327,28 @@ table.metrics {
.metrics td.sparkline {
width: 170px;
}
#emailAttachments {
border-collapse: collapse;
}
#emailAttachments th, #emailAttachments td {
text-align: left;
padding: 0 3px 3px 0;
}
#emailAttachments .fileName:before {
content: '\203A\00A0';
}
#emailAttachments a {
background: #8ac6dc;
color: #fff;
text-decoration: none;
padding: 0 5px;
}
#emailAttachments a:hover {
background: #becf74;
}

View File

@@ -1,3 +1,5 @@
{{$name := .name}}
{{$id := .message.Id}}
<div id="emailActions">
<a href="javascript:deleteMessage('{{.message.Id}}');">Delete</a>
<a href="javascript:messageSource('{{.message.Id}}');">Source</a>
@@ -15,6 +17,21 @@
<td>{{.message.Date}}</td>
</tr>
<table>
{{with .attachments}}
<table id="emailAttachments">
<tr><th colspan="4">Attachments:</th></tr>
{{range $i, $e := .}}
<tr>
<td class="fileName">{{$e.FileName}}</td>
<td>({{$e.ContentType}})</td>
<td><a href="/mailbox/vattach/{{$name}}/{{$id}}/{{$i}}/{{$e.FileName}}" target="_blank">View</a></td>
<td><a href="/mailbox/dattach/{{$name}}/{{$id}}/{{$i}}/{{$e.FileName}}">Download</a></td>
</tr>
{{end}}
</table>
{{end}}
<div id="emailSubject"><h3>{{.message.Subject}}</h3></div>
<div id="emailBody">{{.body}}</div>