Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Message Delivery #53

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add a 'Deliver' action to the UI for a message
"Deliver" button is replaced with text while waiting for delivery
hundredwatt committed Sep 9, 2012
commit 709a86015ddca9472437c3e1ee518e17ea71b666
15 changes: 15 additions & 0 deletions public/javascripts/application.coffee
Original file line number Diff line number Diff line change
@@ -190,6 +190,21 @@ class MailCatcher
else
$('#message .metadata .attachments').hide()

$('#message .views .deliver a').click (e)->
e.preventDefault()
$deliver = $(this).parent()
deliver_html = $(this).parent().html()
$deliver.text('Delivering...')
$.ajax
url: "/messages/#{id}/deliver"
type: 'POST'
success: =>
$deliver.html(deliver_html)
alert 'Message successfully delivered'
error: =>
$deliver.html(deliver_html)
alert 'An error occurred while attempting to deliver this message'

$('#message .views .download a').attr 'href', "/messages/#{id}.eml"

if $('#message .views .tab.analysis.selected').length
61 changes: 51 additions & 10 deletions public/javascripts/application.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions views/index.haml
Original file line number Diff line number Diff line change
@@ -59,4 +59,7 @@
%li.action.download
%a.button{:href => '#'}
%span Download
%li.action.deliver
%a.button{:href => '#'}
%span Deliver
%iframe.body