aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2014-09-01 16:00:19 -0700
committerAdam Soltys <[email protected]>2014-09-01 16:00:19 -0700
commit9fa89028a9475bbd05534c20c6b49c5820900a25 (patch)
treea406df447d9138fd54d81914e1f9aaba5fd66943
parent4e5d09cfe0e62ecde31482f3563277b3585860f9 (diff)
downloadcoinos-server-9fa89028a9475bbd05534c20c6b49c5820900a25.tar.gz
coinos-server-9fa89028a9475bbd05534c20c6b49c5820900a25.zip
Confirm transaction delete
-rw-r--r--public/js/report.coffee14
-rw-r--r--views/transactions/index.html13
2 files changed, 25 insertions, 2 deletions
diff --git a/public/js/report.coffee b/public/js/report.coffee
index 1aa085a6..7989c211 100644
--- a/public/js/report.coffee
+++ b/public/js/report.coffee
@@ -61,6 +61,7 @@ display = (transactions) ->
amount = received * exchange
notes = @notes
txid = @txid
+ address = @address
date = moment(@date, 'YYYY-MM-DD h:mm:ss').format('MMM D h:mma')
row = $("""
@@ -79,17 +80,30 @@ display = (transactions) ->
$('.report tbody').append(row)
row.click(->
+ $('#confirm, #yousure').hide()
+ $('#buttons, #modal textarea').show()
notes = $(this).attr('data-notes')
$('#modal').modal()
$('#modal textarea').val('')
+ $('#modal .btn-primary').toggle(address?)
$('#modal .btn-danger').off().click(->
+ $('#yousure, #confirm').show()
+ $('#buttons, #modal textarea').hide()
+ )
+
+ $('#confirm .btn-danger').click(->
$.ajax(type: 'delete', url: "/#{$('#user').val()}/transactions/#{txid}")
$('#modal').modal('hide')
row.remove()
)
+ $('#modal .btn-primary').off().click(->
+ window.open("https://blockchain.info/address/#{address}", '_blank')
+ $('#modal').modal('hide')
+ )
+
$('#modal textarea').off().change(->
notes = $(this).val()
$.post("/transactions/#{txid}", notes: $(this).val()) if txid
diff --git a/views/transactions/index.html b/views/transactions/index.html
index 3584e832..dcb76580 100644
--- a/views/transactions/index.html
+++ b/views/transactions/index.html
@@ -45,10 +45,19 @@
</div>
<div class="modal-body">
<textarea style="width: 100%; height: 100px;" placeholder="Notes"></textarea>
+ <p id="yousure">You sure?</p>
</div>
<div class="modal-footer">
- <button type="button" class="btn btn-danger">Delete Transaction</button>
- <button type="button" class="btn btn-default" data-dismiss="modal">Done</button>
+ <div id="buttons">
+ <button type="button" class="btn btn-danger" tabindex="-1">Delete Transaction</button>
+ <button type="button" class="btn btn-primary">View Blockchain</button>
+ <button type="button" class="btn btn-default" data-dismiss="modal">Done</button>
+ </div>
+
+ <div id="confirm">
+ <button type="button" class="btn btn-default" data-dismiss="modal">No</button>
+ <button type="button" class="btn btn-danger">Yes</button>
+ </div>
</div>
</div>
</div>