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

Added partial templates

mailbox/list now renders
This commit is contained in:
James Hillyerd
2012-10-21 12:42:54 -07:00
parent 9c94bb2ab1
commit 71bb52a64a
17 changed files with 238 additions and 147 deletions

View File

@@ -141,6 +141,7 @@ a:hover {
#content {
width: 928px;
min-height: 300px;
margin: 0 auto;
}
@@ -266,7 +267,6 @@ a:hover {
#emailContent {
padding-bottom: 20px;
min-height: 300px;
}
#emailHeader {

View File

@@ -4,42 +4,50 @@ Design by Free CSS Templates
http://www.freecsstemplates.org
Released for free under a Creative Commons Attribution 2.5 License
-->
{{define "col1menu"}}{{/* Used inside #content div */}}
<div id="colOne">
<div id="logo">
<h1><a href="#">inbucket</a></h1>
<h2>email testing service</h2>
</div>
</div>
{{end}}
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{{template "title" .}}</title>
<link href="/public/main.css" rel="stylesheet" type="text/css" />
<link rel="shortcut icon" type="image/png" href="/public/images/favicon.png">
<script src="/public/jquery-1.5.2.min.js" type="text/javascript" charset="utf-8"></script>
</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">
{{template "content" .}}
</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>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{{template "title" .}}</title>
<link href="/public/main.css" rel="stylesheet" type="text/css" />
<link rel="shortcut icon" type="image/png" href="/public/images/favicon.png">
<script src="/public/jquery-1.5.2.min.js" type="text/javascript" charset="utf-8"></script>
{{template "script" .}}
</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="{{reverse "MailboxIndex"}}" 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">
<div id="colOne">
{{template "menu" .}}
</div>
<div id="colTwo">
{{with .ctx.Session.Flashes "errors"}}
<div class="errors">
<p>Please fix the following errors and resubmit:<p>
<ul>
{{range .}}
<li>{{.}}</li>
{{end}}
</ul>
</div>
{{end}}
{{template "content" .}}
</div>
</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

@@ -1,7 +1,7 @@
{{$title := printf "Inbucket for %v" .name}}
{{set "title" $title .}}
{{template "header.html" .}}
{{define "title"}}{{printf "Inbucket for %v" .name}}{{end}}
{{$name := .name}}
{{define "script"}}
<script>
function listLoaded() {
$('.listEntry').hover(
@@ -15,14 +15,14 @@
function() {
$('.listEntry').removeClass("listEntrySelected")
$(this).addClass("listEntrySelected")
$('#emailContent').load('/mailbox/show/{{$name}}/' + this.id)
$('#emailContent').load('/mailbox/show/{{.name}}/' + this.id)
}
)
$("#messageList").slideDown()
}
function loadList() {
$('#messageList').load("/mailbox/list/{{$name}}", listLoaded)
$('#messageList').load("/mailbox/list/{{.name}}", listLoaded)
}
function reloadList() {
@@ -39,44 +39,41 @@
$('#emailContent').empty()
$.ajax({
type: 'POST',
url: '/mailbox/delete/{{$name}}/' + id,
url: '/mailbox/delete/{{.name}}/' + id,
success: reloadList
})
}
function htmlView(id) {
window.open('/mailbox/html/{{$name}}/' + id, '_blank',
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',
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>
{{end}}
<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>
{{define "menu"}}
<div id="logo">
<h1><a href="#">inbucket</a></h1>
<h2>mail for {{.name}}</h2>
</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 class="box" style="text-align:center; padding-bottom:10px;">
<a href="javascript:reloadList()">Refresh List</a>
</div>
<div id="messageList"></div>
{{end}}
{{template "footer.html" .}}
{{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}}

View File

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

View File

@@ -1,11 +0,0 @@
{{define "title"}}Inbucket{{end}}
{{define "content"}}
{{template "col1menu" .}}
<div id="colTwo">
<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>
{{end}}

View File

@@ -0,0 +1,19 @@
{{define "title"}}Inbucket{{end}}
{{define "script"}}{{end}}
{{define "menu"}}
<div id="logo">
<h1><a href="/">inbucket</a></h1>
<h2>email testing service</h2>
</div>
{{end}}
{{define "content"}}
<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>
{{end}}