mirror of
https://github.com/jhillyerd/inbucket.git
synced 2025-12-18 01:57:02 +00:00
Many small refinements to front/backend UI
Changes: - Added a friendlyTime helper for nicer timestamps - Added validation to most action methods - Added error flash to several template files - Now making use to c.RenderError() to handle action errors - Removed message list slideUp() effect, takes too long - Fixed a problem with my vim indentation configuration, so CSS and HTML should be indented more consistently.
This commit is contained in:
@@ -3,6 +3,8 @@
|
||||
{{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
|
||||
|
||||
@@ -3,54 +3,54 @@
|
||||
{{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 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 loadList() {
|
||||
$('#messageList').load("/mailbox/list/{{$name}}", listLoaded)
|
||||
}
|
||||
|
||||
function listInit() {
|
||||
$("#messageList").hide()
|
||||
loadList()
|
||||
}
|
||||
|
||||
function deleteMessage(id) {
|
||||
$('#emailContent').empty()
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: '/mailbox/delete/{{$name}}/' + id,
|
||||
success: reloadList
|
||||
})
|
||||
}
|
||||
function reloadList() {
|
||||
$('#messageList').hide()
|
||||
loadList()
|
||||
}
|
||||
|
||||
function messageSource(id) {
|
||||
window.open('/mailbox/source/{{$name}}/' + id, '_blank',
|
||||
'width=800,height=600,' +
|
||||
'menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no')
|
||||
}
|
||||
function listInit() {
|
||||
$("#messageList").hide()
|
||||
loadList()
|
||||
}
|
||||
|
||||
$(document).ready(listInit)
|
||||
function deleteMessage(id) {
|
||||
$('#emailContent').empty()
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: '/mailbox/delete/{{$name}}/' + id,
|
||||
success: reloadList
|
||||
})
|
||||
}
|
||||
|
||||
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">
|
||||
@@ -59,12 +59,14 @@
|
||||
<h2>mail for {{.name}}</h2>
|
||||
</div>
|
||||
<div class="box" style="text-align:center; padding-bottom:10px;">
|
||||
<a href="javascript:reloadList()">Refresh List</a>
|
||||
<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>
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
{{$name := .name}}
|
||||
{{range .messages}}
|
||||
<div class="box listEntry" id="{{.Id}}">
|
||||
<div class="subject">{{/*<a href="/mailbox/show/{{$name}}/{{.Id}}">*/}}{{.Subject}}</div>
|
||||
<div class="subject">{{.Subject}}</div>
|
||||
<div class="from">{{.From}}</div>
|
||||
<div class="date">{{.Date}}</div>
|
||||
<div class="date">{{friendlyTime .Date}}</div>
|
||||
</div>
|
||||
{{else}}
|
||||
<div class="box">
|
||||
|
||||
10
app/views/errors.html
Normal file
10
app/views/errors.html
Normal 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}}
|
||||
Reference in New Issue
Block a user