mirror of
https://github.com/jhillyerd/inbucket.git
synced 2025-12-23 04:27:03 +00:00
Copy integral templates into bootstrap theme
This commit is contained in:
1
themes/bootstrap/templates/mailbox/_html.html
Normal file
1
themes/bootstrap/templates/mailbox/_html.html
Normal file
@@ -0,0 +1 @@
|
||||
{{.body}}
|
||||
12
themes/bootstrap/templates/mailbox/_list.html
Normal file
12
themes/bootstrap/templates/mailbox/_list.html
Normal file
@@ -0,0 +1,12 @@
|
||||
{{$name := .name}}
|
||||
{{range .messages}}
|
||||
<div class="box listEntry" id="{{.Id}}">
|
||||
<div class="subject">{{.Subject}}</div>
|
||||
<div class="from">{{.From}}</div>
|
||||
<div class="date">{{friendlyTime .Date}}</div>
|
||||
</div>
|
||||
{{else}}
|
||||
<div class="box">
|
||||
<p style="height: 30px; padding-left: 10px;">No messages!</p>
|
||||
</div>
|
||||
{{end}}
|
||||
39
themes/bootstrap/templates/mailbox/_show.html
Normal file
39
themes/bootstrap/templates/mailbox/_show.html
Normal file
@@ -0,0 +1,39 @@
|
||||
{{$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>
|
||||
{{if .htmlAvailable}}
|
||||
<a href="javascript:htmlView('{{.message.Id}}');">HTML</a>
|
||||
{{end}}
|
||||
</div>
|
||||
<table id="emailHeader">
|
||||
<tr>
|
||||
<th>From:</th>
|
||||
<td>{{.message.From}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Date:</th>
|
||||
<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>
|
||||
|
||||
92
themes/bootstrap/templates/mailbox/index.html
Normal file
92
themes/bootstrap/templates/mailbox/index.html
Normal file
@@ -0,0 +1,92 @@
|
||||
{{define "title"}}{{printf "Inbucket for %v" .name}}{{end}}
|
||||
{{$name := .name}}
|
||||
|
||||
{{define "script"}}
|
||||
<script>
|
||||
var selected = "{{.selected}}"
|
||||
function messageLoaded(responseText, textStatus, XMLHttpRequest) {
|
||||
if (textStatus == "error") {
|
||||
alert("Failed to load message, server said:\n" + responseText)
|
||||
} else {
|
||||
window.scrollTo(0,0)
|
||||
}
|
||||
}
|
||||
|
||||
function listLoaded() {
|
||||
$('.listEntry').hover(
|
||||
function() {
|
||||
$(this).addClass("listEntryHover")
|
||||
},
|
||||
function() {
|
||||
$(this).removeClass("listEntryHover")
|
||||
}
|
||||
).click(
|
||||
function() {
|
||||
$('.listEntry').removeClass("listEntrySelected")
|
||||
$(this).addClass("listEntrySelected")
|
||||
$('#emailContent').load('/mailbox/{{.name}}/' + this.id, messageLoaded)
|
||||
}
|
||||
)
|
||||
$("#messageList").slideDown()
|
||||
if (selected != "") {
|
||||
$("#" + selected).click()
|
||||
selected = ""
|
||||
}
|
||||
}
|
||||
|
||||
function loadList() {
|
||||
$('#messageList').load("/mailbox/{{.name}}", listLoaded)
|
||||
}
|
||||
|
||||
function reloadList() {
|
||||
$('#messageList').hide()
|
||||
loadList()
|
||||
}
|
||||
|
||||
function listInit() {
|
||||
$("#messageList").hide()
|
||||
loadList()
|
||||
}
|
||||
|
||||
function deleteMessage(id) {
|
||||
$('#emailContent').empty()
|
||||
$.ajax({
|
||||
type: 'DELETE',
|
||||
url: '/mailbox/{{.name}}/' + id,
|
||||
success: reloadList
|
||||
})
|
||||
}
|
||||
|
||||
function htmlView(id) {
|
||||
window.open('/mailbox/{{.name}}/' + id + "/html", '_blank',
|
||||
'width=800,height=600,' +
|
||||
'menubar=yes,resizable=yes,scrollbars=yes,status=yes,toolbar=yes')
|
||||
}
|
||||
|
||||
function messageSource(id) {
|
||||
window.open('/mailbox/{{.name}}/' + id + "/source", '_blank',
|
||||
'width=800,height=600,' +
|
||||
'menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no')
|
||||
}
|
||||
|
||||
$(document).ready(listInit)
|
||||
</script>
|
||||
{{end}}
|
||||
|
||||
{{define "menu"}}
|
||||
<div id="logo">
|
||||
<h1><a href="#">inbucket</a></h1>
|
||||
<h2>mail for {{.name}}</h2>
|
||||
</div>
|
||||
<div class="box" style="text-align:center; padding-bottom:10px;">
|
||||
<a href="javascript:reloadList()">Refresh List</a>
|
||||
</div>
|
||||
<div id="messageList"></div>
|
||||
{{end}}
|
||||
|
||||
{{define "content"}}
|
||||
<div id="emailContent">
|
||||
<p>Select a message at left, or enter a different username into the box on upper right.</p>
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
Reference in New Issue
Block a user