1
0
mirror of https://github.com/jhillyerd/inbucket.git synced 2025-12-18 10:07:02 +00:00

Message formatting checkpoint

This commit is contained in:
James Hillyerd
2015-08-18 21:20:42 -07:00
parent f48704b6a6
commit da28a8ee55
3 changed files with 77 additions and 55 deletions

View File

@@ -10,7 +10,8 @@ body {
}
.mailbox-header {
font-size: 20px;
text-align: center;
font-size: 18px;
}
.footer {
@@ -26,17 +27,34 @@ body {
margin: 20px 0;
}
.message-controls {
padding: 10px 0;
}
#emailContent {
padding-bottom: 20px;
}
#emailHeader {
border-collapse: collapse;
.message-header dl {
margin-bottom: 0;
}
#emailHeader th, #emailHeader td {
text-align: left;
padding: 0 3px 3px 0;
@media (min-width: 768px) {
.message-header .dl-horizontal dt {
width: 60px;
}
.message-header .dl-horizontal dd {
margin-left: 70px;
}
}
.message-attachments {
margin-top: 20px;
}
.message-attachments ul {
margin: 0
}
#emailSubject {
@@ -50,23 +68,6 @@ body {
margin-top: 15px;
}
#emailActions {
padding: 5px 0;
margin: 0 0 10px 0;
}
#emailActions a {
background: #8ac6dc;
color: #fff;
text-decoration: none;
font-weight: bold;
padding: 5px;
}
#emailActions a:hover {
background: #becf74;
}
.errors {
background-color: #ffa0a0;
color: #333;

View File

@@ -1,39 +1,60 @@
{{$name := .name}}
{{$id := .message.Id}}
<div id="emailActions">
<a href="/link/{{$name}}/{{$id}}">Link</a>
<a href="javascript:deleteMessage('{{.message.Id}}');">Delete</a>
<a href="javascript:messageSource('{{.message.Id}}');">Source</a>
<div class="btn-group btn-group-sm message-controls" role="group" aria-label="Message Controls">
<button type="button"
class="btn btn-default"
onClick="window.open('/link/{{$name}}/{{$id}}');">
<span class="glyphicon glyphicon-link" aria-hidden="true"></span>
Link
</button>
<button type="button"
class="btn btn-default"
onClick="deleteMessage('{{.message.Id}}');">
<span class="glyphicon glyphicon-trash" aria-hidden="true"></span>
Delete
</button>
<button type="button"
class="btn btn-default"
onClick="messageSource('{{.message.Id}}');">
<span class="glyphicon glyphicon-search" aria-hidden="true"></span>
Source
</button>
{{if .htmlAvailable}}
<a href="javascript:htmlView('{{.message.Id}}');">HTML</a>
<button type="button"
class="btn btn-default"
onClick="htmlView('{{.message.Id}}');">
<span class="glyphicon glyphicon-new-window" aria-hidden="true"></span>
HTML
</button>
{{end}}
</div>
<table id="emailHeader">
<tr>
<th>From:</th>
<td>{{.message.From}}</td>
</tr>
<tr>
<th>Date:</th>
<td>{{.message.Date}}</td>
</tr>
<table>
<div class="well well-sm message-header">
<dl class="dl-horizontal">
<dt>From:</dt>
<dd>{{.message.From}}</dd>
<dt>Date:</dt>
<dd>{{.message.Date}}</dd>
<dt>Subject:</dt>
<dd>{{.message.Subject}}</dd>
</dl>
</div>
<div id="message-body">{{.body}}</div>
{{with .attachments}}
<table id="emailAttachments">
<tr><th colspan="4">Attachments:</th></tr>
<div class="panel panel-default message-attachments">
<div class="panel-body">
<ul class="list-unstyled">
{{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>
<li>
{{$e.FileName}}
({{$e.ContentType}})
<a href="/mailbox/vattach/{{$name}}/{{$id}}/{{$i}}/{{$e.FileName}}" target="_blank">View</a>
<a href="/mailbox/dattach/{{$name}}/{{$id}}/{{$i}}/{{$e.FileName}}">Download</a>
</li>
{{end}}
</table>
</ul>
</div>
</div>
{{end}}
<div id="emailSubject"><h3>{{.message.Subject}}</h3></div>
<div id="emailBody">{{.body}}</div>

View File

@@ -69,7 +69,7 @@
{{define "content"}}
<div class="panel panel-primary">
<div class="panel-body text-center mailbox-header">
<div class="panel-heading mailbox-header">
<span class="glyphicon glyphicon-inbox" aria-hidden="true"></span>
{{.name}}
</div>