1
0
mirror of https://github.com/jhillyerd/inbucket.git synced 2025-12-17 09:37:02 +00:00

Basic AJAX GUI is now functional

This commit is contained in:
James Hillyerd
2012-10-11 11:49:23 -07:00
parent 31395891a4
commit 1481c5c9d8
5 changed files with 66 additions and 20 deletions

View File

@@ -3,13 +3,10 @@
{{template "menu.html" .}} {{template "menu.html" .}}
<div id="colTwo"> <div id="colTwo">
<h1>Inbucket</h1> <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>
<form action="/mailbox" method="GET"> <p>To view email for a particular address, enter the username portion
<b>Enter a username to view their mailbox</b> of the address into the box on the upper right and click <em>go</em>.</p>
<input type="text" name="name">
<input type=submit value="Go">
</form>
</div> </div>
{{template "footer.html" .}} {{template "footer.html" .}}

View File

@@ -1,5 +1,24 @@
{{template "header.html" .}} {{template "header.html" .}}
{{$name := .name}} {{$name := .name}}
<script>
$(document).ready(function() {
$('.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)
}
)
});
</script>
<div id="colOne"> <div id="colOne">
<div id="logo"> <div id="logo">
<h1><a href="#">inbucket</a></h1> <h1><a href="#">inbucket</a></h1>
@@ -7,20 +26,22 @@
</div> </div>
{{range .messages}} {{range .messages}}
<div class="box listEntry"> <div class="box listEntry" id="{{.Id}}">
<div class="subject">{{/*<a href="/mailbox/show/{{$name}}/{{.Id}}">*/}}{{.Subject}}</div> <div class="subject">{{/*<a href="/mailbox/show/{{$name}}/{{.Id}}">*/}}{{.Subject}}</div>
<div class="from">{{.From}}</div> <div class="from">{{.From}}</div>
<div class="date">{{.Date}}</div> <div class="date">{{.Date}}</div>
</div> </div>
{{else}} {{else}}
<div class="box"> <div class="box">
No messages! <p style="height: 30px; padding-left: 10px;">No messages!</p>
</div> </div>
{{end}} {{end}}
</div> </div>
<div id="colTwo"> <div id="colTwo">
<div id="emailContent">
<p>Select a message at left, or enter a different username into the box on upper right.</p> <p>Select a message at left, or enter a different username into the box on upper right.</p>
</div>
</div> </div>
{{template "footer.html" .}} {{template "footer.html" .}}

View File

@@ -1,7 +1,4 @@
{{template "header.html" .}} <table id="emailHeader">
<h1>{{.message.Subject}}</h1>
<table>
<tr> <tr>
<th>From:</th> <th>From:</th>
<td>{{.message.From}}</td> <td>{{.message.From}}</td>
@@ -11,8 +8,7 @@
<td>{{.message.Date}}</td> <td>{{.message.Date}}</td>
</tr> </tr>
<table> <table>
<h3 id="emailSubject">{{.message.Subject}}</h3>
<pre>{{.body}}</pre> <pre id="emailBody">{{.body}}</pre>
{{template "footer.html" .}}

View File

@@ -10,7 +10,7 @@ Released for free under a Creative Commons Attribution 2.5 License
<title>{{.title}}</title> <title>{{.title}}</title>
<link href="/public/stylesheets/main.css" rel="stylesheet" type="text/css" /> <link href="/public/stylesheets/main.css" rel="stylesheet" type="text/css" />
<link rel="shortcut icon" type="image/png" href="/public/images/favicon.png"> <link rel="shortcut icon" type="image/png" href="/public/images/favicon.png">
<script src="/public/javascripts/jquery-1.5.2.min.js" type="text/javascript" charset="utf-8"></script> <script src="/public/js/jquery-1.5.2.min.js" type="text/javascript" charset="utf-8"></script>
{{range .moreStyles}} {{range .moreStyles}}
<link rel="stylesheet" type="text/css" href="/public/{{.}}"> <link rel="stylesheet" type="text/css" href="/public/{{.}}">
{{end}} {{end}}
@@ -22,7 +22,7 @@ Released for free under a Creative Commons Attribution 2.5 License
<div id="header"> <div id="header">
<ul id="menu"> <ul id="menu">
<li><a href="/" accesskey="1" title="">Home</a></li> <li><a href="/" accesskey="1" title="">Home</a></li>
<li><a href="/about" accesskey="2" title="">About</a></li> <li><a href="/" accesskey="2" title="">About</a></li>
</ul> </ul>
<form id="search" action="/mailbox" method="GET"> <form id="search" action="/mailbox" method="GET">
<fieldset> <fieldset>

View File

@@ -10,7 +10,7 @@ body {
margin: 20px 0; margin: 20px 0;
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif; font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
font-size: 12px; font-size: 12px;
color: #A1A1A1; color: #808080;
} }
h1 { h1 {
@@ -253,3 +253,35 @@ a:hover {
color: #2582A4; color: #2582A4;
font-weight: bold; font-weight: bold;
} }
.listEntrySelected {
background: #becf74;
color: #666;
}
.listEntryHover {
background: #8ac6dc;
color: #666;
}
#emailContent {
padding-bottom: 20px;
}
#emailHeader {
border-collapse: collapse;
}
#emailHeader th, #emailHeader td {
text-align: left;
padding: 0 3px 3px 0;
}
#emailSubject {
border-bottom: 1px #606060 solid;
}
#emailBody {
color: #000000;
}