1
0
mirror of https://github.com/jhillyerd/inbucket.git synced 2026-01-09 04:31:55 +00:00

New directory layout - DOES NOT COMPILE

This commit is contained in:
James Hillyerd
2012-10-20 16:40:25 -07:00
parent 2b3491fc87
commit 3dd0206b48
35 changed files with 16 additions and 18 deletions

View File

@@ -0,0 +1,15 @@
{{set "title" "Inbucket" .}}
{{template "header.html" .}}
{{template "menu.html" .}}
<div id="colTwo">
{{template "errors.html" .}}
<p>Inbucket is an email testing service; it will accept email for any email
address and make it available to view without a password.</p>
<p>To view email for a particular address, enter the username portion
of the address into the box on the upper right and click <em>go</em>.</p>
</div>
{{template "footer.html" .}}

View File

@@ -0,0 +1 @@
{{.body}}

View File

@@ -0,0 +1,82 @@
{{$title := printf "Inbucket for %v" .name}}
{{set "title" $title .}}
{{template "header.html" .}}
{{$name := .name}}
<script>
function listLoaded() {
$('.listEntry').hover(
function() {
$(this).addClass("listEntryHover")
},
function() {
$(this).removeClass("listEntryHover")
}
).click(
function() {
$('.listEntry').removeClass("listEntrySelected")
$(this).addClass("listEntrySelected")
$('#emailContent').load('/mailbox/show/{{$name}}/' + this.id)
}
)
$("#messageList").slideDown()
}
function loadList() {
$('#messageList').load("/mailbox/list/{{$name}}", listLoaded)
}
function reloadList() {
$('#messageList').hide()
loadList()
}
function listInit() {
$("#messageList").hide()
loadList()
}
function deleteMessage(id) {
$('#emailContent').empty()
$.ajax({
type: 'POST',
url: '/mailbox/delete/{{$name}}/' + id,
success: reloadList
})
}
function htmlView(id) {
window.open('/mailbox/html/{{$name}}/' + id, '_blank',
'width=800,height=600,' +
'menubar=yes,resizable=yes,scrollbars=yes,status=yes,toolbar=yes')
}
function messageSource(id) {
window.open('/mailbox/source/{{$name}}/' + id, '_blank',
'width=800,height=600,' +
'menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no')
}
$(document).ready(listInit)
</script>
<div id="colOne">
<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>
</div>
<div id="colTwo">
{{template "errors.html" .}}
<div id="emailContent">
<p>Select a message at left, or enter a different username into the box on upper right.</p>
</div>
</div>
{{template "footer.html" .}}

View 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}}

View File

@@ -0,0 +1,21 @@
<div id="emailActions">
<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>
<div id="emailSubject"><h3>{{.message.Subject}}</h3></div>
<div id="emailBody">{{.body}}</div>

View File

@@ -0,0 +1,10 @@
{{if .errors}}
<div class="errors">
<p>Please fix the following errors and resubmit:<p>
<ul>
{{range .errors}}
<li>{{.Message}}</li>
{{end}}
</ul>
</div>
{{end}}

View File

@@ -0,0 +1,20 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Not found</title>
</head>
<body>
{{if eq .RunMode "dev"}}
{{template "errors/404-dev.html" .}}
{{else}}
{{with .Error}}
<h1>
{{.Title}}
</h1>
<p>
{{.Description}}
</p>
{{end}}
{{end}}
</body>
</html>

View File

@@ -0,0 +1,16 @@
<!DOCTYPE html>
<html>
<head>
<title>Application error</title>
</head>
<body>
{{if eq .RunMode "dev"}}
{{template "errors/500-dev.html" .}}
{{else}}
<h1>Oops, an error occured</h1>
<p>
This exception has been logged.
</p>
{{end}}
</body>
</html>

View File

@@ -0,0 +1,8 @@
</div>
<div id="footer">
<p>Inbucket is an open source project hosted at
<a href="http://github.com/jhillyerd/inbucket/">github</a>.
Design by <a href="http://www.freecsstemplates.org/">FCT</a>.</p>
</div>
</body>
</html>

View File

@@ -0,0 +1,34 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!--
Design by Free CSS Templates
http://www.freecsstemplates.org
Released for free under a Creative Commons Attribution 2.5 License
-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{{.title}}</title>
<link href="/public/stylesheets/main.css" rel="stylesheet" type="text/css" />
<link rel="shortcut icon" type="image/png" href="/public/images/favicon.png">
<script src="/public/js/jquery-1.5.2.min.js" type="text/javascript" charset="utf-8"></script>
{{range .moreStyles}}
<link rel="stylesheet" type="text/css" href="/public/{{.}}">
{{end}}
{{range .moreScripts}}
<script src="/public/{{.}}" type="text/javascript" charset="utf-8"></script>
{{end}}
</head>
<body>
<div id="header">
<ul id="menu">
<li><a href="/" accesskey="1" title="">Home</a></li>
<li><a href="/" accesskey="2" title="">About</a></li>
</ul>
<form id="search" action="/mailbox" method="GET">
<fieldset>
<input name="name" type="text" id="input1" />
<input name="submit" type="submit" id="input2" value="Go" />
</fieldset>
</form>
</div>
<div id="content">

View File

@@ -0,0 +1,6 @@
<div id="colOne">
<div id="logo">
<h1><a href="#">inbucket</a></h1>
<h2>email testing service</h2>
</div>
</div>